Files
2026-07-23 16:15:57 +09:00

14 lines
236 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";function ownKeys(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),i.push.apply(i,n)}return i}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(i),!0).forEach(function(e){_defineProperty(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}function _superPropGet(t,e,i,n){var r=_get2(_getPrototypeOf(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof r?function(t){return r.apply(i,t)}:r}function _get2(){return _get2="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=_superPropBase(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},_get2.apply(null,arguments)}function _superPropBase(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,o,s=[],l=!0,h=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){h=!0,r=t}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(h)throw r}}return s}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _callSuper(t,e,i){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,i||[],_getPrototypeOf(t).constructor):e.apply(t,i))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_toPropertyKey(n.key),n)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function _createForOfIteratorHelper(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)
/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/}!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(void 0,function(){var t,e,i,n,r,a,o,s,l,h,u,c=Object.freeze({__proto__:null,get Colors(){return Xa},get Decimation(){return qa},get Filler(){return po},get Legend(){return bo},get SubTitle(){return wo},get Title(){return xo},get Tooltip(){return Vo}});function f(){}var d=function(){var t=0;return function(){return t++}}();function v(t){return null==t}function p(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function g(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function y(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function m(t,e){return y(t)?t:e}function b(t,e){return void 0===t?e:t}var _=function(t,e){return"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e},x=function(t,e){return"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t};function k(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function w(t,e,i,n){var r,a,o;if(p(t))if(a=t.length,n)for(r=a-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<a;r++)e.call(i,t[r],r);else if(g(t))for(a=(o=Object.keys(t)).length,r=0;r<a;r++)e.call(i,t[o[r]],o[r])}function M(t,e){var i,n,r,a;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],a=e[i],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function P(t){if(p(t))return t.map(P);if(g(t)){for(var e=Object.create(null),i=Object.keys(t),n=i.length,r=0;r<n;++r)e[i[r]]=P(t[i[r]]);return e}return t}function S(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function C(t,e,i,n){if(S(t)){var r=e[t],a=i[t];g(r)&&g(a)?O(r,a,n):e[t]=P(a)}}function O(t,e,i){var n=p(e)?e:[e],r=n.length;if(!g(t))return t;for(var a,o=(i=i||{}).merger||C,s=0;s<r;++s)if(g(a=n[s]))for(var l=Object.keys(a),h=0,u=l.length;h<u;++h)o(l[h],t,a,i);return t}function A(t,e){return O(t,e,{merger:D})}function D(t,e,i){if(S(t)){var n=e[t],r=i[t];g(n)&&g(r)?A(n,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=P(r))}}var T={"":function(t){return t},x:function(t){return t.x},y:function(t){return t.y}};function I(t){var e,i=[],n="",r=_createForOfIteratorHelper(t.split("."));try{for(r.s();!(e=r.n()).done;){(n+=e.value).endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="")}}catch(t){r.e(t)}finally{r.f()}return i}function L(t,e){var i=T[e]||(T[e]=function(t){var e=I(t);return function(t){var i,n=_createForOfIteratorHelper(e);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(""===r)break;t=t&&t[r]}}catch(t){n.e(t)}finally{n.f()}return t}}(e));return i(t)}function R(t){return t.charAt(0).toUpperCase()+t.slice(1)}var E=function(t){return void 0!==t},F=function(t){return"function"==typeof t},z=function(t,e){if(t.size!==e.size)return!1;var i,n=_createForOfIteratorHelper(t);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!e.has(r))return!1}}catch(t){n.e(t)}finally{n.f()}return!0};function V(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}var B=Math.PI,H=2*B,j=H+B,W=Number.POSITIVE_INFINITY,N=B/180,Y=B/2,U=B/4,$=2*B/3,X=Math.log10,G=Math.sign;function K(t,e,i){return Math.abs(t-e)<i}function q(t){var e=Math.round(t);t=K(t,e,t/1e3)?e:t;var i=Math.pow(10,Math.floor(X(t))),n=t/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function J(t){var e,i=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(i.push(e),i.push(t/e));return n===(0|n)&&i.push(n),i.sort(function(t,e){return t-e}).pop(),i}function Z(t){return!function(t){return"symbol"==_typeof(t)||"object"==_typeof(t)&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Q(t,e){var i=Math.round(t);return i-e<=t&&i+e>=t}function tt(t,e,i){var n,r,a;for(n=0,r=t.length;n<r;n++)a=t[n][i],isNaN(a)||(e.min=Math.min(e.min,a),e.max=Math.max(e.max,a))}function et(t){return t*(B/180)}function it(t){return t*(180/B)}function nt(t){if(y(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}}function rt(t,e){var i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n),a=Math.atan2(n,i);return a<-.5*B&&(a+=H),{angle:a,distance:r}}function at(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ot(t,e){return(t-e+j)%H-B}function st(t){return(t%H+H)%H}function lt(t,e,i,n){var r=st(t),a=st(e),o=st(i),s=st(a-r),l=st(o-r),h=st(r-a),u=st(r-o);return r===a||r===o||n&&a===o||s>l&&h<u}function ht(t,e,i){return Math.max(e,Math.min(i,t))}function ut(t){return ht(t,-32768,32767)}function ct(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-6;return t>=Math.min(e,i)-n&&t<=Math.max(e,i)+n}function ft(t,e,i){i=i||function(i){return t[i]<e};for(var n,r=t.length-1,a=0;r-a>1;)i(n=a+r>>1)?a=n:r=n;return{lo:a,hi:r}}var dt=function(t,e,i,n){return ft(t,i,n?function(n){var r=t[n][e];return r<i||r===i&&t[n+1][e]===i}:function(n){return t[n][e]<i})},vt=function(t,e,i){return ft(t,i,function(n){return t[n][e]>=i})};function pt(t,e,i){for(var n=0,r=t.length;n<r&&t[n]<e;)n++;for(;r>n&&t[r-1]>i;)r--;return n>0||r<t.length?t.slice(n,r):t}var gt=["push","pop","shift","splice","unshift"];function yt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),gt.forEach(function(e){var i="_onData"+R(e),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];var o=n.apply(this,r);return t._chartjs.listeners.forEach(function(t){"function"==typeof t[i]&&t[i].apply(t,r)}),o}})}))}function mt(t,e){var i=t._chartjs;if(i){var n=i.listeners,r=n.indexOf(e);-1!==r&&n.splice(r,1),n.length>0||(gt.forEach(function(e){delete t[e]}),delete t._chartjs)}}function bt(t){var e=new Set(t);return e.size===t.length?t:Array.from(e)}var _t="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function xt(t,e){var i=[],n=!1;return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];i=a,n||(n=!0,_t.call(window,function(){n=!1,t.apply(e,i)}))}}function kt(t,e){var i;return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e?(clearTimeout(i),i=setTimeout(t,e,r)):t.apply(this,r),e}}var wt=function(t){return"start"===t?"left":"end"===t?"right":"center"},Mt=function(t,e,i){return"start"===t?e:"end"===t?i:(e+i)/2},Pt=function(t,e,i,n){return t===(n?"left":"right")?i:"center"===t?(e+i)/2:e};function St(t,e,i){var n=e.length,r=0,a=n;if(t._sorted){var o=t.iScale,s=t.vScale,l=t._parsed,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=o.axis,c=o.getUserBounds(),f=c.min,d=c.max,p=c.minDefined,g=c.maxDefined;if(p){if(r=Math.min(dt(l,u,f).lo,i?n:dt(e,u,o.getPixelForValue(f)).lo),h){var y=l.slice(0,r+1).reverse().findIndex(function(t){return!v(t[s.axis])});r-=Math.max(0,y)}r=ht(r,0,n-1)}if(g){var m=Math.max(dt(l,o.axis,d,!0).hi+1,i?0:dt(e,u,o.getPixelForValue(d),!0).hi+1);if(h){var b=l.slice(m-1).findIndex(function(t){return!v(t[s.axis])});m+=Math.max(0,b)}a=ht(m,r,n)-r}else a=n-r}return{start:r,count:a}}function Ct(t){var e=t.xScale,i=t.yScale,n=t._scaleRanges,r={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!n)return t._scaleRanges=r,!0;var a=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,r),a}var Ot=function(){return _createClass(function t(){_classCallCheck(this,t),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0},[{key:"_notify",value:function(t,e,i,n){var r=e.listeners[n],a=e.duration;r.forEach(function(n){return n({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)})})}},{key:"_refresh",value:function(){var t=this;this._request||(this._running=!0,this._request=_t.call(window,function(){t._update(),t._request=null,t._running&&t._refresh()}))}},{key:"_update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),i=0;this._charts.forEach(function(n,r){if(n.running&&n.items.length){for(var a,o=n.items,s=o.length-1,l=!1;s>=0;--s)(a=o[s])._active?(a._total>n.duration&&(n.duration=a._total),a.tick(e),l=!0):(o[s]=o[o.length-1],o.pop());l&&(r.draw(),t._notify(r,n,e,"progress")),o.length||(n.running=!1,t._notify(r,n,e,"complete"),n.initial=!1),i+=o.length}}),this._lastDate=e,0===i&&(this._running=!1)}},{key:"_getAnims",value:function(t){var e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}},{key:"listen",value:function(t,e,i){this._getAnims(t).listeners[e].push(i)}},{key:"add",value:function(t,e){var i;e&&e.length&&(i=this._getAnims(t).items).push.apply(i,_toConsumableArray(e))}},{key:"has",value:function(t){return this._getAnims(t).items.length>0}},{key:"start",value:function(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(function(t,e){return Math.max(t,e._duration)},0),this._refresh())}},{key:"running",value:function(t){if(!this._running)return!1;var e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}},{key:"stop",value:function(t){var e=this._charts.get(t);if(e&&e.items.length){for(var i=e.items,n=i.length-1;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}},{key:"remove",value:function(t){return this._charts.delete(t)}}])}(),At=new Ot;
/*!
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/
function Dt(t){return t+.5|0}var Tt=function(t,e,i){return Math.max(Math.min(t,i),e)};function It(t){return Tt(Dt(2.55*t),0,255)}function Lt(t){return Tt(Dt(255*t),0,255)}function Rt(t){return Tt(Dt(t/2.55)/100,0,1)}function Et(t){return Tt(Dt(100*t),0,100)}var Ft={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},zt=_toConsumableArray("0123456789ABCDEF"),Vt=function(t){return zt[15&t]},Bt=function(t){return zt[(240&t)>>4]+zt[15&t]},Ht=function(t){return(240&t)>>4==(15&t)};var jt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Wt(t,e,i){var n=e*Math.min(i,1-i),r=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return i-n*Math.max(Math.min(r-3,9-r,1),-1)};return[r(0),r(8),r(4)]}function Nt(t,e,i){var n=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(n+t/60)%6;return i-i*e*Math.max(Math.min(r,4-r,1),0)};return[n(5),n(3),n(1)]}function Yt(t,e,i){var n,r=Wt(t,1,.5);for(e+i>1&&(e*=n=1/(e+i),i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function Ut(t){var e,i,n,r=t.r/255,a=t.g/255,o=t.b/255,s=Math.max(r,a,o),l=Math.min(r,a,o),h=(s+l)/2;return s!==l&&(n=s-l,i=h>.5?n/(2-s-l):n/(s+l),e=function(t,e,i,n,r){return t===r?(e-i)/n+(e<i?6:0):e===r?(i-t)/n+2:(t-e)/n+4}(r,a,o,n,s),e=60*e+.5),[0|e,i||0,h]}function $t(t,e,i,n){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,n)).map(Lt)}function Xt(t,e,i){return $t(Wt,t,e,i)}function Gt(t){return(t%360+360)%360}var Kt,qt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Jt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};var Zt=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Qt=function(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055},te=function(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)};function ee(t,e,i){if(t){var n=Ut(t);n[e]=Math.max(0,Math.min(n[e]+n[e]*i,0===e?360:1)),n=Xt(n),t.r=n[0],t.g=n[1],t.b=n[2]}}function ie(t,e){return t?Object.assign(e||{},t):t}function ne(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Lt(t[3]))):(e=ie(t,{r:0,g:0,b:0,a:1})).a=Lt(e.a),e}function re(t){return"r"===t.charAt(0)?function(t){var e,i,n,r=Zt.exec(t),a=255;if(r){if(r[7]!==e){var o=+r[7];a=r[8]?It(o):Tt(255*o,0,255)}return e=+r[1],i=+r[3],n=+r[5],{r:e=255&(r[2]?It(e):Tt(e,0,255)),g:i=255&(r[4]?It(i):Tt(i,0,255)),b:n=255&(r[6]?It(n):Tt(n,0,255)),a:a}}}(t):function(t){var e,i=jt.exec(t),n=255;if(i){i[5]!==e&&(n=i[6]?It(+i[5]):Lt(+i[5]));var r=Gt(+i[2]),a=+i[3]/100,o=+i[4]/100;return e="hwb"===i[1]?function(t,e,i){return $t(Yt,t,e,i)}(r,a,o):"hsv"===i[1]?function(t,e,i){return $t(Nt,t,e,i)}(r,a,o):Xt(r,a,o),{r:e[0],g:e[1],b:e[2],a:n}}}(t)}var ae=function(){function t(e){if(_classCallCheck(this,t),e instanceof t)return e;var i,n,r,a,o=_typeof(e);"object"===o?i=ne(e):"string"===o&&(a=(n=e).length,"#"===n[0]&&(4===a||5===a?r={r:255&17*Ft[n[1]],g:255&17*Ft[n[2]],b:255&17*Ft[n[3]],a:5===a?17*Ft[n[4]]:255}:7!==a&&9!==a||(r={r:Ft[n[1]]<<4|Ft[n[2]],g:Ft[n[3]]<<4|Ft[n[4]],b:Ft[n[5]]<<4|Ft[n[6]],a:9===a?Ft[n[7]]<<4|Ft[n[8]]:255})),i=r||function(t){Kt||(Kt=function(){var t,e,i,n,r,a={},o=Object.keys(Jt),s=Object.keys(qt);for(t=0;t<o.length;t++){for(n=r=o[t],e=0;e<s.length;e++)i=s[e],r=r.replace(i,qt[i]);i=parseInt(Jt[n],16),a[r]=[i>>16&255,i>>8&255,255&i]}return a}(),Kt.transparent=[0,0,0,0]);var e=Kt[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}(e)||re(e)),this._rgb=i,this._valid=!!i}return _createClass(t,[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var t=ie(this._rgb);return t&&(t.a=Rt(t.a)),t},set:function(t){this._rgb=ne(t)}},{key:"rgbString",value:function(){return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(Rt(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):void 0;var t}},{key:"hexString",value:function(){return this._valid?function(t){var e=function(t){return Ht(t.r)&&Ht(t.g)&&Ht(t.b)&&Ht(t.a)}(t)?Vt:Bt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+function(t,e){return t<255?e(t):""}(t.a,e):void 0}(this._rgb):void 0}},{key:"hslString",value:function(){return this._valid?function(t){if(t){var e=Ut(t),i=e[0],n=Et(e[1]),r=Et(e[2]);return t.a<255?"hsla(".concat(i,", ").concat(n,"%, ").concat(r,"%, ").concat(Rt(t.a),")"):"hsl(".concat(i,", ").concat(n,"%, ").concat(r,"%)")}}(this._rgb):void 0}},{key:"mix",value:function(t,e){if(t){var i,n=this.rgb,r=t.rgb,a=e===i?.5:e,o=2*a-1,s=n.a-r.a,l=((o*s==-1?o:(o+s)/(1+o*s))+1)/2;i=1-l,n.r=255&l*n.r+i*r.r+.5,n.g=255&l*n.g+i*r.g+.5,n.b=255&l*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}},{key:"interpolate",value:function(t,e){return t&&(this._rgb=function(t,e,i){var n=te(Rt(t.r)),r=te(Rt(t.g)),a=te(Rt(t.b));return{r:Lt(Qt(n+i*(te(Rt(e.r))-n))),g:Lt(Qt(r+i*(te(Rt(e.g))-r))),b:Lt(Qt(a+i*(te(Rt(e.b))-a))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}},{key:"clone",value:function(){return new t(this.rgb)}},{key:"alpha",value:function(t){return this._rgb.a=Lt(t),this}},{key:"clearer",value:function(t){return this._rgb.a*=1-t,this}},{key:"greyscale",value:function(){var t=this._rgb,e=Dt(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}},{key:"opaquer",value:function(t){return this._rgb.a*=1+t,this}},{key:"negate",value:function(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}},{key:"lighten",value:function(t){return ee(this._rgb,2,t),this}},{key:"darken",value:function(t){return ee(this._rgb,2,-t),this}},{key:"saturate",value:function(t){return ee(this._rgb,1,t),this}},{key:"desaturate",value:function(t){return ee(this._rgb,1,-t),this}},{key:"rotate",value:function(t){return function(t,e){var i=Ut(t);i[0]=Gt(i[0]+e),i=Xt(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}])}();function oe(t){if(t&&"object"==_typeof(t)){var e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function se(t){return oe(t)?t:new ae(t)}function le(t){return oe(t)?t:new ae(t).saturate(.5).darken(.1).hexString()}var he=["x","y","borderWidth","radius","tension"],ue=["color","borderColor","backgroundColor"],ce=new Map;function fe(t,e,i){return function(t,e){e=e||{};var i=t+JSON.stringify(e),n=ce.get(i);return n||(n=new Intl.NumberFormat(t,e),ce.set(i,n)),n}(e,i).format(t)}var de={values:function(t){return p(t)?t:""+t},numeric:function(t,e,i){if(0===t)return"0";var n,r=this.chart.options.locale,a=t;if(i.length>1){var o=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(o<1e-4||o>1e15)&&(n="scientific"),a=function(t,e){var i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}(t,i)}var s=X(Math.abs(a)),l=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),h={notation:n,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(h,this.options.ticks.format),fe(t,r,h)},logarithmic:function(t,e,i){if(0===t)return"0";var n=i[e].significand||t/Math.pow(10,Math.floor(X(t)));return[1,2,3,5,10,15].includes(n)||e>.8*i.length?de.numeric.call(this,t,e,i):""}},ve={formatters:de},pe=Object.create(null),ge=Object.create(null);function ye(t,e){if(!e)return t;for(var i=e.split("."),n=0,r=i.length;n<r;++n){var a=i[n];t=t[a]||(t[a]=Object.create(null))}return t}function me(t,e,i){return"string"==typeof e?O(ye(t,e),i):O(ye(t,""),e)}var be=function(){return _createClass(function t(e,i){_classCallCheck(this,t),this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=function(t){return t.chart.platform.getDevicePixelRatio()},this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=function(t,e){return le(e.backgroundColor)},this.hoverBorderColor=function(t,e){return le(e.borderColor)},this.hoverColor=function(t,e){return le(e.color)},this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(i)},[{key:"set",value:function(t,e){return me(this,t,e)}},{key:"get",value:function(t){return ye(this,t)}},{key:"describe",value:function(t,e){return me(ge,t,e)}},{key:"override",value:function(t,e){return me(pe,t,e)}},{key:"route",value:function(t,e,i,n){var r=ye(this,t),a=ye(this,i),o="_"+e;Object.defineProperties(r,_defineProperty(_defineProperty({},o,{value:r[e],writable:!0}),e,{enumerable:!0,get:function(){var t=this[o],e=a[n];return g(t)?Object.assign({},e,t):b(t,e)},set:function(t){this[o]=t}}))}},{key:"apply",value:function(t){var e=this;t.forEach(function(t){return t(e)})}}])}(),_e=new be({_scriptable:function(t){return!t.startsWith("on")},_indexable:function(t){return"events"!==t},hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:function(t){return"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}}),t.set("animations",{colors:{type:"color",properties:ue},numbers:{type:"number",properties:he}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:function(t){return 0|t}}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:function(t,e){return e.lineWidth},tickColor:function(t,e){return e.color},offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ve.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:function(t){return!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t},_indexable:function(t){return"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:function(t){return"backdropPadding"!==t&&"callback"!==t},_indexable:function(t){return"backdropPadding"!==t}})}]);function xe(){return"undefined"!=typeof window&&"undefined"!=typeof document}function ke(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function we(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}var Me=function(t){return t.ownerDocument.defaultView.getComputedStyle(t,null)};function Pe(t,e){return Me(t).getPropertyValue(e)}var Se=["top","right","bottom","left"];function Ce(t,e,i){var n={};i=i?"-"+i:"";for(var r=0;r<4;r++){var a=Se[r];n[a]=parseFloat(t[e+"-"+a+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Oe(t,e){if("native"in t)return t;var i=e.canvas,n=e.currentDevicePixelRatio,r=Me(i),a="border-box"===r.boxSizing,o=Ce(r,"padding"),s=Ce(r,"border","width"),l=function(t,e){var i,n,r=t.touches,a=r&&r.length?r[0]:t,o=a.offsetX,s=a.offsetY,l=!1;if(function(t,e,i){return(t>0||e>0)&&(!i||!i.shadowRoot)}(o,s,t.target))i=o,n=s;else{var h=e.getBoundingClientRect();i=a.clientX-h.left,n=a.clientY-h.top,l=!0}return{x:i,y:n,box:l}}(t,i),h=l.x,u=l.y,c=l.box,f=o.left+(c&&s.left),d=o.top+(c&&s.top),v=e.width,p=e.height;return a&&(v-=o.width+s.width,p-=o.height+s.height),{x:Math.round((h-f)/v*i.width/n),y:Math.round((u-d)/p*i.height/n)}}var Ae=function(t){return Math.round(10*t)/10};function De(t,e,i,n){var r=Me(t),a=Ce(r,"margin"),o=we(r.maxWidth,t,"clientWidth")||W,s=we(r.maxHeight,t,"clientHeight")||W,l=function(t,e,i){var n,r;if(void 0===e||void 0===i){var a=t&&ke(t);if(a){var o=a.getBoundingClientRect(),s=Me(a),l=Ce(s,"border","width"),h=Ce(s,"padding");e=o.width-h.width-l.width,i=o.height-h.height-l.height,n=we(s.maxWidth,a,"clientWidth"),r=we(s.maxHeight,a,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:n||W,maxHeight:r||W}}(t,e,i),h=l.width,u=l.height;if("content-box"===r.boxSizing){var c=Ce(r,"border","width"),f=Ce(r,"padding");h-=f.width+c.width,u-=f.height+c.height}return h=Math.max(0,h-a.width),u=Math.max(0,n?h/n:u-a.height),h=Ae(Math.min(h,o,l.maxWidth)),u=Ae(Math.min(u,s,l.maxHeight)),h&&!u&&(u=Ae(h/2)),(void 0!==e||void 0!==i)&&n&&l.height&&u>l.height&&(u=l.height,h=Ae(Math.floor(u*n))),{width:h,height:u}}function Te(t,e,i){var n=e||1,r=Ae(t.height*n),a=Ae(t.width*n);t.height=Ae(t.height),t.width=Ae(t.width);var o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height="".concat(t.height,"px"),o.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==n||o.height!==r||o.width!==a)&&(t.currentDevicePixelRatio=n,o.height=r,o.width=a,t.ctx.setTransform(n,0,0,n,0,0),!0)}var Ie=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};xe()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Le(t,e){var i=Pe(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Re(t){return!t||v(t.size)||v(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Ee(t,e,i,n,r){var a=e[r];return a||(a=e[r]=t.measureText(r).width,i.push(r)),a>n&&(n=a),n}function Fe(t,e,i,n){var r=(n=n||{}).data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},a=n.garbageCollect=[],n.font=e),t.save(),t.font=e;var o,s,l,h,u,c=0,f=i.length;for(o=0;o<f;o++)if(null==(h=i[o])||p(h)){if(p(h))for(s=0,l=h.length;s<l;s++)null==(u=h[s])||p(u)||(c=Ee(t,r,a,c,u))}else c=Ee(t,r,a,c,h);t.restore();var d=a.length/2;if(d>i.length){for(o=0;o<d;o++)delete r[a[o]];a.splice(0,d)}return c}function ze(t,e,i){var n=t.currentDevicePixelRatio,r=0!==i?Math.max(i/2,.5):0;return Math.round((e-r)*n)/n+r}function Ve(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function Be(t,e,i,n){He(t,e,i,n,null)}function He(t,e,i,n,r){var a,o,s,l,h,u,c,f,d=e.pointStyle,v=e.rotation,p=e.radius,g=(v||0)*N;if(d&&"object"==_typeof(d)&&("[object HTMLImageElement]"===(a=d.toString())||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(i,n),t.rotate(g),t.drawImage(d,-d.width/2,-d.height/2,d.width,d.height),void t.restore();if(!(isNaN(p)||p<=0)){switch(t.beginPath(),d){default:r?t.ellipse(i,n,r/2,p,0,0,H):t.arc(i,n,p,0,H),t.closePath();break;case"triangle":u=r?r/2:p,t.moveTo(i+Math.sin(g)*u,n-Math.cos(g)*p),g+=$,t.lineTo(i+Math.sin(g)*u,n-Math.cos(g)*p),g+=$,t.lineTo(i+Math.sin(g)*u,n-Math.cos(g)*p),t.closePath();break;case"rectRounded":l=p-(h=.516*p),o=Math.cos(g+U)*l,c=Math.cos(g+U)*(r?r/2-h:l),s=Math.sin(g+U)*l,f=Math.sin(g+U)*(r?r/2-h:l),t.arc(i-c,n-s,h,g-B,g-Y),t.arc(i+f,n-o,h,g-Y,g),t.arc(i+c,n+s,h,g,g+Y),t.arc(i-f,n+o,h,g+Y,g+B),t.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*p,u=r?r/2:l,t.rect(i-u,n-l,2*u,2*l);break}g+=U;case"rectRot":c=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,s=Math.sin(g)*p,f=Math.sin(g)*(r?r/2:p),t.moveTo(i-c,n-s),t.lineTo(i+f,n-o),t.lineTo(i+c,n+s),t.lineTo(i-f,n+o),t.closePath();break;case"crossRot":g+=U;case"cross":c=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,s=Math.sin(g)*p,f=Math.sin(g)*(r?r/2:p),t.moveTo(i-c,n-s),t.lineTo(i+c,n+s),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"star":c=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,s=Math.sin(g)*p,f=Math.sin(g)*(r?r/2:p),t.moveTo(i-c,n-s),t.lineTo(i+c,n+s),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o),g+=U,c=Math.cos(g)*(r?r/2:p),o=Math.cos(g)*p,s=Math.sin(g)*p,f=Math.sin(g)*(r?r/2:p),t.moveTo(i-c,n-s),t.lineTo(i+c,n+s),t.moveTo(i+f,n-o),t.lineTo(i-f,n+o);break;case"line":o=r?r/2:Math.cos(g)*p,s=Math.sin(g)*p,t.moveTo(i-o,n-s),t.lineTo(i+o,n+s);break;case"dash":t.moveTo(i,n),t.lineTo(i+Math.cos(g)*(r?r/2:p),n+Math.sin(g)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function je(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function We(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ne(t){t.restore()}function Ye(t,e,i,n,r){if(!e)return t.lineTo(i.x,i.y);if("middle"===r){var a=(e.x+i.x)/2;t.lineTo(a,e.y),t.lineTo(a,i.y)}else"after"===r!=!!n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Ue(t,e,i,n){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function $e(t,e,i,n,r){if(r.strikethrough||r.underline){var a=t.measureText(n),o=e-a.actualBoundingBoxLeft,s=e+a.actualBoundingBoxRight,l=i-a.actualBoundingBoxAscent,h=i+a.actualBoundingBoxDescent,u=r.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(o,u),t.lineTo(s,u),t.stroke()}}function Xe(t,e){var i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Ge(t,e,i,n,r){var a,o,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},l=p(e)?e:[e],h=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),v(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),a=0;a<l.length;++a)o=l[a],s.backdrop&&Xe(t,s.backdrop),h&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),v(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(o,i,n,s.maxWidth)),t.fillText(o,i,n,s.maxWidth),$e(t,i,n,o,s),n+=Number(r.lineHeight);t.restore()}function Ke(t,e){var i=e.x,n=e.y,r=e.w,a=e.h,o=e.radius;t.arc(i+o.topLeft,n+o.topLeft,o.topLeft,1.5*B,B,!0),t.lineTo(i,n+a-o.bottomLeft),t.arc(i+o.bottomLeft,n+a-o.bottomLeft,o.bottomLeft,B,Y,!0),t.lineTo(i+r-o.bottomRight,n+a),t.arc(i+r-o.bottomRight,n+a-o.bottomRight,o.bottomRight,Y,0,!0),t.lineTo(i+r,n+o.topRight),t.arc(i+r-o.topRight,n+o.topRight,o.topRight,0,-Y,!0),t.lineTo(i+o.topLeft,n)}function qe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return t[0]},r=(arguments.length>2?arguments[2]:void 0)||t;void 0===i&&(i=si("_fallback",t));var a=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Symbol.toStringTag,"Object"),"_cacheable",!0),"_scopes",t),"_rootScopes",r),"_fallback",i),"_getTarget",n),"override",function(n){return qe([n].concat(_toConsumableArray(t)),e,r,i)});return new Proxy(a,{deleteProperty:function(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get:function(i,n){return ei(i,n,function(){return function(t,e,i,n){var r,a,o=_createForOfIteratorHelper(e);try{for(o.s();!(a=o.n()).done;){var s=a.value;if(void 0!==(r=si(Qe(s,t),i)))return ti(t,r)?ai(i,n,t,r):r}}catch(t){o.e(t)}finally{o.f()}}(n,e,t,i)})},getOwnPropertyDescriptor:function(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t[0])},has:function(t,e){return li(t).includes(e)},ownKeys:function(t){return li(t)},set:function(t,e,i){var r=t._storage||(t._storage=n());return t[e]=r[e]=i,delete t._keys,!0}})}function Je(t,e,i,n){var r={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Ze(t,n),setContext:function(e){return Je(t,e,i,n)},override:function(r){return Je(t.override(r),e,i,n)}};return new Proxy(r,{deleteProperty:function(e,i){return delete e[i],delete t[i],!0},get:function(t,e,i){return ei(t,e,function(){return function(t,e,i){var n=t._proxy,r=t._context,a=t._subProxy,o=t._descriptors,s=n[e];return F(s)&&o.isScriptable(e)&&(s=function(t,e,i,n){var r=i._proxy,a=i._context,o=i._subProxy,s=i._stack;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t);var l=e(a,o||n);return s.delete(t),ti(t,l)&&(l=ai(r._scopes,r,t,l)),l}(e,s,t,i)),p(s)&&s.length&&(s=function(t,e,i,n){var r=i._proxy,a=i._context,o=i._subProxy,s=i._descriptors;if(void 0!==a.index&&n(t))return e[a.index%e.length];if(g(e[0])){var l=e,h=r._scopes.filter(function(t){return t!==l});e=[];var u,c=_createForOfIteratorHelper(l);try{for(c.s();!(u=c.n()).done;){var f=ai(h,r,t,u.value);e.push(Je(f,a,o&&o[t],s))}}catch(t){c.e(t)}finally{c.f()}}return e}(e,s,t,o.isIndexable)),ti(e,s)&&(s=Je(s,r,a&&a[e],o)),s}(t,e,i)})},getOwnPropertyDescriptor:function(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t)},has:function(e,i){return Reflect.has(t,i)},ownKeys:function(){return Reflect.ownKeys(t)},set:function(e,i,n){return t[i]=n,delete e[i],!0}})}function Ze(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},i=t._scriptable,n=void 0===i?e.scriptable:i,r=t._indexable,a=void 0===r?e.indexable:r,o=t._allKeys;return{allKeys:void 0===o?e.allKeys:o,scriptable:n,indexable:a,isScriptable:F(n)?n:function(){return n},isIndexable:F(a)?a:function(){return a}}}var Qe=function(t,e){return t?t+R(e):e},ti=function(t,e){return g(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object)};function ei(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];var n=i();return t[e]=n,n}function ii(t,e,i){return F(t)?t(e,i):t}var ni=function(t,e){return!0===t?e:"string"==typeof t?L(e,t):void 0};function ri(t,e,i,n,r){var a,o=_createForOfIteratorHelper(e);try{for(o.s();!(a=o.n()).done;){var s=a.value,l=ni(i,s);if(l){t.add(l);var h=ii(l._fallback,i,r);if(void 0!==h&&h!==i&&h!==n)return h}else if(!1===l&&void 0!==n&&i!==n)return null}}catch(t){o.e(t)}finally{o.f()}return!1}function ai(t,e,i,n){var r=e._rootScopes,a=ii(e._fallback,i,n),o=[].concat(_toConsumableArray(t),_toConsumableArray(r)),s=new Set;s.add(n);var l=oi(s,o,i,a||i,n);return null!==l&&(void 0===a||a===i||null!==(l=oi(s,o,a,l,n)))&&qe(Array.from(s),[""],r,a,function(){return function(t,e,i){var n=t._getTarget();e in n||(n[e]={});var r=n[e];return p(r)&&g(i)?i:r||{}}(e,i,n)})}function oi(t,e,i,n,r){for(;i;)i=ri(t,e,i,n,r);return i}function si(t,e){var i,n=_createForOfIteratorHelper(e);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(r){var a=r[t];if(void 0!==a)return a}}}catch(t){n.e(t)}finally{n.f()}}function li(t){var e=t._keys;return e||(e=t._keys=function(t){var e,i=new Set,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var r,a=e.value,o=_createForOfIteratorHelper(Object.keys(a).filter(function(t){return!t.startsWith("_")}));try{for(o.s();!(r=o.n()).done;){var s=r.value;i.add(s)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){n.e(t)}finally{n.f()}return Array.from(i)}(t._scopes)),e}function hi(t,e,i,n){var r,a,o,s,l=t.iScale,h=this._parsing.key,u=void 0===h?"r":h,c=new Array(n);for(r=0,a=n;r<a;++r)s=e[o=r+i],c[r]={r:l.parse(L(s,u),o)};return c}var ui=Number.EPSILON||1e-14,ci=function(t,e){return e<t.length&&!t[e].skip&&t[e]},fi=function(t){return"x"===t?"y":"x"};function di(t,e,i,n){var r=t.skip?e:t,a=e,o=i.skip?e:i,s=at(a,r),l=at(o,a),h=s/(s+l),u=l/(s+l),c=n*(h=isNaN(h)?0:h),f=n*(u=isNaN(u)?0:u);return{previous:{x:a.x-c*(o.x-r.x),y:a.y-c*(o.y-r.y)},next:{x:a.x+f*(o.x-r.x),y:a.y+f*(o.y-r.y)}}}function vi(t){var e,i,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",a=fi(r),o=t.length,s=Array(o).fill(0),l=Array(o),h=ci(t,0);for(e=0;e<o;++e)if(i=n,n=h,h=ci(t,e+1),n){if(h){var u=h[r]-n[r];s[e]=0!==u?(h[a]-n[a])/u:0}l[e]=i?h?G(s[e-1])!==G(s[e])?0:(s[e-1]+s[e])/2:s[e-1]:s[e]}!function(t,e,i){for(var n,r,a,o,s,l=t.length,h=ci(t,0),u=0;u<l-1;++u)s=h,h=ci(t,u+1),s&&h&&(K(e[u],0,ui)?i[u]=i[u+1]=0:(n=i[u]/e[u],r=i[u+1]/e[u],(o=Math.pow(n,2)+Math.pow(r,2))<=9||(a=3/Math.sqrt(o),i[u]=n*a*e[u],i[u+1]=r*a*e[u])))}(t,s,l),function(t,e){for(var i,n,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",o=fi(a),s=t.length,l=ci(t,0),h=0;h<s;++h)if(n=r,r=l,l=ci(t,h+1),r){var u=r[a],c=r[o];n&&(i=(u-n[a])/3,r["cp1".concat(a)]=u-i,r["cp1".concat(o)]=c-i*e[h]),l&&(i=(l[a]-u)/3,r["cp2".concat(a)]=u+i,r["cp2".concat(o)]=c+i*e[h])}}(t,l,r)}function pi(t,e,i){return Math.max(Math.min(t,i),e)}function gi(t,e,i,n,r){var a,o,s,l;if(e.spanGaps&&(t=t.filter(function(t){return!t.skip})),"monotone"===e.cubicInterpolationMode)vi(t,r);else{var h=n?t[t.length-1]:t[0];for(a=0,o=t.length;a<o;++a)l=di(h,s=t[a],t[Math.min(a+1,o-(n?0:1))%o],e.tension),s.cp1x=l.previous.x,s.cp1y=l.previous.y,s.cp2x=l.next.x,s.cp2y=l.next.y,h=s}e.capBezierPoints&&function(t,e){var i,n,r,a,o,s=je(t[0],e);for(i=0,n=t.length;i<n;++i)o=a,a=s,s=i<n-1&&je(t[i+1],e),a&&(r=t[i],o&&(r.cp1x=pi(r.cp1x,e.left,e.right),r.cp1y=pi(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=pi(r.cp2x,e.left,e.right),r.cp2y=pi(r.cp2y,e.top,e.bottom)))}(t,i)}var yi=function(t){return 0===t||1===t},mi=function(t,e,i){return-Math.pow(2,10*(t-=1))*Math.sin((t-e)*H/i)},bi=function(t,e,i){return Math.pow(2,-10*t)*Math.sin((t-e)*H/i)+1},_i={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*Y)},easeOutSine:function(t){return Math.sin(t*Y)},easeInOutSine:function(t){return-.5*(Math.cos(B*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 yi(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1)))},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){return yi(t)?t:mi(t,.075,.3)},easeOutElastic:function(t){return yi(t)?t:bi(t,.075,.3)},easeInOutElastic:function(t){var e=.1125;return yi(t)?t:t<.5?.5*mi(2*t,e,.45):.5+.5*bi(2*t-1,e,.45)},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-_i.easeOutBounce(1-t)},easeOutBounce:function(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*_i.easeInBounce(2*t):.5*_i.easeOutBounce(2*t-1)+.5}};function xi(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ki(t,e,i,n){return{x:t.x+i*(e.x-t.x),y:"middle"===n?i<.5?t.y:e.y:"after"===n?i<1?t.y:e.y:i>0?e.y:t.y}}function wi(t,e,i,n){var r={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},o=xi(t,r,i),s=xi(r,a,i),l=xi(a,e,i),h=xi(o,s,i),u=xi(s,l,i);return xi(h,u,i)}var Mi=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Pi=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Si(t,e){var i=(""+t).match(Mi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}var Ci=function(t){return+t||0};function Oi(t,e){var i,n={},r=g(e),a=r?Object.keys(e):e,o=g(t)?r?function(i){return b(t[i],t[e[i]])}:function(e){return t[e]}:function(){return t},s=_createForOfIteratorHelper(a);try{for(s.s();!(i=s.n()).done;){var l=i.value;n[l]=Ci(o(l))}}catch(t){s.e(t)}finally{s.f()}return n}function Ai(t){return Oi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Di(t){return Oi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ti(t){var e=Ai(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ii(t,e){t=t||{},e=e||_e.font;var i=b(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));var n=b(t.style,e.style);n&&!(""+n).match(Pi)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);var r={family:b(t.family,e.family),lineHeight:Si(b(t.lineHeight,e.lineHeight),i),size:i,style:n,weight:b(t.weight,e.weight),string:""};return r.string=Re(r),r}function Li(t,e,i,n){var r,a,o,s=!0;for(r=0,a=t.length;r<a;++r)if(void 0!==(o=t[r])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==i&&p(o)&&(o=o[i%o.length],s=!1),void 0!==o))return n&&!s&&(n.cacheable=!1),o}function Ri(t,e,i){var n=t.min,r=t.max,a=x(e,(r-n)/2),o=function(t,e){return i&&0===t?0:t+e};return{min:o(n,-Math.abs(a)),max:o(r,a)}}function Ei(t,e){return Object.assign(Object.create(t),e)}function Fi(t,e,i){return t?function(t,e){return{x:function(i){return t+t+e-i},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}}}(e,i):{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}}}function zi(t,e){var i,n;"ltr"!==e&&"rtl"!==e||(n=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)}function Vi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Bi(t){return"angle"===t?{between:lt,compare:ot,normalize:st}:{between:ct,compare:function(t,e){return t-e},normalize:function(t){return t}}}function Hi(t){var e=t.start,i=t.end,n=t.count;return{start:e%n,end:i%n,loop:t.loop&&(i-e+1)%n==0,style:t.style}}function ji(t,e,i){if(!i)return[t];for(var n,r,a,o=i.property,s=i.start,l=i.end,h=e.length,u=Bi(o),c=u.compare,f=u.between,d=u.normalize,v=function(t,e,i){var n,r,a=i.property,o=i.start,s=i.end,l=Bi(a),h=l.between,u=l.normalize,c=e.length,f=t.start,d=t.end,v=t.loop;if(v){for(f+=c,d+=c,n=0,r=c;n<r&&h(u(e[f%c][a]),o,s);++n)f--,d--;f%=c,d%=c}return d<f&&(d+=c),{start:f,end:d,loop:v,style:t.style}}(t,e,i),p=v.start,g=v.end,y=v.loop,m=v.style,b=[],_=!1,x=null,k=function(){return _||f(s,a,n)&&0!==c(s,a)},w=function(){return!_||0===c(l,n)||f(l,a,n)},M=p,P=p;M<=g;++M)(r=e[M%h]).skip||(n=d(r[o]))!==a&&(_=f(n,s,l),null===x&&k()&&(x=0===c(n,s)?M:P),null!==x&&w()&&(b.push(Hi({start:x,end:M,loop:y,count:h,style:m})),x=null),P=M,a=n);return null!==x&&b.push(Hi({start:x,end:g,loop:y,count:h,style:m})),b}function Wi(t,e){for(var i=[],n=t.segments,r=0;r<n.length;r++){var a=ji(n[r],t.points,e);a.length&&i.push.apply(i,_toConsumableArray(a))}return i}function Ni(t,e){var i=t.points,n=t.options.spanGaps,r=i.length;if(!r)return[];var a=!!t._loop,o=function(t,e,i,n){var r=0,a=e-1;if(i&&!n)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,i&&(a+=r);a>r&&t[a%e].skip;)a--;return{start:r,end:a%=e}}(i,r,a,n),s=o.start,l=o.end;return Yi(t,!0===n?[{start:s,end:l,loop:a}]:function(t,e,i,n){var r,a=t.length,o=[],s=e,l=t[e];for(r=e+1;r<=i;++r){var h=t[r%a];h.skip||h.stop?l.skip||(n=!1,o.push({start:e%a,end:(r-1)%a,loop:n}),e=s=h.stop?r:null):(s=r,l.skip&&(e=r)),l=h}return null!==s&&o.push({start:e%a,end:s%a,loop:n}),o}(i,s,l<s?l+r:l,!!t._fullLoop&&0===s&&l===r-1),i,e)}function Yi(t,e,i,n){return n&&n.setContext&&i?function(t,e,i,n){var r=t._chart.getContext(),a=Ui(t.options),o=t._datasetIndex,s=t.options.spanGaps,l=i.length,h=[],u=a,c=e[0].start,f=c;function d(t,e,n,r){var a=s?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=a;for(;i[e%l].skip;)e+=a;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:n,style:r}),u=r,c=e%l)}}var v,p=_createForOfIteratorHelper(e);try{for(p.s();!(v=p.n()).done;){var g=v.value;c=s?c:g.start;var y=void 0,m=i[c%l];for(f=c+1;f<=g.end;f++){var b=i[f%l];$i(y=Ui(n.setContext(Ei(r,{type:"segment",p0:m,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),u)&&d(c,f-1,g.loop,u),m=b,u=y}c<f-1&&d(c,f-1,g.loop,u)}}catch(t){p.e(t)}finally{p.f()}return h}(t,e,i,n):e}function Ui(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function $i(t,e){if(!e)return!1;var i=[],n=function(t,e){return oe(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,n)!==JSON.stringify(e,n)}function Xi(t,e,i){return t.options.clip?t[i]:e[i]}function Gi(t,e){var i=e._clip;if(i.disabled)return!1;var n=function(t,e){var i=t.xScale,n=t.yScale;return i&&n?{left:Xi(i,e,"left"),right:Xi(i,e,"right"),top:Xi(n,e,"top"),bottom:Xi(n,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:n.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:n.right+(!0===i.right?0:i.right),top:!1===i.top?0:n.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:n.bottom+(!0===i.bottom?0:i.bottom)}}var Ki=Object.freeze({__proto__:null,HALF_PI:Y,INFINITY:W,PI:B,PITAU:j,QUARTER_PI:U,RAD_PER_DEG:N,TAU:H,TWO_THIRDS_PI:$,_addGrace:Ri,_alignPixel:ze,_alignStartEnd:Mt,_angleBetween:lt,_angleDiff:ot,_arrayUnique:bt,_attachContext:Je,_bezierCurveTo:Ue,_bezierInterpolation:wi,_boundSegment:ji,_boundSegments:Wi,_capitalize:R,_computeSegments:Ni,_createResolver:qe,_decimalPlaces:nt,_deprecated:function(t,e,i,n){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+n+'" instead')},_descriptors:Ze,_elementsEqual:M,_factorize:J,_filterBetween:pt,_getParentNode:ke,_getStartAndCountOfVisiblePoints:St,_int16Range:ut,_isBetween:ct,_isClickEvent:V,_isDomSupported:xe,_isPointInArea:je,_limitValue:ht,_longestText:Fe,_lookup:ft,_lookupByKey:dt,_measureText:Ee,_merger:C,_mergerIf:D,_normalizeAngle:st,_parseObjectDataRadialScale:hi,_pointInLine:xi,_readValueToProps:Oi,_rlookupByKey:vt,_scaleRangesChanged:Ct,_setMinAndMaxByKey:tt,_splitKey:I,_steppedInterpolation:ki,_steppedLineTo:Ye,_textX:Pt,_toLeftRightCenter:wt,_updateBezierControlPoints:gi,addRoundedRectPath:Ke,almostEquals:K,almostWhole:Q,callback:k,clearCanvas:Ve,clipArea:We,clone:P,color:se,createContext:Ei,debounce:kt,defined:E,distanceBetweenPoints:at,drawPoint:Be,drawPointLegend:He,each:w,easingEffects:_i,finiteOrDefault:m,fontString:function(t,e,i){return e+" "+t+"px "+i},formatNumber:fe,getAngleFromPoint:rt,getDatasetClipArea:Gi,getHoverColor:le,getMaximumSize:De,getRelativePosition:Oe,getRtlAdapter:Fi,getStyle:Pe,isArray:p,isFinite:y,isFunction:F,isNullOrUndef:v,isNumber:Z,isObject:g,isPatternOrGradient:oe,listenArrayEvents:yt,log10:X,merge:O,mergeIf:A,niceNum:q,noop:f,overrideTextDirection:zi,readUsedSize:Le,renderText:Ge,requestAnimFrame:_t,resolve:Li,resolveObjectKey:L,restoreTextDirection:Vi,retinaScale:Te,setsEqual:z,sign:G,splineCurve:di,splineCurveMonotone:vi,supportsEventListenerOptions:Ie,throttled:xt,toDegrees:it,toDimension:x,toFont:Ii,toFontString:Re,toLineHeight:Si,toPadding:Ti,toPercentage:_,toRadians:et,toTRBL:Ai,toTRBLCorners:Di,uid:d,unclipArea:Ne,unlistenArrayEvents:mt,valueOrDefault:b});function qi(t,e,i,n){var r=t.controller,a=t.data,o=t._sorted,s=r._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(s&&e===s.axis&&"r"!==e&&o&&a.length){var h=s._reversePixels?vt:dt;if(!n){var u=h(a,e,i);if(l){var c=r._cachedMeta.vScale,f=t._parsed,d=f.slice(0,u.lo+1).reverse().findIndex(function(t){return!v(t[c.axis])});u.lo-=Math.max(0,d);var p=f.slice(u.hi).findIndex(function(t){return!v(t[c.axis])});u.hi+=Math.max(0,p)}return u}if(r._sharedOptions){var g=a[0],y="function"==typeof g.getRange&&g.getRange(e);if(y){var m=h(a,e,i-y),b=h(a,e,i+y);return{lo:m.lo,hi:b.hi}}}}return{lo:0,hi:a.length-1}}function Ji(t,e,i,n,r){for(var a=t.getSortedVisibleDatasetMetas(),o=i[e],s=0,l=a.length;s<l;++s)for(var h=a[s],u=h.index,c=h.data,f=qi(a[s],e,o,r),d=f.lo,v=f.hi,p=d;p<=v;++p){var g=c[p];g.skip||n(g,u,p)}}function Zi(t,e,i,n,r){var a=[];return r||t.isPointInArea(e)?(Ji(t,i,e,function(i,o,s){(r||je(i,t.chartArea,0))&&i.inRange(e.x,e.y,n)&&a.push({element:i,datasetIndex:o,index:s})},!0),a):a}function Qi(t,e,i,n,r,a){return a||t.isPointInArea(e)?"r"!==i||n?function(t,e,i,n,r,a){var o=[],s=function(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var r=e?Math.abs(t.x-n.x):0,a=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}(i),l=Number.POSITIVE_INFINITY;return Ji(t,i,e,function(i,h,u){var c=i.inRange(e.x,e.y,r);if(!n||c){var f=i.getCenterPoint(r);if(a||t.isPointInArea(f)||c){var d=s(e,f);d<l?(o=[{element:i,datasetIndex:h,index:u}],l=d):d===l&&o.push({element:i,datasetIndex:h,index:u})}}}),o}(t,e,i,n,r,a):function(t,e,i,n){var r=[];return Ji(t,i,e,function(t,i,a){var o=t.getProps(["startAngle","endAngle"],n),s=o.startAngle,l=o.endAngle;lt(rt(t,{x:e.x,y:e.y}).angle,s,l)&&r.push({element:t,datasetIndex:i,index:a})}),r}(t,e,i,r):[]}function tn(t,e,i,n,r){var a=[],o="x"===i?"inXRange":"inYRange",s=!1;return Ji(t,i,e,function(t,n,l){t[o]&&t[o](e[i],r)&&(a.push({element:t,datasetIndex:n,index:l}),s=s||t.inRange(e.x,e.y,r))}),n&&!s?[]:a}var en={evaluateInteractionItems:Ji,modes:{index:function(t,e,i,n){var r=Oe(e,t),a=i.axis||"x",o=i.includeInvisible||!1,s=i.intersect?Zi(t,r,a,n,o):Qi(t,r,a,!1,n,o),l=[];return s.length?(t.getSortedVisibleDatasetMetas().forEach(function(t){var e=s[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset:function(t,e,i,n){var r=Oe(e,t),a=i.axis||"xy",o=i.includeInvisible||!1,s=i.intersect?Zi(t,r,a,n,o):Qi(t,r,a,!1,n,o);if(s.length>0){var l=s[0].datasetIndex,h=t.getDatasetMeta(l).data;s=[];for(var u=0;u<h.length;++u)s.push({element:h[u],datasetIndex:l,index:u})}return s},point:function(t,e,i,n){return Zi(t,Oe(e,t),i.axis||"xy",n,i.includeInvisible||!1)},nearest:function(t,e,i,n){var r=Oe(e,t),a=i.axis||"xy",o=i.includeInvisible||!1;return Qi(t,r,a,i.intersect,n,o)},x:function(t,e,i,n){return tn(t,Oe(e,t),"x",i.intersect,n)},y:function(t,e,i,n){return tn(t,Oe(e,t),"y",i.intersect,n)}}},nn=["left","top","right","bottom"];function rn(t,e){return t.filter(function(t){return t.pos===e})}function an(t,e){return t.filter(function(t){return-1===nn.indexOf(t.pos)&&t.box.axis===e})}function on(t,e){return t.sort(function(t,i){var n=e?i:t,r=e?t:i;return n.weight===r.weight?n.index-r.index:n.weight-r.weight})}function sn(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function ln(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function hn(t,e,i,n){var r=i.pos,a=i.box,o=t.maxPadding;if(!g(r)){i.size&&(t[r]-=i.size);var s=n[i.stack]||{size:0,count:1};s.size=Math.max(s.size,i.horizontal?a.height:a.width),i.size=s.size/s.count,t[r]+=i.size}a.getPadding&&ln(o,a.getPadding());var l=Math.max(0,e.outerWidth-sn(o,t,"left","right")),h=Math.max(0,e.outerHeight-sn(o,t,"top","bottom")),u=l!==t.w,c=h!==t.h;return t.w=l,t.h=h,i.horizontal?{same:u,other:c}:{same:c,other:u}}function un(t,e){var i=e.maxPadding;return function(t){var n={left:0,top:0,right:0,bottom:0};return t.forEach(function(t){n[t]=Math.max(e[t],i[t])}),n}(t?["left","right"]:["top","bottom"])}function cn(t,e,i,n){var r,a,o,s,l,h,u=[];for(r=0,a=t.length,l=0;r<a;++r){(s=(o=t[r]).box).update(o.width||e.w,o.height||e.h,un(o.horizontal,e));var c=hn(e,i,o,n),f=c.same,d=c.other;l|=f&&u.length,h=h||d,s.fullSize||u.push(o)}return l&&cn(u,e,i,n)||h}function fn(t,e,i,n,r){t.top=i,t.left=e,t.right=e+n,t.bottom=i+r,t.width=n,t.height=r}function dn(t,e,i,n){var r,a=i.padding,o=e.x,s=e.y,l=_createForOfIteratorHelper(t);try{for(l.s();!(r=l.n()).done;){var h=r.value,u=h.box,c=n[h.stack]||{count:1,placed:0,weight:1},f=h.stackWeight/c.weight||1;if(h.horizontal){var d=e.w*f,v=c.size||u.height;E(c.start)&&(s=c.start),u.fullSize?fn(u,a.left,s,i.outerWidth-a.right-a.left,v):fn(u,e.left+c.placed,s,d,v),c.start=s,c.placed+=d,s=u.bottom}else{var p=e.h*f,g=c.size||u.width;E(c.start)&&(o=c.start),u.fullSize?fn(u,o,a.top,g,i.outerHeight-a.bottom-a.top):fn(u,o,e.top+c.placed,g,p),c.start=o,c.placed+=p,o=u.right}}}catch(t){l.e(t)}finally{l.f()}e.x=o,e.y=s}var vn={addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(t){e.draw(t)}}]},t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update:function(t,e,i,n){if(t){var r=Ti(t.options.layout.padding),a=Math.max(e-r.width,0),o=Math.max(i-r.height,0),s=function(t){var e=function(t){var e,i,n,r,a,o,s=[];for(e=0,i=(t||[]).length;e<i;++e){var l,h,u;r=(l=n=t[e]).position,a=(h=l.options).stack,o=void 0===(u=h.stackWeight)?1:u,s.push({index:e,box:n,pos:r,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&r+a,stackWeight:o})}return s}(t),i=on(e.filter(function(t){return t.box.fullSize}),!0),n=on(rn(e,"left"),!0),r=on(rn(e,"right")),a=on(rn(e,"top"),!0),o=on(rn(e,"bottom")),s=an(e,"x"),l=an(e,"y");return{fullSize:i,leftAndTop:n.concat(a),rightAndBottom:r.concat(l).concat(o).concat(s),chartArea:rn(e,"chartArea"),vertical:n.concat(r).concat(l),horizontal:a.concat(o).concat(s)}}(t.boxes),l=s.vertical,h=s.horizontal;w(t.boxes,function(t){"function"==typeof t.beforeLayout&&t.beforeLayout()});var u=l.reduce(function(t,e){return e.box.options&&!1===e.box.options.display?t:t+1},0)||1,c=Object.freeze({outerWidth:e,outerHeight:i,padding:r,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},r);ln(f,Ti(n));var d=Object.assign({maxPadding:f,w:a,h:o,x:r.left,y:r.top},r),v=function(t,e){var i,n,r,a=function(t){var e,i={},n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var r=e.value,a=r.stack,o=r.pos,s=r.stackWeight;if(a&&nn.includes(o)){var l=i[a]||(i[a]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}}}catch(t){n.e(t)}finally{n.f()}return i}(t),o=e.vBoxMaxWidth,s=e.hBoxMaxHeight;for(i=0,n=t.length;i<n;++i){var l=(r=t[i]).box.fullSize,h=a[r.stack],u=h&&r.stackWeight/h.weight;r.horizontal?(r.width=u?u*o:l&&e.availableWidth,r.height=s):(r.width=o,r.height=u?u*s:l&&e.availableHeight)}return a}(l.concat(h),c);cn(s.fullSize,d,c,v),cn(l,d,c,v),cn(h,d,c,v)&&cn(l,d,c,v),function(t){var e=t.maxPadding;function i(i){var n=Math.max(e[i]-t[i],0);return t[i]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(d),dn(s.leftAndTop,d,c,v),d.x+=d.w,d.y+=d.h,dn(s.rightAndBottom,d,c,v),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},w(s.chartArea,function(e){var i=e.box;Object.assign(i,t.chartArea),i.update(d.w,d.h,{left:0,top:0,right:0,bottom:0})})}}},pn=function(){return _createClass(function t(){_classCallCheck(this,t)},[{key:"acquireContext",value:function(t,e){}},{key:"releaseContext",value:function(t){return!1}},{key:"addEventListener",value:function(t,e,i){}},{key:"removeEventListener",value:function(t,e,i){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getMaximumSize",value:function(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}},{key:"isAttached",value:function(t){return!0}},{key:"updateConfig",value:function(t){}}])}(),gn=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"acquireContext",value:function(t){return t&&t.getContext&&t.getContext("2d")||null}},{key:"updateConfig",value:function(t){t.options.animation=!1}}])}(pn),yn="$chartjs",mn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bn=function(t){return null===t||""===t},_n=!!Ie&&{passive:!0};function xn(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,_n)}function kn(t,e){var i,n=_createForOfIteratorHelper(t);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(r===e||r.contains(e))return!0}}catch(t){n.e(t)}finally{n.f()}}function wn(t,e,i){var n=t.canvas,r=new MutationObserver(function(t){var e,r=!1,a=_createForOfIteratorHelper(t);try{for(a.s();!(e=a.n()).done;){var o=e.value;r=(r=r||kn(o.addedNodes,n))&&!kn(o.removedNodes,n)}}catch(t){a.e(t)}finally{a.f()}r&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}function Mn(t,e,i){var n=t.canvas,r=new MutationObserver(function(t){var e,r=!1,a=_createForOfIteratorHelper(t);try{for(a.s();!(e=a.n()).done;){var o=e.value;r=(r=r||kn(o.removedNodes,n))&&!kn(o.addedNodes,n)}}catch(t){a.e(t)}finally{a.f()}r&&i()});return r.observe(document,{childList:!0,subtree:!0}),r}var Pn=new Map,Sn=0;function Cn(){var t=window.devicePixelRatio;t!==Sn&&(Sn=t,Pn.forEach(function(e,i){i.currentDevicePixelRatio!==t&&e()}))}function On(t,e,i){var n=t.canvas,r=n&&ke(n);if(r){var a=xt(function(t,e){var n=r.clientWidth;i(t,e),n<r.clientWidth&&i()},window),o=new ResizeObserver(function(t){var e=t[0],i=e.contentRect.width,n=e.contentRect.height;0===i&&0===n||a(i,n)});return o.observe(r),function(t,e){Pn.size||window.addEventListener("resize",Cn),Pn.set(t,e)}(t,a),o}}function An(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){Pn.delete(t),Pn.size||window.removeEventListener("resize",Cn)}(t)}function Dn(t,e,i){var n=t.canvas,r=xt(function(e){null!==t.ctx&&i(function(t,e){var i=mn[t.type]||t.type,n=Oe(t,e),r=n.x,a=n.y;return{type:i,chart:e,native:t,x:void 0!==r?r:null,y:void 0!==a?a:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,_n)}(n,e,r),r}var Tn=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"acquireContext",value:function(t,e){var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(funct0}ЅЅwidth:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",bn(r)){var a=Le(t,"width");void 0!==a&&(t.width=a)}if(bn(n))if(""===t.style.height)t.height=t.width/(e||2);else{var o=Le(t,"height");void 0!==o&&(t.height=o)}}(t,e),i):null}},{key:"releaseContext",value:function(t){var e=t.canvas;if(!e[yn])return!1;var i=e[yn].initial;["height","width"].forEach(function(t){var n=i[t];v(n)?e.removeAttribute(t):e.setAttribute(t,n)});var n=i.style||{};return Object.keys(n).forEach(function(t){e.style[t]=n[t]}),e.width=e.width,delete e[yn],!0}},{key:"addEventListener",value:function(t,e,i){this.removeEventListener(t,e);var n=t.$proxies||(t.$proxies={}),r={attach:wn,detach:Mn,resize:On}[e]||Dn;n[e]=r(t,e,i)}},{key:"removeEventListener",value:function(t,e){var i=t.$proxies||(t.$proxies={}),n=i[e];n&&(({attach:An,detach:An,resize:An}[e]||xn)(t,e,n),i[e]=void 0)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getMaximumSize",value:function(t,e,i,n){return De(t,e,i,n)}},{key:"isAttached",value:function(t){var e=t&&ke(t);return!(!e||!e.isConnected)}}])}(pn);function In(t){return!xe()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?gn:Tn}var Ln=Object.freeze({__proto__:null,BasePlatform:pn,BasicPlatform:gn,DomPlatform:Tn,_detectPlatform:In}),Rn="transparent",En={boolean:function(t,e,i){return i>.5?e:t},color:function(t,e,i){var n=se(t||Rn),r=n.valid&&se(e||Rn);return r&&r.valid?r.mix(n,i).hexString():e},number:function(t,e,i){return t+(e-t)*i}},Fn=function(){return _createClass(function t(e,i,n,r){_classCallCheck(this,t);var a=i[n];r=Li([e.to,r,a,e.from]);var o=Li([e.from,a,r]);this._active=!0,this._fn=e.fn||En[e.type||_typeof(o)],this._easing=_i[e.easing]||_i.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=i,this._prop=n,this._from=o,this._to=r,this._promises=void 0},[{key:"active",value:function(){return this._active}},{key:"update",value:function(t,e,i){if(this._active){this._notify(!1);var n=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Li([t.to,e,n,t.from]),this._from=Li([t.from,n,e])}}},{key:"cancel",value:function(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}},{key:"tick",value:function(t){var e,i=t-this._start,n=this._duration,r=this._prop,a=this._from,o=this._loop,s=this._to;if(this._active=a!==s&&(o||i<n),!this._active)return this._target[r]=s,void this._notify(!0);i<0?this._target[r]=a:(e=i/n%2,e=o&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[r]=this._fn(a,s,e))}},{key:"wait",value:function(){var t=this._promises||(this._promises=[]);return new Promise(function(e,i){t.push({res:e,rej:i})})}},{key:"_notify",value:function(t){for(var e=t?"res":"rej",i=this._promises||[],n=0;n<i.length;n++)i[n][e]()}}])}(),zn=function(){return _createClass(function t(e,i){_classCallCheck(this,t),this._chart=e,this._properties=new Map,this.configure(i)},[{key:"configure",value:function(t){if(g(t)){var e=Object.keys(_e.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(function(n){var r=t[n];if(g(r)){for(var a={},o=0,s=e;o<s.length;o++){var l=s[o];a[l]=r[l]}(p(r.properties)&&r.properties||[n]).forEach(function(t){t!==n&&i.has(t)||i.set(t,a)})}})}}},{key:"_animateOptions",value:function(t,e){var i=e.options,n=function(t,e){if(e){var i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}}(t,i);if(!n)return[];var r=this._createAnimations(n,i);return i.$shared&&function(t,e){for(var i=[],n=Object.keys(e),r=0;r<n.length;r++){var a=t[n[r]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)}(t.options.$animations,i).then(function(){t.options=i},function(){}),r}},{key:"_createAnimations",value:function(t,e){var i,n=this._properties,r=[],a=t.$animations||(t.$animations={}),o=Object.keys(e),s=Date.now();for(i=o.length-1;i>=0;--i){var l=o[i];if("$"!==l.charAt(0))if("options"!==l){var h=e[l],u=a[l],c=n.get(l);if(u){if(c&&u.active()){u.update(c,h,s);continue}u.cancel()}c&&c.duration?(a[l]=u=new Fn(c,t,l,h),r.push(u)):t[l]=h}else r.push.apply(r,_toConsumableArray(this._animateOptions(t,e)))}return r}},{key:"update",value:function(t,e){if(0!==this._properties.size){var i=this._createAnimations(t,e);return i.length?(At.add(this._chart,i),!0):void 0}Object.assign(t,e)}}])}();function Vn(t,e){var i=t&&t.options||{},n=i.reverse,r=void 0===i.min?e:0,a=void 0===i.max?e:0;return{start:n?a:r,end:n?r:a}}function Bn(t,e){var i,n,r=[],a=t._getSortedDatasetMetas(e);for(i=0,n=a.length;i<n;++i)r.push(a[i].index);return r}function Hn(t,e,i){var n,r,a,o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=t.keys,h="single"===s.mode;if(null!==e){var u=!1;for(n=0,r=l.length;n<r;++n){if((a=+l[n])===i){if(u=!0,s.all)continue;break}y(o=t.values[a])&&(h||0===e||G(e)===G(o))&&(e+=o)}return u||s.all?e:0}}function jn(t,e){var i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function Wn(t,e,i){var n=t[e]||(t[e]={});return n[i]||(n[i]={})}function Nn(t,e,i,n){var r,a=_createForOfIteratorHelper(e.getMatchingVisibleMetas(n).reverse());try{for(a.s();!(r=a.n()).done;){var o=r.value,s=t[o.index];if(i&&s>0||!i&&s<0)return o.index}}catch(t){a.e(t)}finally{a.f()}return null}function Yn(t,e){for(var i,n=t.chart,r=t._cachedMeta,a=n._stacks||(n._stacks={}),o=r.iScale,s=r.vScale,l=r.index,h=o.axis,u=s.axis,c=function(t,e,i){return"".concat(t.id,".").concat(e.id,".").concat(i.stack||i.type)}(o,s,r),f=e.length,d=0;d<f;++d){var v=e[d],p=v[h],g=v[u];(i=(v._stacks||(v._stacks={}))[u]=Wn(a,c,p))[l]=g,i._top=Nn(i,s,!0,r.type),i._bottom=Nn(i,s,!1,r.type),(i._visualValues||(i._visualValues={}))[l]=g}}function Un(t,e){var i=t.scales;return Object.keys(i).filter(function(t){return i[t].axis===e}).shift()}function $n(t,e){var i=t.controller.index,n=t.vScale&&t.vScale.axis;if(n){var r,a=_createForOfIteratorHelper(e=e||t._parsed);try{for(a.s();!(r=a.n()).done;){var o=r.value._stacks;if(!o||void 0===o[n]||void 0===o[n][i])return;delete o[n][i],void 0!==o[n]._visualValues&&void 0!==o[n]._visualValues[i]&&delete o[n]._visualValues[i]}}catch(t){a.e(t)}finally{a.f()}}}var Xn=function(t){return"reset"===t||"none"===t},Gn=function(t,e){return e?t:Object.assign({},t)},Kn=function(){return _createClass(function t(e,i){_classCallCheck(this,t),this.chart=e,this._ctx=e.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=(this instanceof t?this.constructor:void 0).datasetElementType,this.dataElementType=(this instanceof t?this.constructor:void 0).dataElementType,this.initialize()},[{key:"initialize",value:function(){var t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}},{key:"updateIndex",value:function(t){this.index!==t&&$n(this._cachedMeta),this.index=t}},{key:"linkScales",value:function(){var t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=function(t,e,i,n){return"x"===t?e:"r"===t?n:i},r=e.xAxisID=b(i.xAxisID,Un(t,"x")),a=e.yAxisID=b(i.yAxisID,Un(t,"y")),o=e.rAxisID=b(i.rAxisID,Un(t,"r")),s=e.indexAxis,l=e.iAxisID=n(s,r,a,o),h=e.vAxisID=n(s,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}},{key:"getDataset",value:function(){return this.chart.data.datasets[this.index]}},{key:"getMeta",value:function(){return this.chart.getDatasetMeta(this.index)}},{key:"getScaleForId",value:function(t){return this.chart.scales[t]}},{key:"_getOtherScale",value:function(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}},{key:"reset",value:function(){this._update("reset")}},{key:"_destroy",value:function(){var t=this._cachedMeta;this._data&&mt(this._data,this),t._stacked&&$n(t)}},{key:"_dataCheck",value:function(){var t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(g(e)){var n=this._cachedMeta;this._data=function(t,e){var i,n,r,a=e.iScale,o=e.vScale,s="x"===a.axis?"x":"y",l="x"===o.axis?"x":"y",h=Object.keys(t),u=new Array(h.length);for(i=0,n=h.length;i<n;++i)r=h[i],u[i]=_defineProperty(_defineProperty({},s,r),l,t[r]);return u}(e,n)}else if(i!==e){if(i){mt(i,this);var r=this._cachedMeta;$n(r),r._parsed=[]}e&&Object.isExtensible(e)&&yt(e,this),this._syncList=[],this._data=e}}},{key:"addElements",value:function(){var t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}},{key:"buildOrUpdateElements",value:function(t){var e=this._cachedMeta,i=this.getDataset(),n=!1;this._dataCheck();var r=e._stacked;e._stacked=jn(e.vScale,e),e.stack!==i.stack&&(n=!0,$n(e),e.stack=i.stack),this._resyncElements(t),(n||r!==e._stacked)&&(Yn(this,e._parsed),e._stacked=jn(e.vScale,e))}},{key:"configure",value:function(){var t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}},{key:"parse",value:function(t,e){var i,n,r,a=this._cachedMeta,o=this._data,s=a.iScale,l=a._stacked,h=s.axis,u=0===t&&e===o.length||a._sorted,c=t>0&&a._parsed[t-1];if(!1===this._parsing)a._parsed=o,a._sorted=!0,r=o;else{r=p(o[t])?this.parseArrayData(a,o,t,e):g(o[t])?this.parseObjectData(a,o,t,e):this.parsePrimitiveData(a,o,t,e);var f=function(){return null===n[h]||c&&n[h]<c[h]};for(i=0;i<e;++i)a._parsed[i+t]=n=r[i],u&&(f()&&(u=!1),c=n);a._sorted=u}l&&Yn(this,r)}},{key:"parsePrimitiveData",value:function(t,e,i,n){var r,a,o,s=t.iScale,l=t.vScale,h=s.axis,u=l.axis,c=s.getLabels(),f=s===l,d=new Array(n);for(r=0,a=n;r<a;++r)o=r+i,d[r]=_defineProperty(_defineProperty({},h,f||s.parse(c[o],o)),u,l.parse(e[o],o));return d}},{key:"parseArrayData",value:function(t,e,i,n){var r,a,o,s,l=t.xScale,h=t.yScale,u=new Array(n);for(r=0,a=n;r<a;++r)s=e[o=r+i],u[r]={x:l.parse(s[0],o),y:h.parse(s[1],o)};return u}},{key:"parseObjectData",value:function(t,e,i,n){var r,a,o,s,l=t.xScale,h=t.yScale,u=this._parsing,c=u.xAxisKey,f=void 0===c?"x":c,d=u.yAxisKey,v=void 0===d?"y":d,p=new Array(n);for(r=0,a=n;r<a;++r)s=e[o=r+i],p[r]={x:l.parse(L(s,f),o),y:h.parse(L(s,v),o)};return p}},{key:"getParsed",value:function(t){return this._cachedMeta._parsed[t]}},{key:"getDataElement",value:function(t){return this._cachedMeta.data[t]}},{key:"applyStack",value:function(t,e,i){var n=this.chart,r=this._cachedMeta,a=e[t.axis];return Hn({keys:Bn(n,!0),values:e._stacks[t.axis]._visualValues},a,r.index,{mode:i})}},{key:"updateRangeFromParsed",value:function(t,e,i,n){var r=i[e.axis],a=null===r?NaN:r,o=n&&i._stacks[e.axis];n&&o&&(n.values=o,a=Hn(n,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}},{key:"getMinMax",value:function(t,e){var i,n,r=this._cachedMeta,a=r._parsed,o=r._sorted&&t===r.iScale,s=a.length,l=this._getOtherScale(t),h=function(t,e,i){return t&&!e.hidden&&e._stacked&&{keys:Bn(i,!0),values:null}}(e,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},c=function(t){var e=t.getUserBounds(),i=e.min,n=e.max,r=e.minDefined,a=e.maxDefined;return{min:r?i:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}(l),f=c.min,d=c.max;function v(){var e=(n=a[i])[l.axis];return!y(n[t.axis])||f>e||d<e}for(i=0;i<s&&(v()||(this.updateRangeFromParsed(u,t,n,h),!o));++i);if(o)for(i=s-1;i>=0;--i)if(!v()){this.updateRangeFromParsed(u,t,n,h);break}return u}},{key:"getAllParsedValues",value:function(t){var e,i,n,r=this._cachedMeta._parsed,a=[];for(e=0,i=r.length;e<i;++e)y(n=r[e][t.axis])&&a.push(n);return a}},{key:"getMaxOverflow",value:function(){return!1}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:n?""+n.getLabelForValue(r[n.axis]):""}}},{key:"_update",value:function(t){var e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){var e,i,n,r;return g(t)?(e=t.top,i=t.right,n=t.bottom,r=t.left):e=i=n=r=t,{top:e,right:i,bottom:n,left:r,disabled:!1===t}}(b(this.options.clip,function(t,e,i){if(!1===i)return!1;var n=Vn(t,i),r=Vn(e,i);return{top:r.end,right:n.end,bottom:r.start,left:n.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}},{key:"update",value:function(t){}},{key:"draw",value:function(){var t,e=this._ctx,i=this.chart,n=this._cachedMeta,r=n.data||[],a=i.chartArea,o=[],s=this._drawStart||0,l=this._drawCount||r.length-s,h=this.options.drawActiveElementsOnTop;for(n.dataset&&n.dataset.draw(e,a,s,l),t=s;t<s+l;++t){var u=r[t];u.hidden||(u.active&&h?o.push(u):u.draw(e,a))}for(t=0;t<o.length;++t)o[t].draw(e,a)}},{key:"getStyle",value:function(t,e){var i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}},{key:"getContext",value:function(t,e,i){var n,r=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){var a=this._cachedMeta.data[t];n=a.$context||(a.$context=function(t,e,i){return Ei(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,a)),n.parsed=this.getParsed(t),n.raw=r.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return Ei(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=r,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}},{key:"resolveDatasetElementOptions",value:function(t){return this._resolveElementOptions(this.datasetElementType.id,t)}},{key:"resolveDataElementOptions",value:function(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}},{key:"_resolveElementOptions",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,r="active"===i,a=this._cachedDataOpts,o=t+"-"+i,s=a[o],l=this.enableOptionSharing&&E(n);if(s)return Gn(s,l);var h=this.chart.config,u=h.datasetElementScopeKeys(this._type,t),c=r?["".concat(t,"Hover"),"hover",t,""]:[t,""],f=h.getOptionScopes(this.getDataset(),u),d=Object.keys(_e.elements[t]),v=h.resolveNamedOptions(f,d,function(){return e.getContext(n,r,i)},c);return v.$shared&&(v.$shared=l,a[o]=Object.freeze(Gn(v,l))),v}},{key:"_resolveAnimations",value:function(t,e,i){var n,r=this.chart,a=this._cachedDataOpts,o="animation-".concat(e),s=a[o];if(s)return s;if(!1!==r.options.animation){var l=this.chart.config,h=l.datasetAnimationScopeKeys(this._type,e),u=l.getOptionScopes(this.getDataset(),h);n=l.createResolver(u,this.getContext(t,i,e))}var c=new zn(r,n&&n.animations);return n&&n._cacheable&&(a[o]=Object.freeze(c)),c}},{key:"getSharedOptions",value:function(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}},{key:"includeOptions",value:function(t,e){return!e||Xn(t)||this.chart._animationsDisabled}},{key:"_getSharedOptions",value:function(t,e){var i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==n;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}},{key:"updateElement",value:function(t,e,i,n){Xn(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}},{key:"updateSharedOptions",value:function(t,e,i){t&&!Xn(e)&&this._resolveAnimations(void 0,e).update(t,i)}},{key:"_setStyle",value:function(t,e,i,n){t.active=n;var r=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(r)||r})}},{key:"removeHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!1)}},{key:"setHoverStyle",value:function(t,e,i){this._setStyle(t,i,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}},{key:"_resyncElements",value:function(t){var e,i=this._data,n=this._cachedMeta.data,r=_createForOfIteratorHelper(this._syncList);try{for(r.s();!(e=r.n()).done;){var a=_slicedToArray(e.value,3),o=a[0],s=a[1],l=a[2];this[o](s,l)}}catch(t){r.e(t)}finally{r.f()}this._syncList=[];var h=n.length,u=i.length,c=Math.min(u,h);c&&this.parse(0,c),u>h?this._insertElements(h,u-h,t):u<h&&this._removeElements(u,h-u)}},{key:"_insertElements",value:function(t,e){var i,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this._cachedMeta,a=r.data,o=t+e,s=function(t){for(t.length+=e,i=t.length-1;i>=o;i--)t[i]=t[i-e]};for(s(a),i=t;i<o;++i)a[i]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(t,e),n&&this.updateElements(a,t,e,"reset")}},{key:"updateElements",value:function(t,e,i,n){}},{key:"_removeElements",value:function(t,e){var i=this._cachedMeta;if(this._parsing){var n=i._parsed.splice(t,e);i._stacked&&$n(i,n)}i.data.splice(t,e)}},{key:"_sync",value:function(t){if(this._parsing)this._syncList.push(t);else{var e=_slicedToArray(t,3),i=e[0],n=e[1],r=e[2];this[i](n,r)}this.chart._dataChanges.push([this.index].concat(_toConsumableArray(t)))}},{key:"_onDataPush",value:function(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}},{key:"_onDataPop",value:function(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}},{key:"_onDataShift",value:function(){this._sync(["_removeElements",0,1])}},{key:"_onDataSplice",value:function(t,e){e&&this._sync(["_removeElements",t,e]);var i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}},{key:"_onDataUnshift",value:function(){this._sync(["_insertElements",0,arguments.length])}}])}();_defineProperty(Kn,"defaults",{}),_defineProperty(Kn,"datasetElementType",null),_defineProperty(Kn,"dataElementType",null);var qn=function(){return _createClass(function t(){_classCallCheck(this,t),_defineProperty(this,"x",void 0),_defineProperty(this,"y",void 0),_defineProperty(this,"active",!1),_defineProperty(this,"options",void 0),_defineProperty(this,"$animations",void 0)},[{key:"tooltipPosition",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"hasValue",value:function(){return Z(this.x)&&Z(this.y)}},{key:"getProps",value:function(t,e){var i=this,n=this.$animations;if(!e||!n)return this;var r={};return t.forEach(function(t){r[t]=n[t]&&n[t].active()?n[t]._to:i[t]}),r}}])}();function Jn(t,e){var i=t.options.ticks,n=function(t){var e=t.options.offset,i=t._tickSize(),n=t._length/i+(e?0:1),r=t._maxLength/i;return Math.floor(Math.min(n,r))}(t),r=Math.min(i.maxTicksLimit||n,n),a=i.major.enabled?function(t){var e,i,n=[];for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}(e):[],o=a.length,s=a[0],l=a[o-1],h=[];if(o>r)return function(t,e,i,n){var r,a=0,o=i[0];for(n=Math.ceil(n),r=0;r<t.length;r++)r===o&&(e.push(t[r]),o=i[++a*n])}(e,h,a,o/r),h;var u=function(t,e,i){var n=function(t){var e,i,n=t.length;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),r=e.length/i;if(!n)return Math.max(r,1);for(var a=J(n),o=0,s=a.length-1;o<s;o++){var l=a[o];if(l>r)return l}return Math.max(r,1)}(a,e,r);if(o>0){var c,f,d=o>1?Math.round((l-s)/(o-1)):null;for(Zn(e,h,u,v(d)?0:s-d,s),c=0,f=o-1;c<f;c++)Zn(e,h,u,a[c],a[c+1]);return Zn(e,h,u,l,v(d)?e.length:l+d),h}return Zn(e,h,u),h}function Zn(t,e,i,n,r){var a,o,s,l=b(n,0),h=Math.min(b(r,t.length),t.length),u=0;for(i=Math.ceil(i),r&&(i=(a=r-n)/Math.floor(a/i)),s=l;s<0;)u++,s=Math.round(l+u*i);for(o=Math.max(l,0);o<h;o++)o===s&&(e.push(t[o]),u++,s=Math.round(l+u*i))}_defineProperty(qn,"defaults",{}),_defineProperty(qn,"defaultRoutes",void 0);var Qn=function(t,e,i){return"top"===e||"left"===e?t[e]+i:t[e]-i},tr=function(t,e){return Math.min(e||t,t)};function er(t,e){for(var i=[],n=t.length/e,r=t.length,a=0;a<r;a+=n)i.push(t[Math.floor(a)]);return i}function ir(t,e,i){var n,r=t.ticks.length,a=Math.min(e,r-1),o=t._startPixel,s=t._endPixel,l=1e-6,h=t.getPixelForTick(a);if(!(i&&(n=1===r?Math.max(h-o,s-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(a-1))/2,h+=a<e?n:-n,h<o-l||h>s+l)))return h}function nr(t){return t.drawTicks?t.tickLength:0}function rr(t,e){if(!t.display)return 0;var i=Ii(t.font,e),n=Ti(t.padding);return(p(t.text)?t.text.length:1)*i.lineHeight+n.height}function ar(t,e,i){var n=wt(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=function(t){return"left"===t?"right":"right"===t?"left":t}(n)),n}var or=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e)).id=t.id,i.type=t.type,i.options=void 0,i.ctx=t.ctx,i.chart=t.chart,i.top=void 0,i.bottom=void 0,i.left=void 0,i.right=void 0,i.width=void 0,i.height=void 0,i._margins={left:0,right:0,top:0,bottom:0},i.maxWidth=void 0,i.maxHeight=void 0,i.paddingTop=void 0,i.paddingBottom=void 0,i.paddingLeft=void 0,i.paddingRight=void 0,i.axis=void 0,i.labelRotation=void 0,i.min=void 0,i.max=void 0,i._range=void 0,i.ticks=[],i._gridLineItems=null,i._labelItems=null,i._labelSizes=null,i._length=0,i._maxLength=0,i._longestTextCache={},i._startPixel=void 0,i._endPixel=void 0,i._reversePixels=!1,i._userMax=void 0,i._userMin=void 0,i._suggestedMax=void 0,i._suggestedMin=void 0,i._ticksLength=0,i._borderValue=0,i._cache={},i._dataLimitsCached=!1,i.$context=void 0,i}return _inherits(e,t),_createClass(e,[{key:"init",value:function(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}},{key:"parse",value:function(t,e){return t}},{key:"getUserBounds",value:function(){var t=this._userMin,e=this._userMax,i=this._suggestedMin,n=this._suggestedMax;return t=m(t,Number.POSITIVE_INFINITY),e=m(e,Number.NEGATIVE_INFINITY),i=m(i,Number.POSITIVE_INFINITY),n=m(n,Number.NEGATIVE_INFINITY),{min:m(t,i),max:m(e,n),minDefined:y(t),maxDefined:y(e)}}},{key:"getMinMax",value:function(t){var e,i=this.getUserBounds(),n=i.min,r=i.max,a=i.minDefined,o=i.maxDefined;if(a&&o)return{min:n,max:r};for(var s=this.getMatchingVisibleMetas(),l=0,h=s.length;l<h;++l)e=s[l].controller.getMinMax(this,t),a||(n=Math.min(n,e.min)),o||(r=Math.max(r,e.max));return{min:m(n=o&&n>r?r:n,m(r=a&&n>r?n:r,n)),max:m(r,m(n,r))}}},{key:"getPadding",value:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}},{key:"getLabelItems",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.chart.chartArea;return this._labelItems||(this._labelItems=this._computeLabelItems(t))}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){k(this.options.beforeUpdate,[this])}},{key:"update",value:function(t,e,i){var n=this.options,r=n.beginAtZero,a=n.grace,o=n.ticks,s=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ri(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();var l=s<this.ticks.length;this._convertTicksToLabels(l?er(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Jn(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}},{key:"configure",value:function(){var t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}},{key:"afterUpdate",value:function(){k(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){k(this.options.beforeSetDimensions,[this])}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}},{key:"afterSetDimensions",value:function(){k(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(t){this.chart.notifyPlugins(t,this.getContext()),k(this.options[t],[this])}},{key:"beforeDataLimits",value:function(){this._callHooks("beforeDataLimits")}},{key:"determineDataLimits",value:function(){}},{key:"afterDataLimits",value:function(){this._callHooks("afterDataLimits")}},{key:"beforeBuildTicks",value:function(){this._callHooks("beforeBuildTicks")}},{key:"buildTicks",value:function(){return[]}},{key:"afterBuildTicks",value:function(){this._callHooks("afterBuildTicks")}},{key:"beforeTickToLabelConversion",value:function(){k(this.options.beforeTickToLabelConversion,[this])}},{key:"generateTickLabels",value:function(t){var e,i,n,r=this.options.ticks;for(e=0,i=t.length;e<i;e++)(n=t[e]).label=k(r.callback,[n.value,e,t],this)}},{key:"afterTickToLabelConversion",value:function(){k(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){k(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var t,e,i,n=this.options,r=n.ticks,a=tr(this.ticks.length,n.ticks.maxTicksLimit),o=r.minRotation||0,s=r.maxRotation,l=o;if(!this._isVisible()||!r.display||o>=s||a<=1||!this.isHorizontal())this.labelRotation=o;else{var h=this._getLabelSizes(),u=h.widest.width,c=h.highest.height,f=ht(this.chart.width-u,0,this.maxWidth);u+6>(t=n.offset?this.maxWidth/a:f/(a-1))&&(t=f/(a-(n.offset?.5:1)),e=this.maxHeight-nr(n.grid)-r.padding-rr(n.title,this.chart.options.font),i=Math.sqrt(u*u+c*c),l=it(Math.min(Math.asin(ht((h.highest.height+6)/t,-1,1)),Math.asin(ht(e/i,-1,1))-Math.asin(ht(c/i,-1,1)))),l=Math.max(o,Math.min(s,l))),this.labelRotation=l}}},{key:"afterCalculateLabelRotation",value:function(){k(this.options.afterCalculateLabelRotation,[this])}},{key:"afterAutoSkip",value:function(){}},{key:"beforeFit",value:function(){k(this.options.beforeFit,[this])}},{key:"fit",value:function(){var t={width:0,height:0},e=this.chart,i=this.options,n=i.ticks,r=i.title,a=i.grid,o=this._isVisible(),s=this.isHorizontal();if(o){var l=rr(r,e.options.font);if(s?(t.width=this.maxWidth,t.height=nr(a)+l):(t.height=this.maxHeight,t.width=nr(a)+l),n.display&&this.ticks.length){var h=this._getLabelSizes(),u=h.first,c=h.last,f=h.widest,d=h.highest,v=2*n.padding,p=et(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(s){var m=n.mirror?0:y*f.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+m+v)}else{var b=n.mirror?0:g*f.width+y*d.height;t.width=Math.min(this.maxWidth,t.width+b+v)}this._calculatePadding(u,c,y,g)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}},{key:"_calculatePadding",value:function(t,e,i,n){var r=this.options,a=r.ticks,o=a.align,s=a.padding,l=r.position,h=0!==this.labelRotation,u="top"!==l&&"x"===this.axis;if(this.isHorizontal()){var c=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1),d=0,v=0;h?u?(d=n*t.width,v=i*e.height):(d=i*t.height,v=n*e.width):"start"===o?v=e.width:"end"===o?d=t.width:"inner"!==o&&(d=t.width/2,v=e.width/2),this.paddingLeft=Math.max((d-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((v-f+s)*this.width/(this.width-f),0)}else{var p=e.height/2,g=t.height/2;"start"===o?(p=0,g=t.height):"end"===o&&(p=e.height,g=0),this.paddingTop=p+s,this.paddingBottom=g+s}}},{key:"_handleMargins",value:function(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}},{key:"afterFit",value:function(){k(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var t=this.options,e=t.axis,i=t.position;return"top"===i||"bottom"===i||"x"===e}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(t){var e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)v(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}},{key:"_getLabelSizes",value:function(){var t=this._labelSizes;if(!t){var e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=er(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}},{key:"_computeLabelSizes",value:function(t,e,i){var n,r,a,o,s,l,h,u,c,f,d,g=this.ctx,y=this._longestTextCache,m=[],b=[],_=Math.floor(e/tr(e,i)),x=0,k=0;for(n=0;n<e;n+=_){if(o=t[n].label,s=this._resolveTickFontOptions(n),g.font=l=s.string,h=y[l]=y[l]||{data:{},gc:[]},u=s.lineHeight,c=f=0,v(o)||p(o)){if(p(o))for(r=0,a=o.length;r<a;++r)v(d=o[r])||p(d)||(c=Ee(g,h.data,h.gc,c,d),f+=u)}else c=Ee(g,h.data,h.gc,c,o),f=u;m.push(c),b.push(f),x=Math.max(c,x),k=Math.max(f,k)}!function(t,e){w(t,function(t){var i,n=t.gc,r=n.length/2;if(r>e){for(i=0;i<r;++i)delete t.data[n[i]];n.splice(0,r)}})}(y,e);var M=m.indexOf(x),P=b.indexOf(k),S=function(t){return{width:m[t]||0,height:b[t]||0}};return{first:S(0),last:S(e-1),widest:S(M),highest:S(P),widths:m,heights:b}}},{key:"getLabelForValue",value:function(t){return t}},{key:"getPixelForValue",value:function(t,e){return NaN}},{key:"getValueForPixel",value:function(t){}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getPixelForDecimal",value:function(t){this._reversePixels&&(t=1-t);var e=this._startPixel+t*this._length;return ut(this._alignToPixels?ze(this.chart,e,0):e)}},{key:"getDecimalForPixel",value:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}},{key:"getContext",value:function(t){var e=this.ticks||[];if(t>=0&&t<e.length){var i=e[t];return i.$context||(i.$context=function(t,e,i){return Ei(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=Ei(this.chart.getContext(),{scale:this,type:"scale"}))}},{key:"_tickSize",value:function(){var t=this.options.ticks,e=et(this.labelRotation),i=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,s=r?r.highest.height+a:0;return this.isHorizontal()?s*i>o*n?o/i:s/n:s*n<o*i?s/i:o/n}},{key:"_isVisible",value:function(){var t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}},{key:"_computeGridLineItems",value:function(t){var e,i,n,r,a,o,s,l,h,u,c,f,d=this.axis,v=this.chart,p=this.options,y=p.grid,m=p.position,_=p.border,x=y.offset,k=this.isHorizontal(),w=this.ticks.length+(x?1:0),M=nr(y),P=[],S=_.setContext(this.getContext()),C=S.display?S.width:0,O=C/2,A=function(t){return ze(v,t,C)};if("top"===m)e=A(this.bottom),o=this.bottom-M,l=e-O,u=A(t.top)+O,f=t.bottom;else if("bottom"===m)e=A(this.top),u=t.top,f=A(t.bottom)-O,o=e+O,l=this.top+M;else if("left"===m)e=A(this.right),a=this.right-M,s=e-O,h=A(t.left)+O,c=t.right;else if("right"===m)e=A(this.left),h=t.left,c=A(t.right)-O,a=e+O,s=this.left+M;else if("x"===d){if("center"===m)e=A((t.top+t.bottom)/2+.5);else if(g(m)){var D=Object.keys(m)[0],T=m[D];e=A(this.chart.scales[D].getPixelForValue(T))}u=t.top,f=t.bottom,l=(o=e+O)+M}else if("y"===d){if("center"===m)e=A((t.left+t.right)/2);else if(g(m)){var I=Object.keys(m)[0],L=m[I];e=A(this.chart.scales[I].getPixelForValue(L))}s=(a=e-O)-M,h=t.left,c=t.right}var R=b(p.ticks.maxTicksLimit,w),E=Math.max(1,Math.ceil(w/R));for(i=0;i<w;i+=E){var F=this.getContext(i),z=y.setContext(F),V=_.setContext(F),B=z.lineWidth,H=z.color,j=V.dash||[],W=V.dashOffset,N=z.tickWidth,Y=z.tickColor,U=z.tickBorderDash||[],$=z.tickBorderDashOffset;void 0!==(n=ir(this,i,x))&&(r=ze(v,n,B),k?a=s=h=c=r:o=l=u=f=r,P.push({tx1:a,ty1:o,tx2:s,ty2:l,x1:h,y1:u,x2:c,y2:f,width:B,color:H,borderDash:j,borderDashOffset:W,tickWidth:N,tickColor:Y,tickBorderDash:U,tickBorderDashOffset:$}))}return this._ticksLength=w,this._borderValue=e,P}},{key:"_computeLabelItems",value:function(t){var e,i,n,r,a,o,s,l,h,u,c,f=this.axis,d=this.options,v=d.position,y=d.ticks,m=this.isHorizontal(),b=this.ticks,_=y.align,x=y.crossAlign,k=y.padding,w=y.mirror,M=nr(d.grid),P=M+k,S=w?-k:P,C=-et(this.labelRotation),O=[],A="middle";if("top"===v)a=this.bottom-S,o=this._getXAxisLabelAlignment();else if("bottom"===v)a=this.top+S,o=this._getXAxisLabelAlignment();else if("left"===v){var D=this._getYAxisLabelAlignment(M);o=D.textAlign,r=D.x}else if("right"===v){var T=this._getYAxisLabelAlignment(M);o=T.textAlign,r=T.x}else if("x"===f){if("center"===v)a=(t.top+t.bottom)/2+P;else if(g(v)){var I=Object.keys(v)[0],L=v[I];a=this.chart.scales[I].getPixelForValue(L)+P}o=this._getXAxisLabelAlignment()}else if("y"===f){if("center"===v)r=(t.left+t.right)/2-P;else if(g(v)){var R=Object.keys(v)[0],E=v[R];r=this.chart.scales[R].getPixelForValue(E)}o=this._getYAxisLabelAlignment(M).textAlign}"y"===f&&("start"===_?A="top":"end"===_&&(A="bottom"));var F=this._getLabelSizes();for(e=0,i=b.length;e<i;++e){n=b[e].label;var z=y.setContext(this.getContext(e));s=this.getPixelForTick(e)+y.labelOffset,h=(l=this._resolveTickFontOptions(e)).lineHeight;var V=(u=p(n)?n.length:1)/2,B=z.color,H=z.textStrokeColor,j=z.textStrokeWidth,W=void 0,N=o;if(m?(r=s,"inner"===o&&(N=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),c="top"===v?"near"===x||0!==C?-u*h+h/2:"center"===x?-F.highest.height/2-V*h+h:-F.highest.height+h/2:"near"===x||0!==C?h/2:"center"===x?F.highest.height/2-V*h:F.highest.height-u*h,w&&(c*=-1),0===C||z.showLabelBackdrop||(r+=h/2*Math.sin(C))):(a=s,c=(1-u)*h/2),z.showLabelBackdrop){var Y=Ti(z.backdropPadding),U=F.heights[e],$=F.widths[e],X=c-Y.top,G=0-Y.left;switch(A){case"middle":X-=U/2;break;case"bottom":X-=U}switch(o){case"center":G-=$/2;break;case"right":G-=$;break;case"inner":e===i-1?G-=$:e>0&&(G-=$/2)}W={left:G,top:X,width:$+Y.width,height:U+Y.height,color:z.backdropColor}}O.push({label:n,font:l,textOffset:c,options:{rotation:C,color:B,strokeColor:H,strokeWidth:j,textAlign:N,textBaseline:A,translation:[r,a],backdrop:W}})}return O}},{key:"_getXAxisLabelAlignment",value:function(){var t=this.options,e=t.position,i=t.ticks;if(-et(this.labelRotation))return"top"===e?"left":"right";var n="center";return"start"===i.align?n="left":"end"===i.align?n="right":"inner"===i.align&&(n="inner"),n}},{key:"_getYAxisLabelAlignment",value:function(t){var e,i,n=this.options,r=n.position,a=n.ticks,o=a.crossAlign,s=a.mirror,l=a.padding,h=t+l,u=this._getLabelSizes().widest.width;return"left"===r?s?(i=this.right+l,"near"===o?e="left":"center"===o?(e="center",i+=u/2):(e="right",i+=u)):(i=this.right-h,"near"===o?e="right":"center"===o?(e="center",i-=u/2):(e="left",i=this.left)):"right"===r?s?(i=this.left+l,"near"===o?e="right":"center"===o?(e="center",i-=u/2):(e="left",i-=u)):(i=this.left+h,"near"===o?e="left":"center"===o?(e="center",i+=u/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}},{key:"_computeLabelArea",value:function(){if(!this.options.ticks.mirror){var t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}}},{key:"drawBackground",value:function(){var t=this.ctx,e=this.options.backgroundColor,i=this.left,n=this.top,r=this.width,a=this.height;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,r,a),t.restore())}},{key:"getLineWidthForValue",value:function(t){var e=this.options.grid;if(!this._isVisible()||!e.display)return 0;var i=this.ticks.findIndex(function(e){return e.value===t});return i>=0?e.setContext(this.getContext(i)).lineWidth:0}},{key:"drawGrid",value:function(t){var e,i,n=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o=function(t,e,i){i.width&&i.color&&(r.save(),r.lineWidth=i.width,r.strokeStyle=i.color,r.setLineDash(i.borderDash||[]),r.lineDashOffset=i.borderDashOffset,r.beginPath(),r.moveTo(t.x,t.y),r.lineTo(e.x,e.y),r.stroke(),r.restore())};if(n.display)for(e=0,i=a.length;e<i;++e){var s=a[e];n.drawOnChartArea&&o({x:s.x1,y:s.y1},{x:s.x2,y:s.y2},s),n.drawTicks&&o({x:s.tx1,y:s.ty1},{x:s.tx2,y:s.ty2},{color:s.tickColor,width:s.tickWidth,borderDash:s.tickBorderDash,borderDashOffset:s.tickBorderDashOffset})}}},{key:"drawBorder",value:function(){var t=this.chart,e=this.ctx,i=this.options,n=i.border,r=i.grid,a=n.setContext(this.getContext()),o=n.display?a.width:0;if(o){var s,l,h,u,c=r.setContext(this.getContext(0)).lineWidth,f=this._borderValue;this.isHorizontal()?(s=ze(t,this.left,o)-o/2,l=ze(t,this.right,c)+c/2,h=u=f):(h=ze(t,this.top,o)-o/2,u=ze(t,this.bottom,c)+c/2,s=l=f),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(s,h),e.lineTo(l,u),e.stroke(),e.restore()}}},{key:"drawLabels",value:function(t){if(this.options.ticks.display){var e=this.ctx,i=this._computeLabelArea();i&&We(e,i);var n,r=_createForOfIteratorHelper(this.getLabelItems(t));try{for(r.s();!(n=r.n()).done;){var a=n.value,o=a.options,s=a.font;Ge(e,a.label,0,a.textOffset,s,o)}}catch(t){r.e(t)}finally{r.f()}i&&Ne(e)}}},{key:"drawTitle",value:function(){var t=this.ctx,e=this.options,i=e.position,n=e.title,r=e.reverse;if(n.display){var a=Ii(n.font),o=Ti(n.padding),s=n.align,l=a.lineHeight/2;"bottom"===i||"center"===i||g(i)?(l+=o.bottom,p(n.text)&&(l+=a.lineHeight*(n.text.length-1))):l+=o.top;var h=function(t,e,i,n){var r,a,o,s=t.top,l=t.left,h=t.bottom,u=t.right,c=t.chart,f=c.chartArea,d=c.scales,v=0,p=h-s,y=u-l;if(t.isHorizontal()){if(a=Mt(n,l,u),g(i)){var m=Object.keys(i)[0],b=i[m];o=d[m].getPixelForValue(b)+p-e}else o="center"===i?(f.bottom+f.top)/2+p-e:Qn(t,i,e);r=u-l}else{if(g(i)){var _=Object.keys(i)[0],x=i[_];a=d[_].getPixelForValue(x)-y+e}else a="center"===i?(f.left+f.right)/2-y+e:Qn(t,i,e);o=Mt(n,h,s),v="left"===i?-Y:Y}return{titleX:a,titleY:o,maxWidth:r,rotation:v}}(this,l,i,s),u=h.titleX,c=h.titleY,f=h.maxWidth,d=h.rotation;Ge(t,n.text,0,0,a,{color:n.color,maxWidth:f,rotation:d,textAlign:ar(s,i,r),textBaseline:"middle",translation:[u,c]})}}},{key:"draw",value:function(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}},{key:"_layers",value:function(){var t=this,i=this.options,n=i.ticks&&i.ticks.z||0,r=b(i.grid&&i.grid.z,-1),a=b(i.border&&i.border.z,0);return this._isVisible()&&this.draw===e.prototype.draw?[{z:r,draw:function(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:a,draw:function(){t.drawBorder()}},{z:n,draw:function(e){t.drawLabels(e)}}]:[{z:n,draw:function(e){t.draw(e)}}]}},{key:"getMatchingVisibleMetas",value:function(t){var e,i,n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];for(e=0,i=n.length;e<i;++e){var o=n[e];o[r]!==this.id||t&&o.type!==t||a.push(o)}return a}},{key:"_resolveTickFontOptions",value:function(t){return Ii(this.options.ticks.setContext(this.getContext(t)).font)}},{key:"_maxDigits",value:function(){var t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}])}(qn),sr=function(){return _createClass(function t(e,i,n){_classCallCheck(this,t),this.type=e,this.scope=i,this.override=n,this.items=Object.create(null)},[{key:"isForType",value:function(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}},{key:"register",value:function(t){var e,i=Object.getPrototypeOf(t);(function(t){return"id"in t&&"defaults"in t})(i)&&(e=this.register(i));var n=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in n||(n[r]=t,function(t,e,i){var n=O(Object.create(null),[i?_e.get(i):{},_e.get(e),t.defaults]);_e.set(e,n),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(function(i){var n=i.split("."),r=n.pop(),a=[t].concat(n).join("."),o=e[i].split("."),s=o.pop(),l=o.join(".");_e.route(a,r,l,s)})}(e,t.defaultRoutes),t.descriptors&&_e.describe(e,t.descriptors)}(t,a,e),this.override&&_e.override(t.id,t.overrides)),a}},{key:"get",value:function(t){return this.items[t]}},{key:"unregister",value:function(t){var e=this.items,i=t.id,n=this.scope;i in e&&delete e[i],n&&i in _e[n]&&(delete _e[n][i],this.override&&delete pe[i])}}])}(),lr=function(){return _createClass(function t(){_classCallCheck(this,t),this.controllers=new sr(Kn,"datasets",!0),this.elements=new sr(qn,"elements"),this.plugins=new sr(Object,"plugins"),this.scales=new sr(or,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]},[{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e)}},{key:"remove",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e)}},{key:"addControllers",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.controllers)}},{key:"addElements",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.elements)}},{key:"addPlugins",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.plugins)}},{key:"addScales",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("register",e,this.scales)}},{key:"getController",value:function(t){return this._get(t,this.controllers,"controller")}},{key:"getElement",value:function(t){return this._get(t,this.elements,"element")}},{key:"getPlugin",value:function(t){return this._get(t,this.plugins,"plugin")}},{key:"getScale",value:function(t){return this._get(t,this.scales,"scale")}},{key:"removeControllers",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.controllers)}},{key:"removeElements",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.elements)}},{key:"removePlugins",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.plugins)}},{key:"removeScales",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._each("unregister",e,this.scales)}},{key:"_each",value:function(t,e,i){var n=this;_toConsumableArray(e).forEach(function(e){var r=i||n._getRegistryForType(e);i||r.isForType(e)||r===n.plugins&&e.id?n._exec(t,r,e):w(e,function(e){var r=i||n._getRegistryForType(e);n._exec(t,r,e)})})}},{key:"_exec",value:function(t,e,i){var n=R(t);k(i["before"+n],[],i),e[t](i),k(i["after"+n],[],i)}},{key:"_getRegistryForType",value:function(t){for(var e=0;e<this._typedRegistries.length;e++){var i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}},{key:"_get",value:function(t,e,i){var n=e.get(t);if(void 0===n)throw new Error('"'+t+'" is not a registered '+i+".");return n}}])}(),hr=new lr,ur=function(){return _createClass(function t(){_classCallCheck(this,t),this._init=void 0},[{key:"notify",value:function(t,e,i,n){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0!==this._init){var r=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(r,t,e,i);return"afterDestroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}}},{key:"_notify",value:function(t,e,i,n){n=n||{};var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=o.plugin;if(!1===k(s[i],[e,n,o.options],s)&&n.cancelable)return!1}}catch(t){a.e(t)}finally{a.f()}return!0}},{key:"invalidate",value:function(){v(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}},{key:"_descriptors",value:function(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}},{key:"_createDescriptors",value:function(t,e){var i=t&&t.config,n=b(i.options&&i.options.plugins,{}),r=function(t){for(var e={},i=[],n=Object.keys(hr.plugins.items),r=0;r<n.length;r++)i.push(hr.getPlugin(n[r]));for(var a=t.plugins||[],o=0;o<a.length;o++){var s=a[o];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==n||e?function(t,e,i,n){var r,a=e.plugins,o=e.localIds,s=[],l=t.getContext(),h=_createForOfIteratorHelper(a);try{for(h.s();!(r=h.n()).done;){var u=r.value,c=u.id,f=cr(i[c],n);null!==f&&s.push({plugin:u,options:fr(t.config,{plugin:u,local:o[c]},f,l)})}}catch(t){h.e(t)}finally{h.f()}return s}(t,r,n,e):[]}},{key:"_notifyStateChanges",value:function(t){var e=this._oldCache||[],i=this._cache,n=function(t,e){return t.filter(function(t){return!e.some(function(e){return t.plugin.id===e.plugin.id})})};this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}])}();function cr(t,e){return e||!1!==t?!0===t?{}:t:null}function fr(t,e,i,n){var r=e.plugin,a=e.local,o=t.pluginScopeKeys(r),s=t.getOptionScopes(i,o);return a&&r.defaults&&s.push(r.defaults),t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function dr(t,e){var i=_e.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function vr(t){if("x"===t||"y"===t||"r"===t)return t}function pr(t){if(vr(t))return t;for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];for(var r=0,a=i;r<a.length;r++){var o=a[r],s=o.axis||("top"===(l=o.position)||"bottom"===l?"x":"left"===l||"right"===l?"y":void 0)||t.length>1&&vr(t[0].toLowerCase());if(s)return s}var l;throw new Error("Cannot determine type of '".concat(t,"' axis. Please provide 'axis' or 'position' option."))}function gr(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function yr(t){var e=t.options||(t.options={});e.plugins=b(e.plugins,{}),e.scales=function(t,e){var i=pe[t.type]||{scales:{}},n=e.scales||{},r=dr(t.type,e),a=Object.create(null);return Object.keys(n).forEach(function(e){var o=n[e];if(!g(o))return console.error("Invalid scale configuration for scale: ".concat(e));if(o._proxy)return console.warn("Ignoring resolver passed as options for scale: ".concat(e));var s=pr(e,o,function(t,e){if(e.data&&e.data.datasets){var i=e.data.datasets.filter(function(e){return e.xAxisID===t||e.yAxisID===t});if(i.length)return gr(t,"x",i[0])||gr(t,"y",i[0])}return{}}(e,t),_e.scales[o.type]),l=function(t,e){return t===e?"_index_":"_value_"}(s,r),h=i.scales||{};a[e]=A(Object.create(null),[{axis:s},o,h[s],h[l]])}),t.data.datasets.forEach(function(i){var r=i.type||t.type,o=i.indexAxis||dr(r,e),s=(pe[r]||{}).scales||{};Object.keys(s).forEach(function(t){var e=function(t,e){var i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,o),r=i[e+"AxisID"]||e;a[r]=a[r]||Object.create(null),A(a[r],[{axis:e},n[r],s[t]])})}),Object.keys(a).forEach(function(t){var e=a[t];A(e,[_e.scales[e.type],_e.scale])}),a}(t,e)}function mr(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var br=new Map,_r=new Set;function xr(t,e){var i=br.get(t);return i||(i=e(),br.set(t,i),_r.add(i)),i}var kr=function(t,e,i){var n=L(e,i);void 0!==n&&t.add(n)},wr=function(){return _createClass(function t(e){_classCallCheck(this,t),this._config=function(t){return(t=t||{}).data=mr(t.data),yr(t),t}(e),this._scopeCache=new Map,this._resolverCache=new Map},[{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(t){this._config.type=t}},{key:"data",get:function(){return this._config.data},set:function(t){this._config.data=mr(t)}},{key:"options",get:function(){return this._config.options},set:function(t){this._config.options=t}},{key:"plugins",get:function(){return this._config.plugins}},{key:"update",value:function(){var t=this._config;this.clearCache(),yr(t)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(t){return xr(t,function(){return[["datasets.".concat(t),""]]})}},{key:"datasetAnimationScopeKeys",value:function(t,e){return xr("".concat(t,".transition.").concat(e),function(){return[["datasets.".concat(t,".transitions.").concat(e),"transitions.".concat(e)],["datasets.".concat(t),""]]})}},{key:"datasetElementScopeKeys",value:function(t,e){return xr("".concat(t,"-").concat(e),function(){return[["datasets.".concat(t,".elements.").concat(e),"datasets.".concat(t),"elements.".concat(e),""]]})}},{key:"pluginScopeKeys",value:function(t){var e=t.id;return xr("".concat(this.type,"-plugin-").concat(e),function(){return[["plugins.".concat(e)].concat(_toConsumableArray(t.additionalOptionScopes||[]))]})}},{key:"_cachedScopes",value:function(t,e){var i=this._scopeCache,n=i.get(t);return n&&!e||(n=new Map,i.set(t,n)),n}},{key:"getOptionScopes",value:function(t,e,i){var n=this.options,r=this.type,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;var s=new Set;e.forEach(function(e){t&&(s.add(t),e.forEach(function(e){return kr(s,t,e)})),e.forEach(function(t){return kr(s,n,t)}),e.forEach(function(t){return kr(s,pe[r]||{},t)}),e.forEach(function(t){return kr(s,_e,t)}),e.forEach(function(t){return kr(s,ge,t)})});var l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),_r.has(e)&&a.set(e,l),l}},{key:"chartOptionScopes",value:function(){var t=this.options,e=this.type;return[t,pe[e]||{},_e.datasets[e]||{},{type:e},_e,ge]}},{key:"resolveNamedOptions",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],r={$shared:!0},a=Mr(this._resolverCache,t,n),o=a.resolver,s=a.subPrefixes,l=o;(function(t,e){var i,n=Ze(t),r=n.isScriptable,a=n.isIndexable,o=_createForOfIteratorHelper(e);try{for(o.s();!(i=o.n()).done;){var s=i.value,l=r(s),h=a(s),u=(h||l)&&t[s];if(l&&(F(u)||Pr(u))||h&&p(u))return!0}}catch(t){o.e(t)}finally{o.f()}return!1})(o,e)&&(r.$shared=!1,l=Je(o,i=F(i)?i():i,this.createResolver(t,i,s)));var h,u=_createForOfIteratorHelper(e);try{for(u.s();!(h=u.n()).done;){var c=h.value;r[c]=l[c]}}catch(t){u.e(t)}finally{u.f()}return r}},{key:"createResolver",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],n=arguments.length>3?arguments[3]:void 0,r=Mr(this._resolverCache,t,i).resolver;return g(e)?Je(r,e,void 0,n):r}}])}();function Mr(t,e,i){var n=t.get(e);n||(n=new Map,t.set(e,n));var r=i.join(),a=n.get(r);return a||(a={resolver:qe(e,i),subPrefixes:i.filter(function(t){return!t.toLowerCase().includes("hover")})},n.set(r,a)),a}var Pr=function(t){return g(t)&&Object.getOwnPropertyNames(t).some(function(e){return F(t[e])})},Sr=["top","bottom","left","right","chartArea"];function Cr(t,e){return"top"===t||"bottom"===t||-1===Sr.indexOf(t)&&"x"===e}function Or(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Ar(t){var e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),k(i&&i.onComplete,[t],e)}function Dr(t){var e=t.chart,i=e.options.animation;k(i&&i.onProgress,[t],e)}function Tr(t){return xe()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var Ir={},Lr=function(t){var e=Tr(t);return Object.values(Ir).filter(function(t){return t.canvas===e}).pop()};function Rr(t,e,i){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n],o=+a;if(o>=e){var s=t[a];delete t[a],(i>0||o>e)&&(t[o+i]=s)}}}var Er=function(){return _createClass(function t(e,i){var n=this;_classCallCheck(this,t);var r=this.config=new wr(i),a=Tr(e),o=Lr(a);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");var s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||In(a)),this.platform.updateConfig(r);var l=this.platform.acquireContext(a,s.aspectRatio),h=l&&l.canvas,u=h&&h.height,c=h&&h.width;this.id=d(),this.ctx=l,this.canvas=h,this.width=c,this.height=u,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ur,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=kt(function(t){return n.update(t)},s.resizeDelay||0),this._dataChanges=[],Ir[this.id]=this,l&&h?(At.listen(this,"complete",Ar),At.listen(this,"progress",Dr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")},[{key:"aspectRatio",get:function(){var t=this.options,e=t.aspectRatio,i=t.maintainAspectRatio,n=this.width,r=this.height,a=this._aspectRatio;return v(e)?i&&a?a:r?n/r:null:e}},{key:"data",get:function(){return this.config.data},set:function(t){this.config.data=t}},{key:"options",get:function(){return this._options},set:function(t){this.config.options=t}},{key:"registry",get:function(){return hr}},{key:"_initialize",value:function(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Te(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}},{key:"clear",value:function(){return Ve(this.canvas,this.ctx),this}},{key:"stop",value:function(){return At.stop(this),this}},{key:"resize",value:function(t,e){At.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}},{key:"_resize",value:function(t,e){var i=this.options,n=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Te(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),k(i.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}},{key:"ensureScalesHaveIDs",value:function(){w(this.options.scales||{},function(t,e){t.id=e})}},{key:"buildOrUpdateScales",value:function(){var t=this,e=this.options,i=e.scales,n=this.scales,r=Object.keys(n).reduce(function(t,e){return t[e]=!1,t},{}),a=[];i&&(a=a.concat(Object.keys(i).map(function(t){var e=i[t],n=pr(t,e),r="r"===n,a="x"===n;return{options:e,dposition:r?"chartArea":a?"bottom":"left",dtype:r?"radialLinear":a?"category":"linear"}}))),w(a,function(i){var a=i.options,o=a.id,s=pr(o,a),l=b(a.type,i.dtype);void 0!==a.position&&Cr(a.position,s)===Cr(i.dposition)||(a.position=i.dposition),r[o]=!0;var h=null;o in n&&n[o].type===l?h=n[o]:(h=new(hr.getScale(l))({id:o,type:l,ctx:t.ctx,chart:t}),n[h.id]=h),h.init(a,e)}),w(r,function(t,e){t||delete n[e]}),w(n,function(e){vn.configure(t,e,e.options),vn.addBox(t,e)})}},{key:"_updateMetasets",value:function(){var t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(function(t,e){return t.index-e.index}),i>e){for(var n=e;n<i;++n)this._destroyDatasetMeta(n);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Or("order","index"))}},{key:"_removeUnreferencedMetasets",value:function(){var t=this,e=this._metasets,i=this.data.datasets;e.length>i.length&&delete this._stacks,e.forEach(function(e,n){0===i.filter(function(t){return t===e._dataset}).length&&t._destroyDatasetMeta(n)})}},{key:"buildOrUpdateControllers",value:function(){var t,e,i=[],n=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=n.length;t<e;t++){var r=n[t],a=this.getDatasetMeta(t),o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(t),a=this.getDatasetMeta(t)),a.type=o,a.indexAxis=r.indexAxis||dr(o,this.options),a.order=r.order||0,a.index=t,a.label=""+r.label,a.visible=this.isDatasetVisible(t),a.controller)a.controller.updateIndex(t),a.controller.linkScales();else{var s=hr.getController(o),l=_e.datasets[o],h=l.datasetElementType,u=l.dataElementType;Object.assign(s,{dataElementType:hr.getElement(u),datasetElementType:h&&hr.getElement(h)}),a.controller=new s(this,t),i.push(a.controller)}}return this._updateMetasets(),i}},{key:"_resetElements",value:function(){var t=this;w(this.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},this)}},{key:"reset",value:function(){this._resetElements(),this.notifyPlugins("reset")}},{key:"update",value:function(t){var e=this.config;e.update();var i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1!==this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");for(var a=0,o=0,s=this.data.datasets.length;o<s;o++){var l=this.getDatasetMeta(o).controller,h=!n&&-1===r.indexOf(l);l.buildOrUpdateElements(h),a=Math.max(+l.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),n||w(r,function(t){t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Or("z","_idx"));var u=this._active,c=this._lastEvent;c?this._eventHandler(c,!0):u.length&&this._updateHoverStyles(u,u,!0),this.render()}}},{key:"_updateScales",value:function(){var t=this;w(this.scales,function(e){vn.removeBox(t,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}},{key:"_checkEventBindings",value:function(){var t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);z(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}},{key:"_updateHiddenIndices",value:function(){var t,e=this._hiddenIndices,i=_createForOfIteratorHelper(this._getUniformDataChanges()||[]);try{for(i.s();!(t=i.n()).done;){var n=t.value,r=n.method,a=n.start,o=n.count;Rr(e,a,"_removeElements"===r?-o:o)}}catch(t){i.e(t)}finally{i.f()}}},{key:"_getUniformDataChanges",value:function(){var t=this._dataChanges;if(t&&t.length){this._dataChanges=[];for(var e=this.data.datasets.length,i=function(e){return new Set(t.filter(function(t){return t[0]===e}).map(function(t,e){return e+","+t.splice(1).join(",")}))},n=i(0),r=1;r<e;r++)if(!z(n,i(r)))return;return Array.from(n).map(function(t){return t.split(",")}).map(function(t){return{method:t[1],start:+t[2],count:+t[3]}})}}},{key:"_updateLayout",value:function(t){var e=this;if(!1!==this.notifyPlugins("beforeLayout",{cancelable:!0})){vn.update(this,this.width,this.height,t);var i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],w(this.boxes,function(t){var i;n&&"chartArea"===t.position||(t.configure&&t.configure(),(i=e._layers).push.apply(i,_toConsumableArray(t._layers())))},this),this._layers.forEach(function(t,e){t._idx=e}),this.notifyPlugins("afterLayout")}}},{key:"_updateDatasets",value:function(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(var e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(var n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,F(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}},{key:"_updateDataset",value:function(t,e){var i=this.getDatasetMeta(t),n={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",n)&&(i.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}},{key:"render",value:function(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(At.has(this)?this.attached&&!At.running(this)&&At.start(this):(this.draw(),Ar({chart:this})))}},{key:"draw",value:function(){var t;if(this._resizeBeforeDraw){var e=this._resizeBeforeDraw,i=e.width,n=e.height;this._resizeBeforeDraw=null,this._resize(i,n)}if(!(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))){var r=this._layers;for(t=0;t<r.length&&r[t].z<=0;++t)r[t].draw(this.chartArea);for(this._drawDatasets();t<r.length;++t)r[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}}},{key:"_getSortedDatasetMetas",value:function(t){var e,i,n=this._sortedMetasets,r=[];for(e=0,i=n.length;e<i;++e){var a=n[e];t&&!a.visible||r.push(a)}return r}},{key:"getSortedVisibleDatasetMetas",value:function(){return this._getSortedDatasetMetas(!0)}},{key:"_drawDatasets",value:function(){if(!1!==this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){for(var t=this.getSortedVisibleDatasetMetas(),e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(t){var e=this.ctx,i={meta:t,index:t.index,cancelable:!0},n=Gi(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(n&&We(e,n),t.controller.draw(),n&&Ne(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}},{key:"isPointInArea",value:function(t){return je(t,this.chartArea,this._minPadding)}},{key:"getElementsAtEventForMode",value:function(t,e,i,n){var r=en.modes[e];return"function"==typeof r?r(this,t,i,n):[]}},{key:"getDatasetMeta",value:function(t){var e=this.data.datasets[t],i=this._metasets,n=i.filter(function(t){return t&&t._dataset===e}).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}},{key:"getContext",value:function(){return this.$context||(this.$context=Ei(null,{chart:this,type:"chart"}))}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(t){var e=this.data.datasets[t];if(!e)return!1;var i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}},{key:"setDatasetVisibility",value:function(t,e){this.getDatasetMeta(t).hidden=!e}},{key:"toggleDataVisibility",value:function(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}},{key:"getDataVisibility",value:function(t){return!this._hiddenIndices[t]}},{key:"_updateVisibility",value:function(t,e,i){var n=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,n);E(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(function(e){return e.datasetIndex===t?n:void 0}))}},{key:"hide",value:function(t,e){this._updateVisibility(t,e,!1)}},{key:"show",value:function(t,e){this._updateVisibility(t,e,!0)}},{key:"_destroyDatasetMeta",value:function(t){var e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}},{key:"_stop",value:function(){var t,e;for(this.stop(),At.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}},{key:"destroy",value:function(){this.notifyPlugins("beforeDestroy");var t=this.canvas,e=this.ctx;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Ve(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ir[this.id],this.notifyPlugins("afterDestroy")}},{key:"toBase64Image",value:function(){var t;return(t=this.canvas).toDataURL.apply(t,arguments)}},{key:"bindEvents",value:function(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}},{key:"bindUserEvents",value:function(){var t=this,e=this._listeners,i=this.platform,n=function(n,r){i.addEventListener(t,n,r),e[n]=r},r=function(e,i,n){e.offsetX=i,e.offsetY=n,t._eventHandler(e)};w(this.options.events,function(t){return n(t,r)})}},{key:"bindResponsiveEvents",value:function(){var t=this;this._responsiveListeners||(this._responsiveListeners={});var e,i=this._responsiveListeners,n=this.platform,r=function(e,r){n.addEventListener(t,e,r),i[e]=r},a=function(e,r){i[e]&&(n.removeEventListener(t,e,r),delete i[e])},o=function(e,i){t.canvas&&t.resize(e,i)},s=fun0}ЅЅ("resize",o),t._stop(),t._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():e()}},{key:"unbindEvents",value:function(){var t=this;w(this._listeners,function(e,i){t.platform.removeEventListener(t,i,e)}),this._listeners={},w(this._responsiveListeners,function(e,i){t.platform.removeEventListener(t,i,e)}),this._responsiveListeners=void 0}},{key:"updateHoverStyle",value:function(t,e,i){var n,r,a,o=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+o+"DatasetHoverStyle"](),r=0,a=t.length;r<a;++r){var s=(n=t[r])&&this.getDatasetMeta(n.datasetIndex).controller;s&&s[o+"HoverStyle"](n.element,n.datasetIndex,n.index)}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t){var e=this,i=this._active||[],n=t.map(function(t){var i=t.datasetIndex,n=t.index,r=e.getDatasetMeta(i);if(!r)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:r.data[n],index:n}});!M(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}},{key:"notifyPlugins",value:function(t,e,i){return this._plugins.notify(this,t,e,i)}},{key:"isPluginEnabled",value:function(t){return 1===this._plugins._cache.filter(function(e){return e.plugin.id===t}).length}},{key:"_updateHoverStyles",value:function(t,e,i){var n=this.options.hover,r=function(t,e){return t.filter(function(t){return!e.some(function(e){return t.datasetIndex===e.datasetIndex&&t.index===e.index})})},a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),o.length&&n.mode&&this.updateHoverStyle(o,n.mode,!0)}},{key:"_eventHandler",value:function(t,e){var i=this,n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=function(e){return(e.options.events||i.options.events).includes(t.native.type)};if(!1!==this.notifyPlugins("beforeEvent",n,r)){var a=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(a||n.changed)&&this.render(),this}}},{key:"_handleEvent",value:function(t,e,i){var n=this._active,r=void 0===n?[]:n,a=this.options,o=e,s=this._getActiveElements(t,r,i,o),l=V(t),h=function(t,e,i,n){return i&&"mouseout"!==t.type?n?e:t:null}(t,this._lastEvent,i,l);i&&(this._lastEvent=null,k(a.onHover,[t,s,this],this),l&&k(a.onClick,[t,s,this],this));var u=!M(s,r);return(u||e)&&(this._active=s,this._updateHoverStyles(s,r,e)),this._lastEvent=h,u}},{key:"_getActiveElements",value:function(t,e,i,n){if("mouseout"===t.type)return[];if(!i)return e;var r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,n)}}],[{key:"register",value:function(){hr.add.apply(hr,arguments),Fr()}},{key:"unregister",value:function(){hr.remove.apply(hr,arguments),Fr()}}])}();function Fr(){return w(Er.instances,function(t){return t._plugins.invalidate()})}function zr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}_defineProperty(Er,"defaults",_e),_defineProperty(Er,"instances",Ir),_defineProperty(Er,"overrides",pe),_defineProperty(Er,"registry",hr),_defineProperty(Er,"version","4.5.1"),_defineProperty(Er,"getChart",Lr);var Vr=function(){function t(e){_classCallCheck(this,t),_defineProperty(this,"options",void 0),this.options=e||{}}return _createClass(t,[{key:"init",value:function(){}},{key:"formats",value:function(){return zr()}},{key:"parse",value:function(){return zr()}},{key:"format",value:function(){return zr()}},{key:"add",value:function(){return zr()}},{key:"diff",value:function(){return zr()}},{key:"startOf",value:function(){return zr()}},{key:"endOf",value:function(){return zr()}}],[{key:"override",value:function(e){Object.assign(t.prototype,e)}}])}(),Br={_date:Vr};function Hr(t){var e,i,n,r,a=t.iScale,o=function(t,e){if(!t._cache.$bar){for(var i=t.getMatchingVisibleMetas(e),n=[],r=0,a=i.length;r<a;r++)n=n.concat(i[r].controller.getAllParsedValues(t));t._cache.$bar=bt(n.sort(function(t,e){return t-e}))}return t._cache.$bar}(a,t.type),s=a._length,l=function(){32767!==n&&-32768!==n&&(E(r)&&(s=Math.min(s,Math.abs(n-r)||s)),r=n)};for(e=0,i=o.length;e<i;++e)n=a.getPixelForValue(o[e]),l();for(r=void 0,e=0,i=a.ticks.length;e<i;++e)n=a.getPixelForTick(e),l();return s}function jr(t,e,i,n){return p(t)?function(t,e,i,n){var r=i.parse(t[0],n),a=i.parse(t[1],n),o=Math.min(r,a),s=Math.max(r,a),l=o,h=s;Math.abs(o)>Math.abs(s)&&(l=s,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:r,end:a,min:o,max:s}}(t,e,i,n):e[i.axis]=i.parse(t,n),e}function Wr(t,e,i,n){var r,a,o,s,l=t.iScale,h=t.vScale,u=l.getLabels(),c=l===h,f=[];for(r=i,a=i+n;r<a;++r)s=e[r],(o={})[l.axis]=c||l.parse(u[r],r),f.push(jr(s,o,h,r));return f}function Nr(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Yr(t,e,i,n){var r=e.borderSkipped,a={};if(r)if(!0!==r){var o=function(t){var e,i,n,r,a;return t.horizontal?(e=t.base>t.x,i="left",n="right"):(e=t.base<t.y,i="bottom",n="top"),e?(r="end",a="start"):(r="start",a="end"),{start:i,end:n,reverse:e,top:r,bottom:a}}(t),s=o.start,l=o.end,h=o.reverse,u=o.top,c=o.bottom;"middle"===r&&i&&(t.enableBorderRadius=!0,(i._top||0)===n?r=u:(i._bottom||0)===n?r=c:(a[Ur(c,s,l,h)]=!0,r=u)),a[Ur(r,s,l,h)]=!0,t.borderSkipped=a}else t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};else t.borderSkipped=a}function Ur(t,e,i,n){var r,a,o;return n?(o=i,t=$r(t=(r=t)===(a=e)?o:r===o?a:r,i,e)):t=$r(t,e,i),t}function $r(t,e,i){return"start"===t?e:"end"===t?i:t}function Xr(t,e,i){var n=e.inflateAmount;t.inflateAmount="auto"===n?1===i?.33:0:n}var Gr=function(t){function e(t,i){var n;return _classCallCheck(this,e),(n=_callSuper(this,e,[t,i])).enableOptionSharing=!0,n.innerRadius=void 0,n.outerRadius=void 0,n.offsetX=void 0,n.offsetY=void 0,n}return _inherits(e,t),_createClass(e,[{key:"linkScales",value:function(){}},{key:"parse",value:function(t,e){var i=this.getDataset().data,n=this._cachedMeta;if(!1===this._parsing)n._parsed=i;else{var r,a,o=function(t){return+i[t]};if(g(i[t])){var s=this._parsing.key,l=void 0===s?"value":s;o=function(t){return+L(i[t],l)}}for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}},{key:"_getRotation",value:function(){return et(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return et(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var t=H,e=-H,i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){var n=this.chart.getDatasetMeta(i).controller,r=n._getRotation(),a=n._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}},{key:"update",value:function(t){var e=this.chart.chartArea,i=this._cachedMeta,n=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(e.width,e.height)-r)/2,0),o=Math.min(_(this.options.cutout,a),1),s=this._getRingWeight(this.index),l=this._getRotationExtents(),h=l.circumference,u=function(t,e,i){var n=1,r=1,a=0,o=0;if(e<H){var s=t,l=s+e,h=Math.cos(s),u=Math.sin(s),c=Math.cos(l),f=Math.sin(l),d=function(t,e,n){return lt(t,s,l,!0)?1:Math.max(e,e*i,n,n*i)},v=function(t,e,n){return lt(t,s,l,!0)?-1:Math.min(e,e*i,n,n*i)},p=d(0,h,c),g=d(Y,u,f),y=v(B,h,c),m=v(B+Y,u,f);n=(p-y)/2,r=(g-m)/2,a=-(p+y)/2,o=-(g+m)/2}return{ratioX:n,ratioY:r,offsetX:a,offsetY:o}}(l.rotation,h,o),c=u.ratioX,f=u.ratioY,d=u.offsetX,v=u.offsetY,p=(e.width-r)/c,g=(e.height-r)/f,y=Math.max(Math.min(p,g)/2,0),m=x(this.options.radius,y),b=(m-Math.max(m*o,0))/this._getVisibleDatasetWeightTotal();this.offsetX=d*m,this.offsetY=v*m,i.total=this.calculateTotal(),this.outerRadius=m-b*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-b*s,0),this.updateElements(n,0,n.length,t)}},{key:"_circumference",value:function(t,e){var i=this.options,n=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===n._parsed[t]||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*r/H)}},{key:"updateElements",value:function(t,e,i,n){var r,a="reset"===n,o=this.chart,s=o.chartArea,l=o.options.animation,h=(s.left+s.right)/2,u=(s.top+s.bottom)/2,c=a&&l.animateScale,f=c?0:this.innerRadius,d=c?0:this.outerRadius,v=this._getSharedOptions(e,n),p=v.sharedOptions,g=v.includeOptions,y=this._getRotation();for(r=0;r<e;++r)y+=this._circumference(r,a);for(r=e;r<e+i;++r){var m=this._circumference(r,a),b=t[r],_={x:h+this.offsetX,y:u+this.offsetY,startAngle:y,endAngle:y+m,circumference:m,outerRadius:d,innerRadius:f};g&&(_.options=p||this.resolveDataElementOptions(r,b.active?"active":n)),y+=m,this.updateElement(b,r,_,n)}}},{key:"calculateTotal",value:function(){var t,e=this._cachedMeta,i=e.data,n=0;for(t=0;t<i.length;t++){var r=e._parsed[t];null===r||isNaN(r)||!this.chart.getDataVisibility(t)||i[t].hidden||(n+=Math.abs(r))}return n}},{key:"calculateCircumference",value:function(t){var e=this._cachedMeta.total;return e>0&&!isNaN(t)?H*(Math.abs(t)/e):0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=fe(e._parsed[t],i.options.locale);return{label:n[t]||"",value:r}}},{key:"getMaxBorderWidth",value:function(t){var e,i,n,r,a,o=0,s=this.chart;if(!t)for(e=0,i=s.data.datasets.length;e<i;++e)if(s.isDatasetVisible(e)){t=(n=s.getDatasetMeta(e)).data,r=n.controller;break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)"inner"!==(a=r.resolveDataElementOptions(e)).borderAlign&&(o=Math.max(o,a.borderWidth||0,a.hoverBorderWidth||0));return o}},{key:"getMaxOffset",value:function(t){for(var e=0,i=0,n=t.length;i<n;++i){var r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}},{key:"_getRingWeightOffset",value:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}},{key:"_getRingWeight",value:function(t){return Math.max(b(this.chart.data.datasets[t].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}])}(Kn);_defineProperty(Gr,"id","doughnut"),_defineProperty(Gr,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),_defineProperty(Gr,"descriptors",{_scriptable:function(t){return"spacing"!==t},_indexable:function(t){return"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}}),_defineProperty(Gr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data,i=t.legend.options.labels,n=i.pointStyle,r=i.textAlign,a=i.color,o=i.useBorderRadius,s=i.borderRadius;return e.labels.length&&e.datasets.length?e.labels.map(function(e,i){var l=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:l.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(i),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:r,pointStyle:n,borderRadius:o&&(s||l.borderRadius),index:i}}):[]}},onClick:function(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});var Kr=function(t){function e(t,i){var n;return _classCallCheck(this,e),(n=_callSuper(this,e,[t,i])).innerRadius=void 0,n.outerRadius=void 0,n}return _inherits(e,t),_createClass(e,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart,n=i.data.labels||[],r=fe(e._parsed[t].r,i.options.locale);return{label:n[t]||"",value:r}}},{key:"parseObjectData",value:function(t,e,i,n){return hi.bind(this)(t,e,i,n)}},{key:"update",value:function(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}},{key:"getMinMax",value:function(){var t=this,e=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(function(e,n){var r=t.getParsed(n).r;!isNaN(r)&&t.chart.getDataVisibility(n)&&(r<i.min&&(i.min=r),r>i.max&&(i.max=r))}),i}},{key:"_updateRadius",value:function(){var t=this.chart,e=t.chartArea,i=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(n/2,0),a=(r-Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}},{key:"updateElements",value:function(t,e,i,n){var r,a="reset"===n,o=this.chart,s=o.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,u=l.yCenter,c=l.getIndexAngle(0)-.5*B,f=c,d=360/this.countVisibleElements();for(r=0;r<e;++r)f+=this._computeAngle(r,n,d);for(r=e;r<e+i;r++){var v=t[r],p=f,g=f+this._computeAngle(r,n,d),y=o.getDataVisibility(r)?l.getDistanceFromCenterForValue(this.getParsed(r).r):0;f=g,a&&(s.animateScale&&(y=0),s.animateRotate&&(p=g=c));var m={x:h,y:u,innerRadius:0,outerRadius:y,startAngle:p,endAngle:g,options:this.resolveDataElementOptions(r,v.active?"active":n)};this.updateElement(v,r,m,n)}}},{key:"countVisibleElements",value:function(){var t=this,e=this._cachedMeta,i=0;return e.data.forEach(function(e,n){!isNaN(t.getParsed(n).r)&&t.chart.getDataVisibility(n)&&i++}),i}},{key:"_computeAngle",value:function(t,e,i){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||i):0}}])}(Kn);_defineProperty(Kr,"id","polarArea"),_defineProperty(Kr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),_defineProperty(Kr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data;if(e.labels.length&&e.datasets.length){var i=t.legend.options.labels,n=i.pointStyle,r=i.color;return e.labels.map(function(e,i){var a=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,fontColor:r,lineWidth:a.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}})}return[]}},onClick:function(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var qr=Object.freeze({__proto__:null,BarController:(t=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"parsePrimitiveData",value:function(t,e,i,n){return Wr(t,e,i,n)}},{key:"parseArrayData",value:function(t,e,i,n){return Wr(t,e,i,n)}},{key:"parseObjectData",value:function(t,e,i,n){var r,a,o,s,l=t.iScale,h=t.vScale,u=this._parsing,c=u.xAxisKey,f=void 0===c?"x":c,d=u.yAxisKey,v=void 0===d?"y":d,p="x"===l.axis?f:v,g="x"===h.axis?f:v,y=[];for(r=i,a=i+n;r<a;++r)s=e[r],(o={})[l.axis]=l.parse(L(s,p),r),y.push(jr(L(s,g),o,h,r));return y}},{key:"updateRangeFromParsed",value:function(t,i,n,r){_superPropGet(e,"updateRangeFromParsed",this,3)([t,i,n,r]);var a=n._custom;a&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}},{key:"getMaxOverflow",value:function(){return 0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=e.iScale,n=e.vScale,r=this.getParsed(t),a=r._custom,o=Nr(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(r[n.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}},{key:"initialize",value:function(){this.enableOptionSharing=!0,_superPropGet(e,"initialize",this,3)([]),this._cachedMeta.stack=this.getDataset().stack}},{key:"update",value:function(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var r="reset"===n,a=this.index,o=this._cachedMeta.vScale,s=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),u=this._getSharedOptions(e,n),c=u.sharedOptions,f=u.includeOptions,d=e;d<e+i;d++){var p=this.getParsed(d),g=r||v(p[o.axis])?{base:s,head:s}:this._calculateBarValuePixels(d),y=this._calculateBarIndexPixels(d,h),m=(p._stacks||{})[o.axis],b={horizontal:l,base:g.base,enableBorderRadius:!m||Nr(p._custom)||a===m._top||a===m._bottom,x:l?g.head:y.center,y:l?y.center:g.head,height:l?y.size:Math.abs(g.size),width:l?Math.abs(g.size):y.size};f&&(b.options=c||this.resolveDataElementOptions(d,t[d].active?"active":n));var _=b.options||t[d].options;Yr(b,_,m,a),Xr(b,_,h.ratio),this.updateElement(t[d],d,b,n)}}},{key:"_getStacks",value:function(t,e){var i,n=this._cachedMeta.iScale,r=n.getMatchingVisibleMetas(this._type).filter(function(t){return t.controller.options.grouped}),a=n.options.stacked,o=[],s=this._cachedMeta.controller.getParsed(e),l=s&&s[n.axis],h=function(t){var e=t._parsed.find(function(t){return t[n.axis]===l}),i=e&&e[t.vScale.axis];if(v(i)||isNaN(i))return!0},u=_createForOfIteratorHelper(r);try{for(u.s();!(i=u.n()).done;){var c=i.value;if((void 0===e||!h(c))&&((!1===a||-1===o.indexOf(c.stack)||void 0===a&&void 0===c.stack)&&o.push(c.stack),c.index===t))break}}catch(t){u.e(t)}finally{u.f()}return o.length||o.push(void 0),o}},{key:"_getStackCount",value:function(t){return this._getStacks(void 0,t).length}},{key:"_getAxisCount",value:function(){return this._getAxis().length}},{key:"getFirstScaleIdForIndexAxis",value:function(){var t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(function(i){return t[i].axis===e}).shift()}},{key:"_getAxis",value:function(){var t,e={},i=this.getFirstScaleIdForIndexAxis(),n=_createForOfIteratorHelper(this.chart.data.datasets);try{for(n.s();!(t=n.n()).done;){var r=t.value;e[b("x"===this.chart.options.indexAxis?r.xAxisID:r.yAxisID,i)]=!0}}catch(t){n.e(t)}finally{n.f()}return Object.keys(e)}},{key:"_getStackIndex",value:function(t,e,i){var n=this._getStacks(t,i),r=void 0!==e?n.indexOf(e):-1;return-1===r?n.length-1:r}},{key:"_getRuler",value:function(){var t,e,i=this.options,n=this._cachedMeta,r=n.iScale,a=[];for(t=0,e=n.data.length;t<e;++t)a.push(r.getPixelForValue(this.getParsed(t)[r.axis],t));var o=i.barThickness;return{min:o||Hr(n),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:i.grouped,ratio:o?1:i.categoryPercentage*i.barPercentage}}},{key:"_calculateBarValuePixels",value:function(t){var e,i,n=this._cachedMeta,r=n.vScale,a=n._stacked,o=n.index,s=this.options,l=s.base,h=s.minBarLength,u=l||0,c=this.getParsed(t),f=c._custom,d=Nr(f),p=c[r.axis],g=0,y=a?this.applyStack(r,c,a):p;y!==p&&(g=y-p,y=p),d&&(p=f.barStart,y=f.barEnd-f.barStart,0!==p&&G(p)!==G(f.barEnd)&&(g=0),g+=p);var m=v(l)||d?g:l,b=r.getPixelForValue(m);if(i=(e=this.chart.getDataVisibility(t)?r.getPixelForValue(g+y):b)-b,Math.abs(i)<h){i=function(t,e,i){return 0!==t?G(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(i,r,u)*h,p===u&&(b-=i/2);var _=r.getPixelForDecimal(0),x=r.getPixelForDecimal(1),k=Math.min(_,x),w=Math.max(_,x);e=(b=Math.max(Math.min(b,w),k))+i,a&&!d&&(c._stacks[r.axis]._visualValues[o]=r.getValueForPixel(e)-r.getValueForPixel(b))}if(b===r.getPixelForValue(u)){var M=G(i)*r.getLineWidthForValue(u)/2;b+=M,i-=M}return{size:i,base:b,head:e,center:e+i/2}}},{key:"_calculateBarIndexPixels",value:function(t,e){var i,n,r=e.scale,a=this.options,o=a.skipNull,s=b(a.maxBarThickness,1/0),l=this._getAxisCount();if(e.grouped){var h=o?this._getStackCount(t):e.stackCount,u="flex"===a.barThickness?function(t,e,i,n){var r=e.pixels,a=r[t],o=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null,l=i.categoryPercentage;null===o&&(o=a-(null===s?e.end-e.start:s-a)),null===s&&(s=a+a-o);var h=a-(a-Math.min(o,s))/2*l;return{chunk:Math.abs(s-o)/2*l/n,ratio:i.barPercentage,start:h}}(t,e,a,h*l):function(t,e,i,n){var r,a,o=i.barThickness;return v(o)?(r=e.min*i.categoryPercentage,a=i.barPercentage):(r=o*n,a=1),{chunk:r/n,ratio:a,start:e.pixels[t]-r/2}}(t,e,a,h*l),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(b(c,this.getFirstScaleIdForIndexAxis())),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;i=u.start+u.chunk*d+u.chunk/2,n=Math.min(s,u.chunk*u.ratio)}else i=r.getPixelForValue(this.getParsed(t)[r.axis],t),n=Math.min(s,e.min*e.ratio);return{base:i-n/2,head:i+n/2,center:i,size:n}}},{key:"draw",value:function(){for(var t=this._cachedMeta,e=t.vScale,i=t.data,n=i.length,r=0;r<n;++r)null===this.getParsed(r)[e.axis]||i[r].hidden||i[r].draw(this._ctx)}}])}(Kn),_defineProperty(t,"id","bar"),_defineProperty(t,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),_defineProperty(t,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}}),t),BubbleController:(e=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"initialize",value:function(){this.enableOptionSharing=!0,_superPropGet(e,"initialize",this,3)([])}},{key:"parsePrimitiveData",value:function(t,i,n,r){for(var a=_superPropGet(e,"parsePrimitiveData",this,3)([t,i,n,r]),o=0;o<a.length;o++)a[o]._custom=this.resolveDataElementOptions(o+n).radius;return a}},{key:"parseArrayData",value:function(t,i,n,r){for(var a=_superPropGet(e,"parseArrayData",this,3)([t,i,n,r]),o=0;o<a.length;o++){var s=i[n+o];a[o]._custom=b(s[2],this.resolveDataElementOptions(o+n).radius)}return a}},{key:"parseObjectData",value:function(t,i,n,r){for(var a=_superPropGet(e,"parseObjectData",this,3)([t,i,n,r]),o=0;o<a.length;o++){var s=i[n+o];a[o]._custom=b(s&&s.r&&+s.r,this.resolveDataElementOptions(o+n).radius)}return a}},{key:"getMaxOverflow",value:function(){for(var t=this._cachedMeta.data,e=0,i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart.data.labels||[],n=e.xScale,r=e.yScale,a=this.getParsed(t),o=n.getLabelForValue(a.x),s=r.getLabelForValue(a.y),l=a._custom;return{label:i[t]||"",value:"("+o+", "+s+(l?", "+l:"")+")"}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var r="reset"===n,a=this._cachedMeta,o=a.iScale,s=a.vScale,l=this._getSharedOptions(e,n),h=l.sharedOptions,u=l.includeOptions,c=o.axis,f=s.axis,d=e;d<e+i;d++){var v=t[d],p=!r&&this.getParsed(d),g={},y=g[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[c]),m=g[f]=r?s.getBasePixel():s.getPixelForValue(p[f]);g.skip=isNaN(y)||isNaN(m),u&&(g.options=h||this.resolveDataElementOptions(d,v.active?"active":n),r&&(g.options.radius=0)),this.updateElement(v,d,g,n)}}},{key:"resolveDataElementOptions",value:function(t,i){var n=this.getParsed(t),r=_superPropGet(e,"resolveDataElementOptions",this,3)([t,i]);r.$shared&&(r=Object.assign({},r,{$shared:!1}));var a=r.radius;return"active"!==i&&(r.radius=0),r.radius+=b(n&&n._custom,a),r}}])}(Kn),_defineProperty(e,"id","bubble"),_defineProperty(e,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),_defineProperty(e,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}}),e),DoughnutController:Gr,LineController:(i=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"initialize",value:function(){this.enableOptionSharing=!0,this.supportsDecimation=!0,_superPropGet(e,"initialize",this,3)([])}},{key:"update",value:function(t){var e=this._cachedMeta,i=e.dataset,n=e.data,r=void 0===n?[]:n,a=e._dataset,o=this.chart._animationsDisabled,s=St(e,r,o),l=s.start,h=s.count;this._drawStart=l,this._drawCount=h,Ct(e)&&(l=0,h=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;var u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},t),this.updateElements(r,l,h,t)}},{key:"updateElements",value:function(t,e,i,n){for(var r="reset"===n,a=this._cachedMeta,o=a.iScale,s=a.vScale,l=a._stacked,h=a._dataset,u=this._getSharedOptions(e,n),c=u.sharedOptions,f=u.includeOptions,d=o.axis,p=s.axis,g=this.options,y=g.spanGaps,m=g.segment,b=Z(y)?y:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===n,x=e+i,k=t.length,w=e>0&&this.getParsed(e-1),M=0;M<k;++M){var P=t[M],S=_?P:{};if(M<e||M>=x)S.skip=!0;else{var C=this.getParsed(M),O=v(C[p]),A=S[d]=o.getPixelForValue(C[d],M),D=S[p]=r||O?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,C,l):C[p],M);S.skip=isNaN(A)||isNaN(D)||O,S.stop=M>0&&Math.abs(C[d]-w[d])>b,m&&(S.parsed=C,S.raw=h.data[M]),f&&(S.options=c||this.resolveDataElementOptions(M,P.active?"active":n)),_||this.updateElement(P,M,S,n),w=C}}}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;var r=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,r,a)/2}},{key:"draw",value:function(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),_superPropGet(e,"draw",this,3)([])}}])}(Kn),_defineProperty(i,"id","line"),_defineProperty(i,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),_defineProperty(i,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),i),PieController:(n=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e)}(Gr),_defineProperty(n,"id","pie"),_defineProperty(n,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),n),PolarAreaController:Kr,RadarController:(r=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}},{key:"parseObjectData",value:function(t,e,i,n){return hi.bind(this)(t,e,i,n)}},{key:"update",value:function(t){var e=this._cachedMeta,i=e.dataset,n=e.data||[],r=e.iScale.getLabels();if(i.points=n,"resize"!==t){var a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);var o={_loop:!0,_fullLoop:r.length===n.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(n,0,n.length,t)}},{key:"updateElements",value:function(t,e,i,n){for(var r=this._cachedMeta.rScale,a="reset"===n,o=e;o<e+i;o++){var s=t[o],l=this.resolveDataElementOptions(o,s.active?"active":n),h=r.getPointPositionForValue(o,this.getParsed(o).r),u=a?r.xCenter:h.x,c=a?r.yCenter:h.y,f={x:u,y:c,angle:h.angle,skip:isNaN(u)||isNaN(c),options:l};this.updateElement(s,o,f,n)}}}])}(Kn),_defineProperty(r,"id","radar"),_defineProperty(r,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),_defineProperty(r,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}}),r),ScatterController:(a=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,i=this.chart.data.labels||[],n=e.xScale,r=e.yScale,a=this.getParsed(t),o=n.getLabelForValue(a.x),s=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+s+")"}}},{key:"update",value:function(t){var e=this._cachedMeta,i=e.data,n=void 0===i?[]:i,r=this.chart._animationsDisabled,a=St(e,n,r),o=a.start,s=a.count;if(this._drawStart=o,this._drawCount=s,Ct(e)&&(o=0,s=n.length),this.options.showLine){this.datasetElementType||this.addElements();var l=e.dataset,h=e._dataset;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!h._decimated,l.points=n;var u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(l,void 0,{animated:!r,options:u},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(n,o,s,t)}},{key:"addElements",value:function(){var t=this.options.showLine;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),_superPropGet(e,"addElements",this,3)([])}},{key:"updateElements",value:function(t,e,i,n){for(var r="reset"===n,a=this._cachedMeta,o=a.iScale,s=a.vScale,l=a._stacked,h=a._dataset,u=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(u),f=this.includeOptions(n,c),d=o.axis,p=s.axis,g=this.options,y=g.spanGaps,m=g.segment,b=Z(y)?y:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||r||"none"===n,x=e>0&&this.getParsed(e-1),k=e;k<e+i;++k){var w=t[k],M=this.getParsed(k),P=_?w:{},S=v(M[p]),C=P[d]=o.getPixelForValue(M[d],k),O=P[p]=r||S?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,M,l):M[p],k);P.skip=isNaN(C)||isNaN(O)||S,P.stop=k>0&&Math.abs(M[d]-x[d])>b,m&&(P.parsed=M,P.raw=h.data[k]),f&&(P.options=c||this.resolveDataElementOptions(k,w.active?"active":n)),_||this.updateElement(w,k,P,n),x=M}this.updateSharedOptions(c,n,u)}},{key:"getMaxOverflow",value:function(){var t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){for(var i=0,n=e.length-1;n>=0;--n)i=Math.max(i,e[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}var r=t.dataset,a=r.options&&r.options.borderWidth||0;if(!e.length)return a;var o=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(a,o,s)/2}}])}(Kn),_defineProperty(a,"id","scatter"),_defineProperty(a,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),_defineProperty(a,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),a)});function Jr(t,e,i,n){return{x:i+t*Math.cos(e),y:n+t*Math.sin(e)}}function Zr(t,e,i,n,r,a){var o=e.x,s=e.y,l=e.startAngle,h=e.pixelMargin,u=e.innerRadius,c=Math.max(e.outerRadius+n+i-h,0),f=u>0?u+n+i+h:0,d=0,v=r-l;if(n){var p=((u>0?u-n:0)+(c>0?c-n:0))/2;d=(v-(0!==p?v*p/(p+n):v))/2}var g=(v-Math.max(.001,v*c-i/B)/c)/2,y=l+g+d,m=r-g-d,b=function(t,e,i,n){var r=Oi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),a=(i-e)/2,o=Math.min(a,n*e/2),s=function(t){var e=(i-Math.min(a,t))*n/2;return ht(t,0,Math.min(a,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:ht(r.innerStart,0,o),innerEnd:ht(r.innerEnd,0,o)}}(e,f,c,m-y),_=b.outerStart,x=b.outerEnd,k=b.innerStart,w=b.innerEnd,M=c-_,P=c-x,S=y+_/M,C=m-x/P,O=f+k,A=f+w,D=y+k/O,T=m-w/A;if(t.beginPath(),a){var I=(S+C)/2;if(t.arc(o,s,c,S,I),t.arc(o,s,c,I,C),x>0){var L=Jr(P,C,o,s);t.arc(L.x,L.y,x,C,m+Y)}var R=Jr(A,m,o,s);if(t.lineTo(R.x,R.y),w>0){var E=Jr(A,T,o,s);t.arc(E.x,E.y,w,m+Y,T+Math.PI)}var F=(m-w/f+(y+k/f))/2;if(t.arc(o,s,f,m-w/f,F,!0),t.arc(o,s,f,F,y+k/f,!0),k>0){var z=Jr(O,D,o,s);t.arc(z.x,z.y,k,D+Math.PI,y-Y)}var V=Jr(M,y,o,s);if(t.lineTo(V.x,V.y),_>0){var H=Jr(M,S,o,s);t.arc(H.x,H.y,_,y-Y,S)}}else{t.moveTo(o,s);var j=Math.cos(S)*c+o,W=Math.sin(S)*c+s;t.lineTo(j,W);var N=Math.cos(C)*c+o,U=Math.sin(C)*c+s;t.lineTo(N,U)}t.closePath()}function Qr(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=b(i.borderCapStyle,e.borderCapStyle),t.setLineDash(b(i.borderDash,e.borderDash)),t.lineDashOffset=b(i.borderDashOffset,e.borderDashOffset),t.lineJoin=b(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=b(i.borderWidth,e.borderWidth),t.strokeStyle=b(i.borderColor,e.borderColor)}function ta(t,e,i){t.lineTo(i.x,i.y)}function ea(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.length,r=i.start,a=void 0===r?0:r,o=i.end,s=void 0===o?n-1:o,l=e.start,h=e.end,u=Math.max(a,l),c=Math.min(s,h),f=a<l&&s<l||a>h&&s>h;return{count:n,start:u,loop:e.loop,ilen:c<u&&!f?n+c-u:c-u}}function ia(t,e,i,n){var r,a,o,s=e.points,l=e.options,h=ea(s,i,n),u=h.count,c=h.start,f=h.loop,d=h.ilen,v=function(t){return t.stepped?Ye:t.tension||"monotone"===t.cubicInterpolationMode?Ue:ta}(l),p=n||{},g=p.move,y=void 0===g||g,m=p.reverse;for(r=0;r<=d;++r)(a=s[(c+(m?d-r:r))%u]).skip||(y?(t.moveTo(a.x,a.y),y=!1):v(t,o,a,m,l.stepped),o=a);return f&&v(t,o,a=s[(c+(m?d:0))%u],m,l.stepped),!!f}function na(t,e,i,n){var r,a,o,s,l,h,u=e.points,c=ea(u,i,n),f=c.count,d=c.start,v=c.ilen,p=n||{},g=p.move,y=void 0===g||g,m=p.reverse,b=0,_=0,x=function(t){return(d+(m?v-t:t))%f},k=function(){s!==l&&(t.lineTo(b,l),t.lineTo(b,s),t.lineTo(b,h))};for(y&&(a=u[x(0)],t.moveTo(a.x,a.y)),r=0;r<=v;++r)if(!(a=u[x(r)]).skip){var w=a.x,M=a.y,P=0|w;P===o?(M<s?s=M:M>l&&(l=M),b=(_*b+w)/++_):(k(),t.lineTo(w,M),o=P,_=0,s=l=M),h=M}k()}function ra(t){var e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?ia:na}var aa="function"==typeof Path2D;var oa=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e)).animated=!0,i.options=void 0,i._chart=void 0,i._loop=void 0,i._fullLoop=void 0,i._path=void 0,i._points=void 0,i._segments=void 0,i._decimated=!1,i._pointsUpdated=!1,i._datasetIndex=void 0,t&&Object.assign(_assertThisInitialized(i),t),i}return _inherits(e,t),_createClass(e,[{key:"updateControlPoints",value:function(t,e){var i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){var n=i.spanGaps?this._loop:this._fullLoop;gi(this._points,i,t,n,e),this._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=Ni(this,this.options.segment))}},{key:"first",value:function(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}},{key:"last",value:function(){var t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}},{key:"interpolate",value:function(t,e){var i=this.options,n=t[e],r=this.points,a=Wi(this,{property:e,start:n,end:n});if(a.length){var o,s,l=[],h=function(t){return t.stepped?ki:t.tension||"monotone"===t.cubicInterpolationMode?wi:xi}(i);for(o=0,s=a.length;o<s;++o){var u=a[o],c=u.start,f=u.end,d=r[c],v=r[f];if(d!==v){var p=h(d,v,Math.abs((n-d[e])/(v[e]-d[e])),i.stepped);p[e]=t[e],l.push(p)}else l.push(d)}return 1===l.length?l[0]:l}}},{key:"pathSegment",value:function(t,e,i){return ra(this)(t,this,e,i)}},{key:"path",value:function(t,e,i){var n=this.segments,r=ra(this),a=this._loop;e=e||0,i=i||this.points.length-e;var o,s=_createForOfIteratorHelper(n);try{for(s.s();!(o=s.n()).done;){a&=r(t,this,o.value,{start:e,end:e+i-1})}}catch(t){s.e(t)}finally{s.f()}return!!a}},{key:"draw",value:function(t,e,i,n){var r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),function(t,e,i,n){aa&&!e.options.segment?function(t,e,i,n){var r=e._path;r||(r=e._path=new Path2D,e.path(r,i,n)&&r.closePath()),Qr(t,e.options),t.stroke(r)}(t,e,i,n):function(t,e,i,n){var r,a=e.segments,o=e.options,s=ra(e),l=_createForOfIteratorHelper(a);try{for(l.s();!(r=l.n()).done;){var h=r.value;Qr(t,o,h.style),t.beginPath(),s(t,e,h,{start:i,end:i+n-1})&&t.closePath(),t.stroke()}}catch(t){l.e(t)}finally{l.f()}}(t,e,i,n)}(t,this,i,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}])}(qn);function sa(t,e,i,n){var r=t.options,a=t.getProps([i],n)[i];return Math.abs(e-a)<r.radius+r.hitRadius}function la(t,e){var i,n,r,a,o,s=t.getProps(["x","y","base","width","height"],e),l=s.x,h=s.y,u=s.base,c=s.width,f=s.height;return t.horizontal?(o=f/2,i=Math.min(l,u),n=Math.max(l,u),r=h-o,a=h+o):(i=l-(o=c/2),n=l+o,r=Math.min(h,u),a=Math.max(h,u)),{left:i,top:r,right:n,bottom:a}}function ha(t,e,i,n){return t?0:ht(e,i,n)}function ua(t){var e=la(t),i=e.right-e.left,n=e.bottom-e.top,r=function(t,e,i){var n=t.options.borderWidth,r=t.borderSkipped,a=Ai(n);return{t:ha(r.top,a.top,0,i),r:ha(r.right,a.right,0,e),b:ha(r.bottom,a.bottom,0,i),l:ha(r.left,a.left,0,e)}}(t,i/2,n/2),a=function(t,e,i){var n=t.getProps(["enableBorderRadius"]).enableBorderRadius,r=t.options.borderRadius,a=Di(r),o=Math.min(e,i),s=t.borderSkipped,l=n||g(r);return{topLeft:ha(!l||s.top||s.left,a.topLeft,0,o),topRight:ha(!l||s.top||s.right,a.topRight,0,o),bottomLeft:ha(!l||s.bottom||s.left,a.bottomLeft,0,o),bottomRight:ha(!l||s.bottom||s.right,a.bottomRight,0,o)}}(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n,radius:a},inner:{x:e.left+r.l,y:e.top+r.t,w:i-r.l-r.r,h:n-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function ca(t,e,i,n){var r=null===e,a=null===i,o=t&&!(r&&a)&&la(t,n);return o&&(r||ct(e,o.left,o.right))&&(a||ct(i,o.top,o.bottom))}function fa(t,e){t.rect(e.x,e.y,e.w,e.h)}function da(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.x!==i.x?-e:0,r=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-n,o=(t.y+t.h!==i.y+i.h?e:0)-r;return{x:t.x+n,y:t.y+r,w:t.w+a,h:t.h+o,radius:t.radius}}_defineProperty(oa,"id","line"),_defineProperty(oa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),_defineProperty(oa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),_defineProperty(oa,"descriptors",{_scriptable:!0,_indexable:function(t){return"borderDash"!==t&&"fill"!==t}});var va=Object.freeze({__proto__:null,ArcElement:(o=function(t){function e(t){var i;return _classCallCheck(this,e),_defineProperty(_assertThisInitialized(i=_callSuper(this,e)),"circumference",void 0),_defineProperty(_assertThisInitialized(i),"endAngle",void 0),_defineProperty(_assertThisInitialized(i),"fullCircles",void 0),_defineProperty(_assertThisInitialized(i),"innerRadius",void 0),_defineProperty(_assertThisInitialized(i),"outerRadius",void 0),_defineProperty(_assertThisInitialized(i),"pixelMargin",void 0),_defineProperty(_assertThisInitialized(i),"startAngle",void 0),i.options=void 0,i.circumference=void 0,i.startAngle=void 0,i.endAngle=void 0,i.innerRadius=void 0,i.outerRadius=void 0,i.pixelMargin=0,i.fullCircles=0,t&&Object.assign(_assertThisInitialized(i),t),i}return _inherits(e,t),_createClass(e,[{key:"inRange",value:function(t,e,i){var n=rt(this.getProps(["x","y"],i),{x:t,y:e}),r=n.angle,a=n.distance,o=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),s=o.startAngle,l=o.endAngle,h=o.innerRadius,u=o.outerRadius,c=o.circumference,f=(this.options.spacing+this.options.borderWidth)/2,d=b(c,l-s),v=lt(r,s,l)&&s!==l,p=d>=H||v,g=ct(a,h+f,u+f);return p&&g}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),i=e.x,n=e.y,r=e.startAngle,a=e.endAngle,o=e.innerRadius,s=e.outerRadius,l=this.options,h=l.offset,u=(r+a)/2,c=(o+s+l.spacing+h)/2;return{x:i+Math.cos(u)*c,y:n+Math.sin(u)*c}}},{key:"tooltipPosition",value:function(t){return this.getCenterPoint(t)}},{key:"draw",value:function(t){var e=this.options,i=this.circumference,n=(e.offset||0)/4,r=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>H?Math.floor(i/H):0,!(0===i||this.innerRadius<0||this.outerRadius<0)){t.save();var o=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(o)*n,Math.sin(o)*n);var s=n*(1-Math.sin(Math.min(B,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,n,r){var a=e.fullCircles,o=e.startAngle,s=e.circumference,l=e.endAngle;if(a){Zr(t,e,i,n,l,r);for(var h=0;h<a;++h)t.fill();isNaN(s)||(l=o+(s%H||H))}Zr(t,e,i,n,l,r),t.fill()}(t,this,s,r,a),function(t,e,i,n,r){var a=e.fullCircles,o=e.startAngle,s=e.circumference,l=e.options,h=l.borderWidth,u=l.borderJoinStyle,c=l.borderDash,f=l.borderDashOffset,d=l.borderRadius,v="inner"===l.borderAlign;if(h){t.setLineDash(c||[]),t.lineDashOffset=f,v?(t.lineWidth=2*h,t.lineJoin=u||"round"):(t.lineWidth=h,t.lineJoin=u||"bevel");var p=e.endAngle;if(a){Zr(t,e,i,n,p,r);for(var g=0;g<a;++g)t.stroke();isNaN(s)||(p=o+(s%H||H))}v&&function(t,e,i){var n=e.startAngle,r=e.pixelMargin,a=e.x,o=e.y,s=e.outerRadius,l=e.innerRadius,h=r/s;t.beginPath(),t.arc(a,o,s,n-h,i+h),l>r?(h=r/l,t.arc(a,o,l,i+h,n-h,!0)):t.arc(a,o,r,i+Y,n-Y),t.closePath(),t.clip()}(t,e,p),l.selfJoin&&p-o>=B&&0===d&&"miter"!==u&&function(t,e,i){var n=e.startAngle,r=e.x,a=e.y,o=e.outerRadius,s=e.innerRadius,l=e.options,h=l.borderWidth,u=l.borderJoinStyle,c=Math.min(h/o,st(n-i));if(t.beginPath(),t.arc(r,a,o-h/2,n+c/2,i-c/2),s>0){var f=Math.min(h/s,st(n-i));t.arc(r,a,s+h/2,i-f/2,n+f/2,!0)}else{var d=Math.min(h/2,o*st(n-i));if("round"===u)t.arc(r,a,d,i-B/2,n+B/2,!0);else if("bevel"===u){var v=2*d*d,p=-v*Math.cos(i+B/2)+r,g=-v*Math.sin(i+B/2)+a,y=v*Math.cos(n+B/2)+r,m=v*Math.sin(n+B/2)+a;t.lineTo(p,g),t.lineTo(y,m)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,p),a||(Zr(t,e,i,n,p,r),t.stroke())}}(t,this,s,r,a),t.restore()}}}])}(qn),_defineProperty(o,"id","arc"),_defineProperty(o,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),_defineProperty(o,"defaultRoutes",{backgroundColor:"backgroundColor"}),_defineProperty(o,"descriptors",{_scriptable:!0,_indexable:function(t){return"borderDash"!==t}}),o),BarElement:(s=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e)).options=void 0,i.horizontal=void 0,i.base=void 0,i.width=void 0,i.height=void 0,i.inflateAmount=void 0,t&&Object.assign(_assertThisInitialized(i),t),i}return _inherits(e,t),_createClass(e,[{key:"draw",value:function(t){var e,i=this.inflateAmount,n=this.options,r=n.borderColor,a=n.backgroundColor,o=ua(this),s=o.inner,l=o.outer,h=(e=l.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?Ke:fa;t.save(),l.w===s.w&&l.h===s.h||(t.beginPath(),h(t,da(l,i,s)),t.clip(),h(t,da(s,-i,l)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),h(t,da(s,i)),t.fillStyle=a,t.fill(),t.restore()}},{key:"inRange",value:function(t,e,i){return ca(this,t,e,i)}},{key:"inXRange",value:function(t,e){return ca(this,t,null,e)}},{key:"inYRange",value:function(t,e){return ca(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","base","horizontal"],t),i=e.x,n=e.y,r=e.base,a=e.horizontal;return{x:a?(i+r)/2:i,y:a?n:(n+r)/2}}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}])}(qn),_defineProperty(s,"id","bar"),_defineProperty(s,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),_defineProperty(s,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),s),LineElement:oa,PointElement:(l=function(t){function e(t){var i;return _classCallCheck(this,e),_defineProperty(_assertThisInitialized(i=_callSuper(this,e)),"parsed",void 0),_defineProperty(_assertThisInitialized(i),"skip",void 0),_defineProperty(_assertThisInitialized(i),"stop",void 0),_assertThisInitialized(i),i.options=void 0,i.parsed=void 0,i.skip=void 0,i.stop=void 0,t&&Object.assign(_assertThisInitialized(i),t),i}return _inherits(e,t),_createClass(e,[{key:"inRange",value:function(t,e,i){var n=this.options,r=this.getProps(["x","y"],i),a=r.x,o=r.y;return Math.pow(t-a,2)+Math.pow(e-o,2)<Math.pow(n.hitRadius+n.radius,2)}},{key:"inXRange",value:function(t,e){return sa(this,t,"x",e)}},{key:"inYRange",value:function(t,e){return sa(this,t,"y",e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"size",value:function(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}},{key:"draw",value:function(t,e){var i=this.options;this.skip||i.radius<.1||!je(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Be(t,i,this.x,this.y))}},{key:"getRange",value:function(){var t=this.options||{};return t.radius+t.hitRadius}}])}(qn),_defineProperty(l,"id","point"),_defineProperty(l,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),_defineProperty(l,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),l)});function pa(t){var e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function ga(t,e,i){var n=i.horizontal,r=et(i.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,o=.75*e*(""+t).length;return Math.min(e/a,o)}var ya=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t])).start=void 0,i.end=void 0,i._startValue=void 0,i._endValue=void 0,i._valueRange=0,i}return _inherits(e,t),_createClass(e,[{key:"parse",value:function(t,e){return v(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}},{key:"handleTickRangeOptions",value:function(){var t=this.options.beginAtZero,e=this.getUserBounds(),i=e.minDefined,n=e.maxDefined,r=this.min,a=this.max,o=function(t){return r=i?r:t},s=function(t){return a=n?a:t};if(t){var l=G(r),h=G(a);l<0&&h<0?s(0):l>0&&h>0&&o(0)}if(r===a){var u=0===a?1:Math.abs(.05*a);s(a+u),t||o(r-u)}this.min=r,this.max=a}},{key:"getTickLimit",value:function(){var t,e=this.options.ticks,i=e.maxTicksLimit,n=e.stepSize;return n?(t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1)>1e3&&(console.warn("scales.".concat(this.id,".ticks.stepSize: ").concat(n," would result generating up to ").concat(t," ticks. Limiting to 1000.")),t=1e3):(t=this.computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var t=this.options,e=t.ticks,i=this.getTickLimit(),n=function(t,e){var i,n,r,a,o=[],s=t.bounds,l=t.step,h=t.min,u=t.max,c=t.precision,f=t.count,d=t.maxTicks,p=t.maxDigits,g=t.includeBounds,y=l||1,m=d-1,b=e.min,_=e.max,x=!v(h),k=!v(u),w=!v(f),M=(_-b)/(p+1),P=q((_-b)/m/y)*y;if(P<1e-14&&!x&&!k)return[{value:b},{value:_}];(a=Math.ceil(_/P)-Math.floor(b/P))>m&&(P=q(a*P/m/y)*y),v(c)||(i=Math.pow(10,c),P=Math.ceil(P*i)/i),"ticks"===s?(n=Math.floor(b/P)*P,r=Math.ceil(_/P)*P):(n=b,r=_),x&&k&&l&&Q((u-h)/l,P/1e3)?(P=(u-h)/(a=Math.round(Math.min((u-h)/P,d))),n=h,r=u):w?P=((r=k?u:r)-(n=x?h:n))/(a=f-1):a=K(a=(r-n)/P,Math.round(a),P/1e3)?Math.round(a):Math.ceil(a);var S=Math.max(nt(P),nt(n));i=Math.pow(10,v(c)?S:c),n=Math.round(n*i)/i,r=Math.round(r*i)/i;var C=0;for(x&&(g&&n!==h?(o.push({value:h}),n<h&&C++,K(Math.round((n+C*P)*i)/i,h,ga(h,M,t))&&C++):n<h&&C++);C<a;++C){var O=Math.round((n+C*P)*i)/i;if(k&&O>u)break;o.push({value:O})}return k&&g&&r!==u?o.length&&K(o[o.length-1].value,u,ga(u,M,t))?o[o.length-1].value=u:o.push({value:u}):k&&r!==u||o.push({value:r}),o}({maxTicks:i=Math.max(2,i),bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&tt(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}},{key:"configure",value:function(){var t=this.ticks,i=this.min,n=this.max;if(_superPropGet(e,"configure",this,3)([]),this.options.offset&&t.length){var r=(n-i)/Math.max(t.length-1,1)/2;i-=r,n+=r}this._startValue=i,this._endValue=n,this._valueRange=n-i}},{key:"getLabelForValue",value:function(t){return fe(t,this.chart.options.locale,this.options.ticks.format)}}])}(or),ma=function(t){function e(){return _classCallCheck(this,e),_callSuper(this,e,arguments)}return _inherits(e,t),_createClass(e,[{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=y(e)?e:0,this.max=y(i)?i:1,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var t=this.isHorizontal(),e=t?this.width:this.height,i=et(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/n))}},{key:"getPixelForValue",value:function(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}])}(ya);_defineProperty(ma,"id","linear"),_defineProperty(ma,"defaults",{ticks:{callback:ve.formatters.numeric}});var ba=function(t){return Math.floor(X(t))},_a=function(t,e){return Math.pow(10,ba(t)+e)};function xa(t){return 1===t/Math.pow(10,ba(t))}function ka(t,e,i){var n=Math.pow(10,i),r=Math.floor(t/n);return Math.ceil(e/n)-r}var wa=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t])).start=void 0,i.end=void 0,i._startValue=void 0,i._valueRange=0,i}return _inherits(e,t),_createClass(e,[{key:"parse",value:function(t,e){var i=ya.prototype.parse.apply(this,[t,e]);if(0!==i)return y(i)&&i>0?i:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!0),e=t.min,i=t.max;this.min=y(e)?Math.max(0,e):null,this.max=y(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!y(this._userMin)&&(this.min=e===_a(this.min,0)?_a(this.min,-1):_a(this.min,0)),this.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.min,r=this.max,a=function(t){return n=e?n:t},o=function(t){return r=i?r:t};n===r&&(n<=0?(a(1),o(10)):(a(_a(n,-1)),o(_a(r,1)))),n<=0&&a(_a(r,-1)),r<=0&&o(_a(n,1)),this.min=n,this.max=r}},{key:"buildTicks",value:function(){var t=this.options,e=function(t,e){var i=e.min,n=e.max;i=m(t.min,i);for(var r=[],a=ba(i),o=function(t,e){for(var i=ba(e-t);ka(t,e,i)>10;)i++;for(;ka(t,e,i)<10;)i--;return Math.min(i,ba(t))}(i,n),s=o<0?Math.pow(10,Math.abs(o)):1,l=Math.pow(10,o),h=a>o?Math.pow(10,a):0,u=Math.round((i-h)*s)/s,c=Math.floor((i-h)/l/10)*l*10,f=Math.floor((u-c)/Math.pow(10,o)),d=m(t.min,Math.round((h+c+f*Math.pow(10,o))*s)/s);d<n;)r.push({value:d,major:xa(d),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(f=2,s=++o>=0?1:s),d=Math.round((h+c+f*Math.pow(10,o))*s)/s;var v=m(t.max,d);return r.push({value:v,major:xa(v),significand:f}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&tt(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}},{key:"getLabelForValue",value:function(t){return void 0===t?"0":fe(t,this.chart.options.locale,this.options.ticks.format)}},{key:"configure",value:function(){var t=this.min;_superPropGet(e,"configure",this,3)([]),this._startValue=X(t),this._valueRange=X(this.max)-X(t)}},{key:"getPixelForValue",value:function(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(X(t)-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){var e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}])}(or);function Ma(t){var e=t.ticks;if(e.display&&t.display){var i=Ti(e.backdropPadding);return b(e.font&&e.font.size,_e.font.size)+i.height}return 0}function Pa(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i,end:e}:{start:e,end:e+i}}function Sa(t,e,i,n,r){var a=Math.abs(Math.sin(i)),o=Math.abs(Math.cos(i)),s=0,l=0;n.start<e.l?(s=(e.l-n.start)/a,t.l=Math.min(t.l,e.l-s)):n.end>e.r&&(s=(n.end-e.r)/a,t.r=Math.max(t.r,e.r+s)),r.start<e.t?(l=(e.t-r.start)/o,t.t=Math.min(t.t,e.t-l)):r.end>e.b&&(l=(r.end-e.b)/o,t.b=Math.max(t.b,e.b+l))}function Ca(t,e,i){var n=t.drawingArea,r=i.extra,a=i.additionalAngle,o=i.padding,s=i.size,l=t.getPointPosition(e,n+r+o,a),h=Math.round(it(st(l.angle+Y))),u=function(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}(l.y,s.h,h),c=function(t){return 0===t||180===t?"center":t<180?"left":"right"}(h),f=function(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}(l.x,s.w,c);return{visible:!0,x:l.x,y:u,textAlign:c,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Oa(t,e){if(!e)return!0;var i=t.left,n=t.top,r=t.right,a=t.bottom;return!(je({x:i,y:n},e)||je({x:i,y:a},e)||je({x:r,y:n},e)||je({x:r,y:a},e))}function Aa(t,e,i){var n=i.left,r=i.top,a=i.right,o=i.bottom,s=e.backdropColor;if(!v(s)){var l=Di(e.borderRadius),h=Ti(e.backdropPadding);t.fillStyle=s;var u=n-h.left,c=r-h.top,f=a-n+h.width,d=o-r+h.height;Object.values(l).some(function(t){return 0!==t})?(t.beginPath(),Ke(t,{x:u,y:c,w:f,h:d,radius:l}),t.fill()):t.fillRect(u,c,f,d)}}function Da(t,e,i,n){var r=t.ctx;if(i)r.arc(t.xCenter,t.yCenter,e,0,H);else{var a=t.getPointPosition(0,e);r.moveTo(a.x,a.y);for(var o=1;o<n;o++)a=t.getPointPosition(o,e),r.lineTo(a.x,a.y)}}_defineProperty(wa,"id","logarithmic"),_defineProperty(wa,"defaults",{ticks:{callback:ve.formatters.logarithmic,major:{enabled:!0}}});var Ta=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t])).xCenter=void 0,i.yCenter=void 0,i.drawingArea=void 0,i._pointLabels=[],i._pointLabelItems=[],i}return _inherits(e,t),_createClass(e,[{key:"setDimensions",value:function(){var t=this._padding=Ti(Ma(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}},{key:"determineDataLimits",value:function(){var t=this.getMinMax(!1),e=t.min,i=t.max;this.min=y(e)&&!isNaN(e)?e:0,this.max=y(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/Ma(this.options))}},{key:"generateTickLabels",value:function(t){var e=this;ya.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(function(t,i){var n=k(e.options.pointLabels.callback,[t,i],e);return n||0===n?n:""}).filter(function(t,i){return e.chart.getDataVisibility(i)})}},{key:"fit",value:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){for(var e,i,n,r={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},a=Object.assign({},r),o=[],s=[],l=t._pointLabels.length,h=t.options.pointLabels,u=h.centerPointLabels?B/l:0,c=0;c<l;c++){var f=h.setContext(t.getPointLabelContext(c));s[c]=f.padding;var d=t.getPointPosition(c,t.drawingArea+s[c],u),v=Ii(f.font),g=(e=t.ctx,i=v,n=p(n=t._pointLabels[c])?n:[n],{w:Fe(e,i.string,n),h:n.length*i.lineHeight});o[c]=g;var y=st(t.getIndexAngle(c)+u),m=Math.round(it(y));Sa(a,r,y,Pa(m,d.x,g.w,0,180),Pa(m,d.y,g.h,90,270))}t.setCenterPoint(r.l-a.l,a.r-r.r,r.t-a.t,a.b-r.b),t._pointLabelItems=function(t,e,i){for(var n,r=[],a=t._pointLabels.length,o=t.options,s=o.pointLabels,l=s.centerPointLabels,h=s.display,u={extra:Ma(o)/2,additionalAngle:l?B/a:0},c=0;c<a;c++){u.padding=i[c],u.size=e[c];var f=Ca(t,c,u);r.push(f),"auto"===h&&(f.visible=Oa(f,n),f.visible&&(n=f))}return r}(t,o,s)}(this):this.setCenterPoint(0,0,0,0)}},{key:"setCenterPoint",value:function(t,e,i,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,n))}},{key:"getIndexAngle",value:function(t){return st(t*(H/(this._pointLabels.length||1))+et(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(t){if(v(t))return NaN;var e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}},{key:"getValueForDistanceFromCenter",value:function(t){if(v(t))return NaN;var e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}},{key:"getPointLabelContext",value:function(t){var e=this._pointLabels||[];if(t>=0&&t<e.length){var i=e[t];return function(t,e,i){return Ei(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}},{key:"getPointPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.getIndexAngle(t)-Y+i;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}},{key:"getPointPositionForValue",value:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}},{key:"getBasePosition",value:function(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}},{key:"drawBackground",value:function(){var t=this.options,e=t.backgroundColor,i=t.grid.circular;if(e){var n=this.ctx;n.save(),n.beginPath(),Da(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}},{key:"drawGrid",value:function(){var t,e,i,n=this,r=this.ctx,a=this.options,o=a.angleLines,s=a.grid,l=a.border,h=this._pointLabels.length;if(a.pointLabels.display&&function(t,e){for(var i=t.ctx,n=t.options.pointLabels,r=e-1;r>=0;r--){var a=t._pointLabelItems[r];if(a.visible){var o=n.setContext(t.getPointLabelContext(r));Aa(i,o,a);var s=Ii(o.font),l=a.x,h=a.y,u=a.textAlign;Ge(i,t._pointLabels[r],l,h+s.lineHeight/2,s,{color:o.color,textAlign:u,textBaseline:"middle"})}}}(this,h),s.display&&this.ticks.forEach(function(t,i){if(0!==i||0===i&&n.min<0){e=n.getDistanceFromCenterForValue(t.value);var r=n.getContext(i),a=s.setContext(r),o=l.setContext(r);!function(t,e,i,n,r){var a=t.ctx,o=e.circular,s=e.color,l=e.lineWidth;!o&&!n||!s||!l||i<0||(a.save(),a.strokeStyle=s,a.lineWidth=l,a.setLineDash(r.dash||[]),a.lineDashOffset=r.dashOffset,a.beginPath(),Da(t,i,o,n),a.closePath(),a.stroke(),a.restore())}(n,a,e,h,o)}}),o.display){for(r.save(),t=h-1;t>=0;t--){var u=o.setContext(this.getPointLabelContext(t)),c=u.color,f=u.lineWidth;f&&c&&(r.lineWidth=f,r.strokeStyle=c,r.setLineDash(u.borderDash),r.lineDashOffset=u.borderDashOffset,e=this.getDistanceFromCenterForValue(a.reverse?this.min:this.max),i=this.getPointPosition(t,e),r.beginPath(),r.moveTo(this.xCenter,this.yCenter),r.lineTo(i.x,i.y),r.stroke())}r.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var t=this,e=this.ctx,i=this.options,n=i.ticks;if(n.display){var r,a,o=this.getIndexAngle(0);e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(function(o,s){if(!(0===s&&t.min>=0)||i.reverse){var l=n.setContext(t.getContext(s)),h=Ii(l.font);if(r=t.getDistanceFromCenterForValue(t.ticks[s].value),l.showLabelBackdrop){e.font=h.string,a=e.measureText(o.label).width,e.fillStyle=l.backdropColor;var u=Ti(l.backdropPadding);e.fillRect(-a/2-u.left,-r-h.size/2-u.top,a+u.width,h.size+u.height)}Ge(e,o.label,0,-r,h,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}}),e.restore()}}},{key:"drawTitle",value:function(){}}])}(ya);_defineProperty(Ta,"id","radialLinear"),_defineProperty(Ta,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ve.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(t){return t},padding:5,centerPointLabels:!1}}),_defineProperty(Ta,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),_defineProperty(Ta,"descriptors",{angleLines:{_fallback:"grid"}});var Ia={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}},La=Object.keys(Ia);function Ra(t,e){return t-e}function Ea(t,e){if(v(e))return null;var i=t._adapter,n=t._parseOpts,r=n.parser,a=n.round,o=n.isoWeekday,s=e;return"function"==typeof r&&(s=r(s)),y(s)||(s="string"==typeof r?i.parse(s,r):i.parse(s)),null===s?null:(a&&(s="week"!==a||!Z(o)&&!0!==o?i.startOf(s,a):i.startOf(s,"isoWeek",o)),+s)}function Fa(t,e,i,n){for(var r=La.length,a=La.indexOf(t);a<r-1;++a){var o=Ia[La[a]],s=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((i-e)/(s*o.size))<=n)return La[a]}return La[r-1]}function za(t,e,i){if(i){if(i.length){var n=ft(i,e),r=n.lo,a=n.hi;t[i[r]>=e?i[r]:i[a]]=!0}}else t[e]=!0}function Va(t,e,i){var n,r,a=[],o={},s=e.length;for(n=0;n<s;++n)o[r=e[n]]=n,a.push({value:r,major:!1});return 0!==s&&i?function(t,e,i,n){var r,a,o=t._adapter,s=+o.startOf(e[0].value,n),l=e[e.length-1].value;for(r=s;r<=l;r=+o.add(r,1,n))(a=i[r])>=0&&(e[a].major=!0);return e}(t,a,o,i):a}var Ba=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t]))._cache={data:[],labels:[],all:[]},i._unit="day",i._majorUnit=void 0,i._offsets={},i._normalized=!1,i._parseOpts=void 0,i}return _inherits(e,t),_createClass(e,[{key:"init",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.time||(t.time={}),r=this._adapter=new Br._date(t.adapters.date);r.init(i),A(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},_superPropGet(e,"init",this,3)([t]),this._normalized=i.normalized}},{key:"parse",value:function(t,e){return void 0===t?null:Ea(this,t)}},{key:"beforeLayout",value:function(){_superPropGet(e,"beforeLayout",this,3)([]),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var t=this.options,e=this._adapter,i=t.time.unit||"day",n=this.getUserBounds(),r=n.min,a=n.max,o=n.minDefined,s=n.maxDefined;function l(t){o||isNaN(t.min)||(r=Math.min(r,t.min)),s||isNaN(t.max)||(a=Math.max(a,t.max))}o&&s||(l(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||l(this.getMinMax(!1))),r=y(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=y(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}},{key:"_getLabelBounds",value:function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}},{key:"buildTicks",value:function(){var t=this.options,e=t.time,i=t.ticks,n="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);var r=this.min,a=pt(n,r,this.max);return this._unit=e.unit||(i.autoSkip?Fa(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,i,n,r){for(var a=La.length-1;a>=La.indexOf(i);a--){var o=La[a];if(Ia[o].common&&t._adapter.diff(r,n,o)>=e-1)return o}return La[i?La.indexOf(i):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(var e=La.indexOf(t)+1,i=La.length;e<i;++e)if(Ia[La[e]].common)return La[e]}(this._unit):void 0,this.initOffsets(n),t.reverse&&a.reverse(),Va(this,a,this._majorUnit)}},{key:"afterAutoSkip",value:function(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(function(t){return+t.value}))}},{key:"initOffsets",value:function(){var t,e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=0,r=0;this.options.offset&&i.length&&(t=this.getDecimalForValue(i[0]),n=1===i.length?1-t:(this.getDecimalForValue(i[1])-t)/2,e=this.getDecimalForValue(i[i.length-1]),r=1===i.length?e:(e-this.getDecimalForValue(i[i.length-2]))/2);var a=i.length<3?.5:.25;n=ht(n,0,a),r=ht(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}},{key:"_generate",value:function(){var t,e,i=this._adapter,n=this.min,r=this.max,a=this.options,o=a.time,s=o.unit||Fa(o.minUnit,n,r,this._getLabelCapacity(n)),l=b(a.ticks.stepSize,1),h="week"===s&&o.isoWeekday,u=Z(h)||!0===h,c={},f=n;if(u&&(f=+i.startOf(f,"isoWeek",h)),f=+i.startOf(f,u?"day":s),i.diff(r,n,s)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+s);var d="data"===a.ticks.source&&this.getDataTimestamps();for(t=f,e=0;t<r;t=+i.add(t,l,s),e++)za(c,t,d);return t!==r&&"ticks"!==a.bounds&&1!==e||za(c,t,d),Object.keys(c).sort(Ra).map(function(t){return+t})}},{key:"getLabelForValue",value:function(t){var e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}},{key:"format",value:function(t,e){var i=this.options.time.displayFormats,n=this._unit,r=e||i[n];return this._adapter.format(t,r)}},{key:"_tickFormatFunction",value:function(t,e,i,n){var r=this.options,a=r.ticks.callback;if(a)return k(a,[t,e,i],this);var o=r.time.displayFormats,s=this._unit,l=this._majorUnit,h=s&&o[s],u=l&&o[l],c=i[e],f=l&&u&&c&&c.major;return this._adapter.format(t,n||(f?u:h))}},{key:"generateTickLabels",value:function(t){var e,i,n;for(e=0,i=t.length;e<i;++e)(n=t[e]).label=this._tickFormatFunction(n.value,e,t)}},{key:"getDecimalForValue",value:function(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}},{key:"getPixelForValue",value:function(t){var e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}},{key:"getValueForPixel",value:function(t){var e=this._offsets,i=this.getDecimalFo0}ЅZЅvar e=this.options.ticks,i=this.ctx.measureText(t).width,n=et(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(n),a=Math.sin(n),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}},{key:"_getLabelCapacity",value:function(t){var e=this.options.time,i=e.displayFormats,n=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Va(this,[t],this._majorUnit),n),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}},{key:"getDataTimestamps",value:function(){var t,e,i=this._cache.data||[];if(i.length)return i;var n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t<e;++t)i=i.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}},{key:"getLabelTimestamps",value:function(){var t,e,i=this._cache.labels||[];if(i.length)return i;var n=this.getLabels();for(t=0,e=n.length;t<e;++t)i.push(Ea(this,n[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}},{key:"normalize",value:function(t){return bt(t.sort(Ra))}}])}(or);function Ha(t,e,i){var n,r,a,o,s,l,h,u,c,f,d=0,v=t.length-1;i?(e>=t[d].pos&&e<=t[v].pos&&(d=(n=dt(t,"pos",e)).lo,v=n.hi),h=(r=t[d]).pos,c=r.time,u=(a=t[v]).pos,f=a.time):(e>=t[d].time&&e<=t[v].time&&(d=(o=dt(t,"time",e)).lo,v=o.hi),h=(s=t[d]).time,c=s.pos,u=(l=t[v]).time,f=l.pos);var p=u-h;return p?c+(f-c)*(e-h)/p:c}_defineProperty(Ba,"id","time"),_defineProperty(Ba,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});var ja=Object.freeze({__proto__:null,CategoryScale:(h=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t]))._startValue=void 0,i._valueRange=0,i._addedLabels=[],i}return _inherits(e,t),_createClass(e,[{key:"init",value:function(t){var i=this._addedLabels;if(i.length){var n,r=this.getLabels(),a=_createForOfIteratorHelper(i);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=o.index,l=o.label;r[s]===l&&r.splice(s,1)}}catch(t){a.e(t)}finally{a.f()}this._addedLabels=[]}_superPropGet(e,"init",this,3)([t])}},{key:"parse",value:function(t,e){if(v(t))return null;var i=this.getLabels();return function(t,e){return null===t?null:ht(Math.round(t),0,e)}(e=isFinite(e)&&i[e]===t?e:function(t,e,i,n){var r=t.indexOf(e);return-1===r?function(t,e,i,n){return"string"==typeof e?(i=t.push(e)-1,n.unshift({index:i,label:e})):isNaN(e)&&(i=null),i}(t,e,i,n):r!==t.lastIndexOf(e)?i:r}(i,t,b(e,t),this._addedLabels),i.length-1)}},{key:"determineDataLimits",value:function(){var t=this.getUserBounds(),e=t.minDefined,i=t.maxDefined,n=this.getMinMax(!0),r=n.min,a=n.max;"ticks"===this.options.bounds&&(e||(r=0),i||(a=this.getLabels().length-1)),this.min=r,this.max=a}},{key:"buildTicks",value:function(){var t=this.min,e=this.max,i=this.options.offset,n=[],r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(var a=t;a<=e;a++)n.push({value:a});return n}},{key:"getLabelForValue",value:function(t){return pa.call(this,t)}},{key:"configure",value:function(){_superPropGet(e,"configure",this,3)([]),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}},{key:"getPixelForValue",value:function(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getValueForPixel",value:function(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}])}(or),_defineProperty(h,"id","category"),_defineProperty(h,"defaults",{ticks:{callback:pa}}),h),LinearScale:ma,LogarithmicScale:wa,RadialLinearScale:Ta,TimeScale:Ba,TimeSeriesScale:(u=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e,[t]))._table=[],i._minPos=void 0,i._tableRange=void 0,i}return _inherits(e,t),_createClass(e,[{key:"initOffsets",value:function(){var t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Ha(i,this.min),this._tableRange=Ha(i,this.max)-this._minPos,_superPropGet(e,"initOffsets",this,3)([t])}},{key:"buildLookupTable",value:function(t){var e,i,n,r,a,o=this.min,s=this.max,l=[],h=[];for(e=0,i=t.length;e<i;++e)(r=t[e])>=o&&r<=s&&l.push(r);if(l.length<2)return[{time:o,pos:0},{time:s,pos:1}];for(e=0,i=l.length;e<i;++e)a=l[e+1],n=l[e-1],r=l[e],Math.round((a+n)/2)!==r&&h.push({time:r,pos:e/(i-1)});return h}},{key:"_generate",value:function(){var t=this.min,i=this.max,n=_superPropGet(e,"getDataTimestamps",this,3)([]);return n.includes(t)&&n.length||n.splice(0,0,t),n.includes(i)&&1!==n.length||n.push(i),n.sort(function(t,e){return t-e})}},{key:"_getTimestampsForTable",value:function(){var t=this._cache.all||[];if(t.length)return t;var e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}},{key:"getDecimalForValue",value:function(t){return(Ha(this._table,t)-this._minPos)/this._tableRange}},{key:"getValueForPixel",value:function(t){var e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ha(this._table,i*this._tableRange+this._minPos,!0)}}])}(Ba),_defineProperty(u,"id","timeseries"),_defineProperty(u,"defaults",Ba.defaults),u)}),Wa=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Na=Wa.map(function(t){return t.replace("rgb(","rgba(").replace(")",", 0.5)")});function Ya(t){return Wa[t%Wa.length]}function Ua(t){return Na[t%Na.length]}function $a(t){var e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}var Xa={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout:function(t,e,i){if(i.enabled){var n,r=t.config,a=r.data.datasets,o=r.options,s=o.elements,l=$a(a)||(n=o)&&(n.borderColor||n.backgroundColor)||s&&$a(s)||"rgba(0,0,0,0.1)"!==_e.borderColor||"rgba(0,0,0,0.1)"!==_e.backgroundColor;if(i.forceOverride||!l){var h=function(t){var e=0;return function(i,n){var r=t.getDatasetMeta(n).controller;r instanceof Gr?e=function(t,e){return t.backgroundColor=t.data.map(function(){return Ya(e++)}),e}(i,e):r instanceof Kr?e=function(t,e){return t.backgroundColor=t.data.map(function(){return Ua(e++)}),e}(i,e):r&&(e=function(t,e){return t.borderColor=Ya(e),t.backgroundColor=Ua(e),++e}(i,e))}}(t);a.forEach(h)}}}};function Ga(t){if(t._decimated){var e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function Ka(t){t.data.datasets.forEach(function(t){Ga(t)})}var qa={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(t,e,i){if(i.enabled){var n=t.width;t.data.datasets.forEach(function(e,r){var a=e._data,o=e.indexAxis,s=t.getDatasetMeta(r),l=a||e.data;if("y"!==Li([o,t.options.indexAxis])&&s.controller.supportsDecimation){var h=t.scales[s.xAxisID];if(("linear"===h.type||"time"===h.type)&&!t.options.parsing){var u=function(t,e){var i=e.length,n=0,r=t.iScale,a=r.getUserBounds(),o=a.min,s=a.max,l=a.minDefined,h=a.maxDefined;return l&&(n=ht(dt(e,r.axis,o).lo,0,i-1)),{start:n,count:h?ht(dt(e,r.axis,s).hi+1,n,i)-n:i-n}}(s,l),c=u.start,f=u.count;if(f<=(i.threshold||4*n))Ga(e);else{var d;switch(v(a)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":d=function(t,e,i,n,r){var a=r.samples||n;if(a>=i)return t.slice(e,e+i);var o,s,l,h,u,c=[],f=(i-2)/(a-2),d=0,v=e+i-1,p=e;for(c[d++]=t[p],o=0;o<a-2;o++){var g=void 0,y=0,m=0,b=Math.floor((o+1)*f)+1+e,_=Math.min(Math.floor((o+2)*f)+1,i)+e,x=_-b;for(g=b;g<_;g++)y+=t[g].x,m+=t[g].y;y/=x,m/=x;var k=Math.floor(o*f)+1+e,w=Math.min(Math.floor((o+1)*f)+1,i)+e,M=t[p],P=M.x,S=M.y;for(l=h=-1,g=k;g<w;g++)(h=.5*Math.abs((P-y)*(t[g].y-S)-(P-t[g].x)*(m-S)))>l&&(l=h,s=t[g],u=g);c[d++]=s,p=u}return c[d++]=t[v],c}(l,c,f,n,i);break;case"min-max":d=function(t,e,i,n){var r,a,o,s,l,h,u,c,f,d,p=0,g=0,y=[],m=e+i-1,b=t[e].x,_=t[m].x-b;for(r=e;r<e+i;++r){o=((a=t[r]).x-b)/_*n,s=a.y;var x=0|o;if(x===l)s<f?(f=s,h=r):s>d&&(d=s,u=r),p=(g*p+a.x)/++g;else{var k=r-1;if(!v(h)&&!v(u)){var w=Math.min(h,u),M=Math.max(h,u);w!==c&&w!==k&&y.push(_objectSpread(_objectSpread({},t[w]),{},{x:p})),M!==c&&M!==k&&y.push(_objectSpread(_objectSpread({},t[M]),{},{x:p}))}r>0&&k!==c&&y.push(t[k]),y.push(a),l=x,g=0,f=d=s,h=u=c=r}}return y}(l,c,f,n);break;default:throw new Error("Unsupported decimation algorithm '".concat(i.algorithm,"'"))}e._decimated=d}}}})}else Ka(t)},destroy:function(t){Ka(t)}};function Ja(t,e,i,n){if(!n){var r=e[t],a=i[t];return"angle"===t&&(r=st(r),a=st(a)),{property:t,start:r,end:a}}}function Za(t,e,i){for(;e>t;e--){var n=i[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function Qa(t,e,i,n){return t&&e?n(t[i],e[i]):t?t[i]:e?e[i]:0}function to(t,e){var i=[],n=!1;return p(t)?(n=!0,i=t):i=function(t,e){var i=t||{},n=i.x,r=void 0===n?null:n,a=i.y,o=void 0===a?null:a,s=e.points,l=[];return e.segments.forEach(function(t){var e=t.start,i=t.end;i=Za(e,i,s);var n=s[e],a=s[i];null!==o?(l.push({x:n.x,y:o}),l.push({x:a.x,y:o})):null!==r&&(l.push({x:r,y:n.y}),l.push({x:r,y:a.y}))}),l}(t,e),i.length?new oa({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function eo(t){return t&&!1!==t.fill}function io(t,e,i){var n,r=t[e].fill,a=[e];if(!i)return r;for(;!1!==r&&-1===a.indexOf(r);){if(!y(r))return r;if(!(n=t[r]))return!1;if(n.visible)return r;a.push(r),r=n.fill}return!1}function no(t,e,i){var n=function(t){var e=t.options,i=e.fill,n=b(i&&i.target,i);return void 0===n&&(n=!!e.backgroundColor),!1!==n&&null!==n&&(!0===n?"origin":n)}(t);if(g(n))return!isNaN(n.value)&&n;var r=parseFloat(n);return y(r)&&Math.floor(r)===r?function(t,e,i,n){return"-"!==t&&"+"!==t||(i=e+i),!(i===e||i<0||i>=n)&&i}(n[0],e,r,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function ro(t,e,i){for(var n=[],r=0;r<i.length;r++){var a=ao(i[r],e,"x"),o=a.first,s=a.last,l=a.point;if(!(!l||o&&s))if(o)n.unshift(l);else if(t.push(l),!s)break}t.push.apply(t,n)}function ao(t,e,i){var n=t.interpolate(e,i);if(!n)return{};for(var r=n[i],a=t.segments,o=t.points,s=!1,l=!1,h=0;h<a.length;h++){var u=a[h],c=o[u.start][i],f=o[u.end][i];if(ct(r,c,f)){s=r===c,l=r===f;break}}return{first:s,last:l,point:n}}var oo=function(){return _createClass(function t(e){_classCallCheck(this,t),this.x=e.x,this.y=e.y,this.radius=e.radius},[{key:"pathSegment",value:function(t,e,i){var n=this.x,r=this.y,a=this.radius;return e=e||{start:0,end:H},t.arc(n,r,a,e.end,e.start,!0),!i.bounds}},{key:"interpolate",value:function(t){var e=this.x,i=this.y,n=this.radius,r=t.angle;return{x:e+Math.cos(r)*n,y:i+Math.sin(r)*n,angle:r}}}])}();function so(t){var e=t.chart,i=t.fill,n=t.line;if(y(i))return function(t,e){var i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){var e=t.scale,i=t.index,n=t.line,r=[],a=n.segments,o=n.points,s=function(t,e){for(var i=[],n=t.getMatchingVisibleMetas("line"),r=0;r<n.length;r++){var a=n[r];if(a.index===e)break;a.hidden||i.unshift(a.dataset)}return i}(e,i);s.push(to({x:null,y:e.bottom},n));for(var l=0;l<a.length;l++)for(var h=a[l],u=h.start;u<=h.end;u++)ro(r,o[u],s);return new oa({points:r,options:{}})}(t);if("shape"===i)return!0;var r=function(t){return(t.scale||{}).getPointPositionForValue?function(t){var e=t.scale,i=t.fill,n=e.options,r=e.getLabels().length,a=n.reverse?e.max:e.min,o=function(t,e,i){return"start"===t?i:"end"===t?e.options.reverse?e.min:e.max:g(t)?t.value:e.getBaseValue()}(i,e,a),s=[];if(n.grid.circular){var l=e.getPointPositionForValue(0,a);return new oo({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(o)})}for(var h=0;h<r;++h)s.push(e.getPointPositionForValue(h,o));return s}(t):function(t){var e=t.scale,i=void 0===e?{}:e,n=function(t,e){var i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:g(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(t.fill,i);if(y(n)){var r=i.isHorizontal();return{x:r?n:null,y:r?null:n}}return null}(t)}(t);return r instanceof oo?r:to(r,n)}function lo(t,e,i){var n=so(e),r=e.chart,a=e.index,o=e.line,s=e.scale,l=e.axis,h=o.options,u=h.fill,c=h.backgroundColor,f=u||{},d=f.above,v=void 0===d?c:d,p=f.below,g=void 0===p?c:p,y=r.getDatasetMeta(a),m=Gi(r,y);n&&o.points.length&&(We(t,i),function(t,e){var i=e.line,n=e.target,r=e.above,a=e.below,o=e.area,s=e.scale,l=e.clip,h=i._loop?"angle":e.axis;t.save();var u=a;a!==r&&("x"===h?(ho(t,n,o.top),co(t,{line:i,target:n,color:r,scale:s,property:h,clip:l}),t.restore(),t.save(),ho(t,n,o.bottom)):"y"===h&&(uo(t,n,o.left),co(t,{line:i,target:n,color:a,scale:s,property:h,clip:l}),t.restore(),t.save(),uo(t,n,o.right),u=r)),co(t,{line:i,target:n,color:u,scale:s,property:h,clip:l}),t.restore()}(t,{line:o,target:n,above:v,below:g,area:i,scale:s,axis:l,clip:m}),Ne(t))}function ho(t,e,i){var n=e.segments,r=e.points,a=!0,o=!1;t.beginPath();var s,l=_createForOfIteratorHelper(n);try{for(l.s();!(s=l.n()).done;){var h=s.value,u=h.start,c=h.end,f=r[u],d=r[Za(u,c,r)];a?(t.moveTo(f.x,f.y),a=!1):(t.lineTo(f.x,i),t.lineTo(f.x,f.y)),(o=!!e.pathSegment(t,h,{move:o}))?t.closePath():t.lineTo(d.x,i)}}catch(t){l.e(t)}finally{l.f()}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function uo(t,e,i){var n=e.segments,r=e.points,a=!0,o=!1;t.beginPath();var s,l=_createForOfIteratorHelper(n);try{for(l.s();!(s=l.n()).done;){var h=s.value,u=h.start,c=h.end,f=r[u],d=r[Za(u,c,r)];a?(t.moveTo(f.x,f.y),a=!1):(t.lineTo(i,f.y),t.lineTo(f.x,f.y)),(o=!!e.pathSegment(t,h,{move:o}))?t.closePath():t.lineTo(i,d.y)}}catch(t){l.e(t)}finally{l.f()}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function co(t,e){var i,n=e.line,r=e.target,a=e.property,o=e.color,s=e.scale,l=e.clip,h=function(t,e,i){var n,r=t.segments,a=t.points,o=e.points,s=[],l=_createForOfIteratorHelper(r);try{for(l.s();!(n=l.n()).done;){var h=n.value,u=h.start,c=h.end;c=Za(u,c,a);var f=Ja(i,a[u],a[c],h.loop);if(e.segments){var d,v=_createForOfIteratorHelper(Wi(e,f));try{for(v.s();!(d=v.n()).done;){var p,g=d.value,y=Ja(i,o[g.start],o[g.end],g.loop),m=_createForOfIteratorHelper(ji(h,a,y));try{for(m.s();!(p=m.n()).done;){var b=p.value;s.push({source:b,target:g,start:_defineProperty({},i,Qa(f,y,"start",Math.max)),end:_defineProperty({},i,Qa(f,y,"end",Math.min))})}}catch(t){m.e(t)}finally{m.f()}}}catch(t){v.e(t)}finally{v.f()}}else s.push({source:h,target:f,start:a[u],end:a[c]})}}catch(t){l.e(t)}finally{l.f()}return s}(n,r,a),u=_createForOfIteratorHelper(h);try{for(u.s();!(i=u.n()).done;){var c=i.value,f=c.source,d=c.target,v=c.start,p=c.end,g=f.style,y=(void 0===g?{}:g).backgroundColor,m=void 0===y?o:y,b=!0!==r;t.save(),t.fillStyle=m,fo(t,s,l,b&&Ja(a,v,p)),t.beginPath();var _=!!n.pathSegment(t,f),x=void 0;if(b){_?t.closePath():vo(t,r,p,a);var k=!!r.pathSegment(t,d,{move:_,reverse:!0});(x=_&&k)||vo(t,r,v,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}catch(t){u.e(t)}finally{u.f()}}function fo(t,e,i,n){var r,a,o,s,l=e.chart.chartArea,h=n||{},u=h.property,c=h.start,f=h.end;"x"!==u&&"y"!==u||("x"===u?(r=c,a=l.top,o=f,s=l.bottom):(r=l.left,a=c,o=l.right,s=f),t.beginPath(),i&&(r=Math.max(r,i.left),o=Math.min(o,i.right),a=Math.max(a,i.top),s=Math.min(s,i.bottom)),t.rect(r,a,o-r,s-a),t.clip())}function vo(t,e,i,n){var r=e.interpolate(i,n);r&&t.lineTo(r.x,r.y)}var po={id:"filler",afterDatasetsUpdate:function(t,e,i){var n,r,a,o,s=(t.data.datasets||[]).length,l=[];for(r=0;r<s;++r)o=null,(a=(n=t.getDatasetMeta(r)).dataset)&&a.options&&a instanceof oa&&(o={visible:t.isDatasetVisible(r),index:r,fill:no(a,r,s),chart:t,axis:n.controller.options.indexAxis,scale:n.vScale,line:a}),n.$filler=o,l.push(o);for(r=0;r<s;++r)(o=l[r])&&!1!==o.fill&&(o.fill=io(l,r,i.propagate))},beforeDraw:function(t,e,i){for(var n="beforeDraw"===i.drawTime,r=t.getSortedVisibleDatasetMetas(),a=t.chartArea,o=r.length-1;o>=0;--o){var s=r[o].$filler;s&&(s.line.updateControlPoints(a,s.axis),n&&s.fill&&lo(t.ctx,s,a))}},beforeDatasetsDraw:function(t,e,i){if("beforeDatasetsDraw"===i.drawTime)for(var n=t.getSortedVisibleDatasetMetas(),r=n.length-1;r>=0;--r){var a=n[r].$filler;eo(a)&&lo(t.ctx,a,t.chartArea)}},beforeDatasetDraw:function(t,e,i){var n=e.meta.$filler;eo(n)&&"beforeDatasetDraw"===i.drawTime&&lo(t.ctx,n,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},go=function(t,e){var i=t.boxHeight,n=void 0===i?e:i,r=t.boxWidth,a=void 0===r?e:r;return t.usePointStyle&&(n=Math.min(n,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(e,n)}},yo=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e))._added=!1,i.legendHitBoxes=[],i._hoveredItem=null,i.doughnutMode=!1,i.chart=t.chart,i.options=t.options,i.ctx=t.ctx,i.legendItems=void 0,i.columnSizes=void 0,i.lineWidths=void 0,i.maxHeight=void 0,i.maxWidth=void 0,i.top=void 0,i.bottom=void 0,i.left=void 0,i.right=void 0,i.height=void 0,i.width=void 0,i._margins=void 0,i.position=void 0,i.weight=void 0,i.fullSize=void 0,i}return _inherits(e,t),_createClass(e,[{key:"update",value:function(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}},{key:"setDimensions",value:function(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}},{key:"buildLabels",value:function(){var t=this,e=this.options.labels||{},i=k(e.generateLabels,[this.chart],this)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),e.sort&&(i=i.sort(function(i,n){return e.sort(i,n,t.chart.data)})),this.options.reverse&&i.reverse(),this.legendItems=i}},{key:"fit",value:function(){var t=this.options,e=this.ctx;if(t.display){var i,n,r=t.labels,a=Ii(r.font),o=a.size,s=this._computeTitleHeight(),l=go(r,o),h=l.boxWidth,u=l.itemHeight;e.font=a.string,this.isHorizontal()?(i=this.maxWidth,n=this._fitRows(s,o,h,u)+10):(n=this.maxHeight,i=this._fitCols(s,a,h,u)+10),this.width=Math.min(i,t.maxWidth||this.maxWidth),this.height=Math.min(n,t.maxHeight||this.maxHeight)}else this.width=this.height=0}},{key:"_fitRows",value:function(t,e,i,n){var r=this.ctx,a=this.maxWidth,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.lineWidths=[0],h=n+o,u=t;r.textAlign="left",r.textBaseline="middle";var c=-1,f=-h;return this.legendItems.forEach(function(t,d){var v=i+e/2+r.measureText(t.text).width;(0===d||l[l.length-1]+v+2*o>a)&&(u+=h,l[l.length-(d>0?0:1)]=0,f+=h,c++),s[d]={left:0,top:f,row:c,width:v,height:n},l[l.length-1]+=v+o}),u}},{key:"_fitCols",value:function(t,e,i,n){var r=this.ctx,a=this.maxHeight,o=this.options.labels.padding,s=this.legendHitBoxes=[],l=this.columnSizes=[],h=a-t,u=o,c=0,f=0,d=0,v=0;return this.legendItems.forEach(function(t,a){var p=function(t,e,i,n,r){var a=function(t,e,i,n){var r=t.text;return r&&"string"!=typeof r&&(r=r.reduce(function(t,e){return t.length>e.length?t:e})),e+i.size/2+n.measureText(r).width}(n,t,e,i),o=function(t,e,i){var n=t;return"string"!=typeof e.text&&(n=mo(e,i)),n}(r,n,e.lineHeight);return{itemWidth:a,itemHeight:o}}(i,e,r,t,n),g=p.itemWidth,y=p.itemHeight;a>0&&f+y+2*o>h&&(u+=c+o,l.push({width:c,height:f}),d+=c+o,v++,c=f=0),s[a]={left:d,top:f,col:v,width:g,height:y},c=Math.max(c,g),f+=y+o}),u+=c,l.push({width:c,height:f}),u}},{key:"adjustHitBoxes",value:function(){if(this.options.display){var t=this._computeTitleHeight(),e=this.legendHitBoxes,i=this.options,n=i.align,r=i.labels.padding,a=Fi(i.rtl,this.left,this.width);if(this.isHorizontal()){var o,s=0,l=Mt(n,this.left+r,this.right-this.lineWidths[s]),h=_createForOfIteratorHelper(e);try{for(h.s();!(o=h.n()).done;){var u=o.value;s!==u.row&&(s=u.row,l=Mt(n,this.left+r,this.right-this.lineWidths[s])),u.top+=this.top+t+r,u.left=a.leftForLtr(a.x(l),u.width),l+=u.width+r}}catch(t){h.e(t)}finally{h.f()}}else{var c,f=0,d=Mt(n,this.top+t+r,this.bottom-this.columnSizes[f].height),v=_createForOfIteratorHelper(e);try{for(v.s();!(c=v.n()).done;){var p=c.value;p.col!==f&&(f=p.col,d=Mt(n,this.top+t+r,this.bottom-this.columnSizes[f].height)),p.top=d,p.left+=this.left+r,p.left=a.leftForLtr(a.x(p.left),p.width),d+=p.height+r}}catch(t){v.e(t)}finally{v.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){if(this.options.display){var t=this.ctx;We(t,this),this._draw(),Ne(t)}}},{key:"_draw",value:function(){var t,e=this,i=this.options,n=this.columnSizes,r=this.lineWidths,a=this.ctx,o=i.align,s=i.labels,l=_e.color,h=Fi(i.rtl,this.left,this.width),u=Ii(s.font),c=s.padding,f=u.size,d=f/2;this.drawTitle(),a.textAlign=h.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=u.string;var v=go(s,f),p=v.boxWidth,g=v.boxHeight,y=v.itemHeight,m=this.isHorizontal(),_=this._computeTitleHeight();t=m?{x:Mt(o,this.left+c,this.right-r[0]),y:this.top+c+_,line:0}:{x:this.left+c,y:Mt(o,this.top+_+c,this.bottom-n[0].height),line:0},zi(this.ctx,i.textDirection);var x=y+c;this.legendItems.forEach(function(v,k){a.strokeStyle=v.fontColor,a.fillStyle=v.fontColor;var w=a.measureText(v.text).width,M=h.textAlign(v.textAlign||(v.textAlign=s.textAlign)),P=p+d+w,S=t.x,C=t.y;if(h.setWidth(e.width),m?k>0&&S+P+c>e.right&&(C=t.y+=x,t.line++,S=t.x=Mt(o,e.left+c,e.right-r[t.line])):k>0&&C+x>e.bottom&&(S=t.x=S+n[t.line].width+c,t.line++,C=t.y=Mt(o,e.top+_+c,e.bottom-n[t.line].height)),function(t,e,i){if(!(isNaN(p)||p<=0||isNaN(g)||g<0)){a.save();var n=b(i.lineWidth,1);if(a.fillStyle=b(i.fillStyle,l),a.lineCap=b(i.lineCap,"butt"),a.lineDashOffset=b(i.lineDashOffset,0),a.lineJoin=b(i.lineJoin,"miter"),a.lineWidth=n,a.strokeStyle=b(i.strokeStyle,l),a.setLineDash(b(i.lineDash,[])),s.usePointStyle){var r={radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},o=h.xPlus(t,p/2);He(a,r,o,e+d,s.pointStyleWidth&&p)}else{var u=e+Math.max((f-g)/2,0),c=h.leftForLtr(t,p),v=Di(i.borderRadius);a.beginPath(),Object.values(v).some(function(t){return 0!==t})?Ke(a,{x:c,y:u,w:p,h:g,radius:v}):a.rect(c,u,p,g),a.fill(),0!==n&&a.stroke()}a.restore()}}(h.x(S),C,v),S=Pt(M,S+p+d,m?S+P:e.right,i.rtl),function(t,e,i){Ge(a,i.text,t,e+y/2,u,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(S),C,v),m)t.x+=P+c;else if("string"!=typeof v.text){var O=u.lineHeight;t.y+=mo(v,O)+c}else t.y+=x}),Vi(this.ctx,i.textDirection)}},{key:"drawTitle",value:function(){var t=this.options,e=t.title,i=Ii(e.font),n=Ti(e.padding);if(e.display){var r,a=Fi(t.rtl,this.left,this.width),o=this.ctx,s=e.position,l=i.size/2,h=n.top+l,u=this.left,c=this.width;if(this.isHorizontal())c=Math.max.apply(Math,_toConsumableArray(this.lineWidths)),r=this.top+h,u=Mt(t.align,u,this.right-c);else{var f=this.columnSizes.reduce(function(t,e){return Math.max(t,e.height)},0);r=h+Mt(t.align,this.top,this.bottom-f-t.labels.padding-this._computeTitleHeight())}var d=Mt(s,u,u+c);o.textAlign=a.textAlign(wt(s)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Ge(o,e.text,d,r,i)}}},{key:"_computeTitleHeight",value:function(){var t=this.options.title,e=Ii(t.font),i=Ti(t.padding);return t.display?e.lineHeight+i.height:0}},{key:"_getLegendItemAt",value:function(t,e){var i,n,r;if(ct(t,this.left,this.right)&&ct(e,this.top,this.bottom))for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(ct(t,(n=r[i]).left,n.left+n.width)&&ct(e,n.top,n.top+n.height))return this.legendItems[i];return null}},{key:"handleEvent",value:function(t){var e=this.options;if(function(t,e){return!("mousemove"!==t&&"mouseout"!==t||!e.onHover&&!e.onLeave)||!(!e.onClick||"click"!==t&&"mouseup"!==t)}(t.type,e)){var i,n,r=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){var a=this._hoveredItem,o=(n=r,null!==(i=a)&&null!==n&&i.datasetIndex===n.datasetIndex&&i.index===n.index);a&&!o&&k(e.onLeave,[t,a,this],this),this._hoveredItem=r,r&&!o&&k(e.onHover,[t,r,this],this)}else r&&k(e.onClick,[t,r,this],this)}}}])}(qn);function mo(t,e){return e*(t.text?t.text.length:0)}var bo={id:"legend",_element:yo,start:function(t,e,i){var n=t.legend=new yo({ctx:t.ctx,options:i,chart:t});vn.configure(t,n,i),vn.addBox(t,n)},stop:function(t){vn.removeBox(t,t.legend),delete t.legend},beforeUpdate:function(t,e,i){var n=t.legend;vn.configure(t,n,i),n.options=i},afterUpdate:function(t){var e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent:function(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(t,e,i){var n=e.datasetIndex,r=i.chart;r.isDatasetVisible(n)?(r.hide(n),e.hidden=!0):(r.show(n),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(t){return t.chart.options.color},boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,i=t.legend.options.labels,n=i.usePointStyle,r=i.pointStyle,a=i.textAlign,o=i.color,s=i.useBorderRadius,l=i.borderRadius;return t._getSortedDatasetMetas().map(function(t){var i=t.controller.getStyle(n?0:void 0),h=Ti(i.borderWidth);return{text:e[t.index].label,fillStyle:i.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:i.borderColor,pointStyle:r||i.pointStyle,rotation:i.rotation,textAlign:a||i.textAlign,borderRadius:s&&(l||i.borderRadius),datasetIndex:t.index}},this)}},title:{color:function(t){return t.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(t){return!t.startsWith("on")},labels:{_scriptable:function(t){return!["generateLabels","filter","sort"].includes(t)}}}},_o=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e)).chart=t.chart,i.options=t.options,i.ctx=t.ctx,i._padding=void 0,i.top=void 0,i.bottom=void 0,i.left=void 0,i.right=void 0,i.width=void 0,i.height=void 0,i.position=void 0,i.weight=void 0,i.fullSize=void 0,i}return _inherits(e,t),_createClass(e,[{key:"update",value:function(t,e){var i=this.options;if(this.left=0,this.top=0,i.display){this.width=this.right=t,this.height=this.bottom=e;var n=p(i.text)?i.text.length:1;this._padding=Ti(i.padding);var r=n*Ii(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}else this.width=this.height=this.right=this.bottom=0}},{key:"isHorizontal",value:function(){var t=this.options.position;return"top"===t||"bottom"===t}},{key:"_drawArgs",value:function(t){var e,i,n,r=this.top,a=this.left,o=this.bottom,s=this.right,l=this.options,h=l.align,u=0;return this.isHorizontal()?(i=Mt(h,a,s),n=r+t,e=s-a):("left"===l.position?(i=a+t,n=Mt(h,o,r),u=-.5*B):(i=s-t,n=Mt(h,r,o),u=.5*B),e=o-r),{titleX:i,titleY:n,maxWidth:e,rotation:u}}},{key:"draw",value:function(){var t=this.ctx,e=this.options;if(e.display){var i=Ii(e.font),n=i.lineHeight/2+this._padding.top,r=this._drawArgs(n),a=r.titleX,o=r.titleY,s=r.maxWidth,l=r.rotation;Ge(t,e.text,0,0,i,{color:e.color,maxWidth:s,rotation:l,textAlign:wt(e.align),textBaseline:"middle",translation:[a,o]})}}}])}(qn),xo={id:"title",_element:_o,start:function(t,e,i){!function(t,e){var i=new _o({ctx:t.ctx,options:e,chart:t});vn.configure(t,i,e),vn.addBox(t,i),t.titleBlock=i}(t,i)},stop:function(t){var e=t.titleBlock;vn.removeBox(t,e),delete t.titleBlock},beforeUpdate:function(t,e,i){var n=t.titleBlock;vn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ko=new WeakMap,wo={id:"subtitle",start:function(t,e,i){var n=new _o({ctx:t.ctx,options:i,chart:t});vn.configure(t,n,i),vn.addBox(t,n),ko.set(t,n)},stop:function(t){vn.removeBox(t,ko.get(t)),ko.delete(t)},beforeUpdate:function(t,e,i){var n=ko.get(t);vn.configure(t,n,i),n.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Mo={average:function(t){if(!t.length)return!1;var e,i,n=new Set,r=0,a=0;for(e=0,i=t.length;e<i;++e){var o=t[e].element;if(o&&o.hasValue()){var s=o.tooltipPosition();n.add(s.x),r+=s.y,++a}}return 0!==a&&0!==n.size&&{x:_toConsumableArray(n).reduce(function(t,e){return t+e})/n.size,y:r/a}},nearest:function(t,e){if(!t.length)return!1;var i,n,r,a=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i].element;if(l&&l.hasValue()){var h=at(e,l.getCenterPoint());h<s&&(s=h,r=l)}}if(r){var u=r.tooltipPosition();a=u.x,o=u.y}return{x:a,y:o}}};function Po(t,e){return e&&(p(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function So(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Co(t,e){var i=e.element,n=e.datasetIndex,r=e.index,a=t.getDatasetMeta(n).controller,o=a.getLabelAndValue(r),s=o.label,l=o.value;return{chart:t,label:s,parsed:a.getParsed(r),raw:t.data.datasets[n].data[r],formattedValue:l,dataset:a.getDataset(),dataIndex:r,datasetIndex:n,element:i}}function Oo(t,e){var i=t.chart.ctx,n=t.body,r=t.footer,a=t.title,o=e.boxWidth,s=e.boxHeight,l=Ii(e.bodyFont),h=Ii(e.titleFont),u=Ii(e.footerFont),c=a.length,f=r.length,d=n.length,v=Ti(e.padding),p=v.height,g=0,y=n.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);y+=t.beforeBody.length+t.afterBody.length,c&&(p+=c*h.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y&&(p+=d*(e.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(y-d)*l.lineHeight+(y-1)*e.bodySpacing),f&&(p+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);var m=0,b=function(t){g=Math.max(g,i.measureText(t).width+m)};return i.save(),i.font=h.string,w(t.title,b),i.font=l.string,w(t.beforeBody.concat(t.afterBody),b),m=e.displayColors?o+2+e.boxPadding:0,w(n,function(t){w(t.before,b),w(t.lines,b),w(t.after,b)}),m=0,i.font=u.string,w(t.footer,b),i.restore(),{width:g+=v.width,height:p}}function Ao(t,e,i,n){var r=i.x,a=i.width,o=t.width,s=t.chartArea,l=s.left,h=s.right,u="center";return"center"===n?u=r<=(l+h)/2?"left":"right":r<=a/2?u="left":r>=o-a/2&&(u="right"),function(t,e,i,n){var r=n.x,a=n.width,o=i.caretSize+i.caretPadding;return"left"===t&&r+a+o>e.width||"right"===t&&r-a-o<0||void 0}(u,t,e,i)&&(u="center"),u}function Do(t,e,i){var n=i.yAlign||e.yAlign||function(t,e){var i=e.y,n=e.height;return i<n/2?"top":i>t.height-n/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Ao(t,e,i,n),yAlign:n}}function To(t,e,i,n){var r=t.caretSize,a=t.caretPadding,o=t.cornerRadius,s=i.xAlign,l=i.yAlign,h=r+a,u=Di(o),c=u.topLeft,f=u.topRight,d=u.bottomLeft,v=u.bottomRight,p=function(t,e){var i=t.x,n=t.width;return"right"===e?i-=n:"center"===e&&(i-=n/2),i}(e,s),g=function(t,e,i){var n=t.y,r=t.height;return"top"===e?n+=i:n-="bottom"===e?r+i:r/2,n}(e,l,h);return"center"===l?"left"===s?p+=h:"right"===s&&(p-=h):"left"===s?p-=Math.max(c,d)+r:"right"===s&&(p+=Math.max(f,v)+r),{x:ht(p,0,n.width-e.width),y:ht(g,0,n.height-e.height)}}function Io(t,e,i){var n=Ti(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-n.right:t.x+n.left}function Lo(t){return Po([],So(t))}function Ro(t,e){var i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}var Eo={beforeTitle:f,title:function(t){if(t.length>0){var e=t[0],i=e.chart.data.labels,n=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return i[e.dataIndex]}return""},afterTitle:f,beforeBody:f,beforeLabel:f,label:function(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;var e=t.dataset.label||"";e&&(e+=": ");var i=t.formattedValue;return v(i)||(e+=i),e},labelColor:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor:function(){return this.options.bodyColor},labelPointStyle:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:f,afterBody:f,beforeFooter:f,footer:f,afterFooter:f};function Fo(t,e,i,n){var r=t[e].call(i,n);return void 0===r?Eo[e].call(i,n):r}var zo=function(t){function e(t){var i;return _classCallCheck(this,e),(i=_callSuper(this,e)).opacity=0,i._active=[],i._eventPosition=void 0,i._size=void 0,i._cachedAnimations=void 0,i._tooltipItems=[],i.$animations=void 0,i.$context=void 0,i.chart=t.chart,i.options=t.options,i.dataPoints=void 0,i.title=void 0,i.beforeBody=void 0,i.body=void 0,i.afterBody=void 0,i.footer=void 0,i.xAlign=void 0,i.yAlign=void 0,i.x=void 0,i.y=void 0,i.height=void 0,i.width=void 0,i.caretX=void 0,i.caretY=void 0,i.labelColors=void 0,i.labelPointStyles=void 0,i.labelTextColors=void 0,i}return _inherits(e,t),_createClass(e,[{key:"initialize",value:function(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var t=this._cachedAnimations;if(t)return t;var e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,r=new zn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context=Ei(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}},{key:"getTitle",value:function(t,e){var i=e.callbacks,n=Fo(i,"beforeTitle",this,t),r=Fo(i,"title",this,t),a=Fo(i,"afterTitle",this,t),o=[];return o=Po(o,So(n)),o=Po(o,So(r)),o=Po(o,So(a))}},{key:"getBeforeBody",value:function(t,e){return Lo(Fo(e.callbacks,"beforeBody",this,t))}},{key:"getBody",value:function(t,e){var i=this,n=e.callbacks,r=[];return w(t,function(t){var e={before:[],lines:[],after:[]},a=Ro(n,t);Po(e.before,So(Fo(a,"beforeLabel",i,t))),Po(e.lines,Fo(a,"label",i,t)),Po(e.after,So(Fo(a,"afterLabel",i,t))),r.push(e)}),r}},{key:"getAfterBody",value:function(t,e){return Lo(Fo(e.callbacks,"afterBody",this,t))}},{key:"getFooter",value:function(t,e){var i=e.callbacks,n=Fo(i,"beforeFooter",this,t),r=Fo(i,"footer",this,t),a=Fo(i,"afterFooter",this,t),o=[];return o=Po(o,So(n)),o=Po(o,So(r)),o=Po(o,So(a))}},{key:"_createItems",value:function(t){var e,i,n=this,r=this._active,a=this.chart.data,o=[],s=[],l=[],h=[];for(e=0,i=r.length;e<i;++e)h.push(Co(this.chart,r[e]));return t.filter&&(h=h.filter(function(e,i,n){return t.filter(e,i,n,a)})),t.itemSort&&(h=h.sort(function(e,i){return t.itemSort(e,i,a)})),w(h,function(e){var i=Ro(t.callbacks,e);o.push(Fo(i,"labelColor",n,e)),s.push(Fo(i,"labelPointStyle",n,e)),l.push(Fo(i,"labelTextColor",n,e))}),this.labelColors=o,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=h,h}},{key:"update",value:function(t,e){var i,n=this.options.setContext(this.getContext()),r=this._active,a=[];if(r.length){var o=Mo[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);var s=this._size=Oo(this,n),l=Object.assign({},o,s),h=Do(this.chart,n,l),u=To(n,l,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,i={opacity:1,x:u.x,y:u.y,width:s.width,height:s.height,caretX:o.x,caretY:o.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}},{key:"drawCaret",value:function(t,e,i,n){var r=this.getCaretPosition(t,i,n);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}},{key:"getCaretPosition",value:function(t,e,i){var n,r,a,o,s,l,h=this.xAlign,u=this.yAlign,c=i.caretSize,f=Di(i.cornerRadius),d=f.topLeft,v=f.topRight,p=f.bottomLeft,g=f.bottomRight,y=t.x,m=t.y,b=e.width,_=e.height;return"center"===u?(s=m+_/2,"left"===h?(r=(n=y)-c,o=s+c,l=s-c):(r=(n=y+b)+c,o=s-c,l=s+c),a=n):(r="left"===h?y+Math.max(d,p)+c:"right"===h?y+b-Math.max(v,g)-c:this.caretX,"top"===u?(s=(o=m)-c,n=r-c,a=r+c):(s=(o=m+_)+c,n=r+c,a=r-c),l=o),{x1:n,x2:r,x3:a,y1:o,y2:s,y3:l}}},{key:"drawTitle",value:function(t,e,i){var n,r,a,o=this.title,s=o.length;if(s){var l=Fi(i.rtl,this.x,this.width);for(t.x=Io(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=Ii(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,a=0;a<s;++a)e.fillText(o[a],l.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+r,a+1===s&&(t.y+=i.titleMarginBottom-r)}}},{key:"_drawColorBox",value:function(t,e,i,n,r){var a=this.labelColors[i],o=this.labelPointStyles[i],s=r.boxHeight,l=r.boxWidth,h=Ii(r.bodyFont),u=Io(this,"left",r),c=n.x(u),f=s<h.lineHeight?(h.lineHeight-s)/2:0,d=e.y+f;if(r.usePointStyle){var v={radius:Math.min(l,s)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},p=n.leftForLtr(c,l)+l/2,y=d+s/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Be(t,v,p,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Be(t,v,p,y)}else{t.lineWidth=g(a.borderWidth)?Math.max.apply(Math,_toConsumableArray(Object.values(a.borderWidth))):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;var m=n.leftForLtr(c,l),b=n.leftForLtr(n.xPlus(c,1),l-2),_=Di(a.borderRadius);Object.values(_).some(function(t){return 0!==t})?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ke(t,{x:m,y:d,w:l,h:s,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ke(t,{x:b,y:d+1,w:l-2,h:s-2,radius:_}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(m,d,l,s),t.strokeRect(m,d,l,s),t.fillStyle=a.backgroundColor,t.fillRect(b,d+1,l-2,s-2))}t.fillStyle=this.labelTextColors[i]}},{key:"drawBody",value:function(t,e,i){var n,r,a,o,s,l,h,u=this.body,c=i.bodySpacing,f=i.bodyAlign,d=i.displayColors,v=i.boxHeight,p=i.boxWidth,g=i.boxPadding,y=Ii(i.bodyFont),m=y.lineHeight,b=0,_=Fi(i.rtl,this.x,this.width),x=function(i){e.fillText(i,_.x(t.x+b),t.y+m/2),t.y+=m+c},k=_.textAlign(f);for(e.textAlign=f,e.textBaseline="middle",e.font=y.string,t.x=Io(this,k,i),e.fillStyle=i.bodyColor,w(this.beforeBody,x),b=d&&"right"!==k?"center"===f?p/2+g:p+2+g:0,o=0,l=u.length;o<l;++o){for(n=u[o],r=this.labelTextColors[o],e.fillStyle=r,w(n.before,x),a=n.lines,d&&a.length&&(this._drawColorBox(e,t,o,_,i),m=Math.max(y.lineHeight,v)),s=0,h=a.length;s<h;++s)x(a[s]),m=y.lineHeight;w(n.after,x)}b=0,m=y.lineHeight,w(this.afterBody,x),t.y-=c}},{key:"drawFooter",value:function(t,e,i){var n,r,a=this.footer,o=a.length;if(o){var s=Fi(i.rtl,this.x,this.width);for(t.x=Io(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=s.textAlign(i.footerAlign),e.textBaseline="middle",n=Ii(i.footerFont),e.fillStyle=i.footerColor,e.font=n.string,r=0;r<o;++r)e.fillText(a[r],s.x(t.x),t.y+n.lineHeight/2),t.y+=n.lineHeight+i.footerSpacing}}},{key:"drawBackground",value:function(t,e,i,n){var r=this.xAlign,a=this.yAlign,o=t.x,s=t.y,l=i.width,h=i.height,u=Di(n.cornerRadius),c=u.topLeft,f=u.topRight,d=u.bottomLeft,v=u.bottomRight;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(o+c,s),"top"===a&&this.drawCaret(t,e,i,n),e.lineTo(o+l-f,s),e.quadraticCurveTo(o+l,s,o+l,s+f),"center"===a&&"right"===r&&this.drawCaret(t,e,i,n),e.lineTo(o+l,s+h-v),e.quadraticCurveTo(o+l,s+h,o+l-v,s+h),"bottom"===a&&this.drawCaret(t,e,i,n),e.lineTo(o+d,s+h),e.quadraticCurveTo(o,s+h,o,s+h-d),"center"===a&&"left"===r&&this.drawCaret(t,e,i,n),e.lineTo(o,s+c),e.quadraticCurveTo(o,s,o+c,s),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}},{key:"_updateAnimationTarget",value:function(t){var e=this.chart,i=this.$animations,n=i&&i.x,r=i&&i.y;if(n||r){var a=Mo[t.position].call(this,this._active,this._eventPosition);if(!a)return;var o=this._size=Oo(this,t),s=Object.assign({},a,this._size),l=Do(e,t,s),h=To(t,s,l,e);n._to===h.x&&r._to===h.y||(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}},{key:"_willRender",value:function(){return!!this.opacity}},{key:"draw",value:function(t){var e=this.options.setContext(this.getContext()),i=this.opacity;if(i){this._updateAnimationTarget(e);var n={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;var a=Ti(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,n,e),zi(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),Vi(t,e.textDirection),t.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t,e){var i=this,n=this._active,r=t.map(function(t){var e=t.datasetIndex,n=t.index,r=i.chart.getDatasetMeta(e);if(!r)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:r.data[n],index:n}}),a=!M(n,r),o=this._positionChanged(r,e);(a||o)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}},{key:"handleEvent",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;var n=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),s=e||!M(a,r)||o;return s&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),s}},{key:"_getActiveElements",value:function(t,e,i,n){var r=this,a=this.options;if("mouseout"===t.type)return[];if(!n)return e.filter(function(t){return r.chart.data.datasets[t.datasetIndex]&&void 0!==r.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index)});var o=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&o.reverse(),o}},{key:"_positionChanged",value:function(t,e){var i=this.caretX,n=this.caretY,r=this.options,a=Mo[r.position].call(this,t,e);return!1!==a&&(i!==a.x||n!==a.y)}}])}(qn);_defineProperty(zo,"positioners",Mo);var Vo={id:"tooltip",_element:zo,positioners:Mo,afterInit:function(t,e,i){i&&(t.tooltip=new zo({chart:t,options:i}))},beforeUpdate:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset:function(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw:function(t){var e=t.tooltip;if(e&&e._willRender()){var i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",_objectSpread(_objectSpread({},i),{},{cancelable:!0})))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent:function(t,e){if(t.tooltip){var i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(t,e){return e.bodyFont.size},boxWidth:function(t,e){return e.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Eo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:function(t){return"filter"!==t&&"itemSort"!==t&&"external"!==t},_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return Er.register(qr,ja,va,c),Er.helpers=_objectSpread({},Ki),Er._adapters=Br,Er.Animation=Fn,Er.Animations=zn,Er.animator=At,Er.controllers=hr.controllers.items,Er.DatasetController=Kn,Er.Element=qn,Er.elements=va,Er.Interaction=en,Er.layouts=vn,Er.platforms=Ln,Er.Scale=or,Er.Ticks=ve,Object.assign(Er,qr,ja,va,c,Ln),Er.Chart=Er,"undefined"!=typeof window&&(window.Chart=Er),Er});