@kevinburke/flot 5.1.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/dist/flot.js +47 -28
- package/dist/flot.min.js +1 -1
- package/dist/flot.min.js.map +1 -1
- package/dist/flot.mjs +47 -28
- package/dist/jquery.flot.js +94 -31
- package/dist/jquery.flot.min.js +1 -1
- package/dist/jquery.flot.min.js.map +1 -1
- package/dist/plugins/jquery.flot.crosshair.js +2 -2
- package/dist/plugins/jquery.flot.crosshair.min.js +1 -1
- package/dist/plugins/jquery.flot.image.js +6 -6
- package/dist/plugins/jquery.flot.image.min.js +1 -1
- package/dist/plugins/jquery.flot.image.min.js.map +1 -1
- package/dist/plugins/jquery.flot.pie.js +4 -4
- package/dist/plugins/jquery.flot.pie.min.js +1 -1
- package/dist/plugins/jquery.flot.pie.min.js.map +1 -1
- package/dist/plugins/jquery.flot.resize.js +2 -2
- package/dist/plugins/jquery.flot.resize.min.js +1 -1
- package/dist/plugins/jquery.flot.resize.min.js.map +1 -1
- package/dist/plugins/jquery.flot.threshold.js +2 -2
- package/dist/plugins/jquery.flot.threshold.min.js +1 -1
- package/package.json +1 -1
- package/source/globals.d.ts +5 -0
- package/source/helpers.js +16 -4
- package/source/jquery-adapter.js +27 -2
- package/source/jquery.canvaswrapper.js +8 -4
- package/source/jquery.flot.browser.js +1 -1
- package/source/jquery.flot.composeImages.js +1 -1
- package/source/jquery.flot.hover.js +4 -4
- package/source/jquery.flot.image.js +6 -1
- package/source/jquery.flot.js +1 -1
- package/source/jquery.flot.legend.js +1 -1
- package/source/jquery.flot.navigate.js +1 -1
- package/source/jquery.flot.pie.js +2 -2
- package/source/jquery.flot.selection.js +3 -2
- package/source/jquery.flot.time.js +3 -3
- package/source/jquery.flot.touch.js +6 -1
- package/source/jquery.flot.touchNavigate.js +5 -3
- package/types/jquery.d.ts +2 -1
- package/source/jquery.js +0 -9473
package/dist/jquery.flot.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e){"use strict";var t={getPageXY:function(e){var t=document.documentElement;return{X:e.clientX+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),Y:e.clientY+(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},getPixelRatio:function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},isSafari:function(){var e=window.top;return!!e&&(/constructor/i.test(e.HTMLElement)||"[object SafariRemoteNotification]"===(!e.safari||void 0!==e.safari&&e.safari.pushNotification).toString())},isMobileSafari:function(){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&navigator.userAgent.match(/AppleWebKit/)},isOpera:function(){return!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0},isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return!!document.documentMode},isEdge:function(){return!t.isIE()&&!!window.StyleMedia},isChrome:function(){return!!window.chrome&&!!window.chrome.webstore},isBlink:function(){return(t.isChrome()||t.isOpera())&&!!window.CSS}};function n(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function i(e){if(Array.isArray(e))return e.map(i);if(n(e)){for(var t={},o=Object.keys(e),a=0;a<o.length;a++){var r=o[a],s=e[r];void 0!==s&&(t[r]=i(s))}return t}return e}function o(e,t){var a=Array.prototype.slice.call(arguments,2);"boolean"!=typeof e&&(a.unshift(t),t=e,e=!1);for(var r=0;r<a.length;r++){var s=a[r];if(null!=s)for(var l=Object.keys(s),c=0;c<l.length;c++){var u=l[c],h=s[u];void 0!==h&&(e&&Array.isArray(h)?t[u]=i(h):e&&n(h)?("object"==typeof t[u]&&null!=t[u]||(t[u]={}),o(!0,t[u],h)):t[u]=h)}}return t}function a(e){return e.clientWidth}function r(e){return e.clientHeight}function s(e,t,n){if(void 0===n)return getComputedStyle(e)[t];e.style[t]="number"==typeof n?n+"px":n}var l=new WeakMap;function c(e,t,n){var i=l.get(e);if(i||(i={},l.set(e,i)),void 0===n)return i[t];i[t]=n}function u(e,t,n){var i=new CustomEvent(t,{detail:n||[],bubbles:!0,cancelable:!0});return e.dispatchEvent(i),i}var h=new WeakMap;function p(e,t,n){e.addEventListener(t,n);var i=h.get(e);i||(i=[],h.set(e,i)),i.push({type:t,handler:n})}function f(e,t,n){var i;if(t&&n)return e.removeEventListener(t,n),void((i=h.get(e))&&h.set(e,i.filter(function(e){return e.type!==t||e.handler!==n})));if(i=h.get(e)){for(var o=[],a=0;a<i.length;a++)t&&i[a].type!==t?o.push(i[a]):e.removeEventListener(i[a].type,i[a].handler);h.set(e,o)}}var d=function(e,n){var i=n.getElementsByClassName(e)[0];if(!i&&((i=document.createElement("canvas")).className=e,i.style.direction="ltr",i.style.position="absolute",i.style.left="0px",i.style.top="0px",n.appendChild(i),!i.getContext))throw new Error("Canvas is not available.");this.element=i;var o=this.context=i.getContext("2d");this.pixelRatio=t.getPixelRatio(o);var s=a(n),l=r(n);this.resize(s,l),this.SVGContainer=null,this.SVG={},this._textCache={}};function m(e,t){e.transform.baseVal.clear(),t&&t.forEach(function(t){e.transform.baseVal.appendItem(t)})}d.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var n=this.element,i=this.context,o=this.pixelRatio;this.width!==e&&(n.width=e*o,n.style.width=e+"px",this.width=e),this.height!==t&&(n.height=t*o,n.style.height=t+"px",this.height=t),i.restore(),i.save(),i.scale(o,o)},d.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},d.prototype.render=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=this.getSVGLayer(t),i=e[t],o=n.style.display;for(var a in n.style.display="none",i)if(Object.prototype.hasOwnProperty.call(i,a)){var r=i[a];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,h=0;u[h];h++)if((l=u[h]).active)l.rendered||(n.appendChild(l.element),l.rendered=!0);else if(u.splice(h--,1),l.rendered){for(;l.element.firstChild;)l.element.removeChild(l.element.firstChild);l.element.parentNode.removeChild(l.element)}0===u.length&&(c.measured?c.measured=!1:delete r[s])}}n.style.display=o}},d.prototype.getSVGLayer=function(e){var t,n=this.SVG[e];return n||(this.SVGContainer?t=this.SVGContainer.firstChild:(this.SVGContainer=document.createElement("div"),this.SVGContainer.className="flot-svg",this.SVGContainer.style.position="absolute",this.SVGContainer.style.top="0px",this.SVGContainer.style.left="0px",this.SVGContainer.style.height="100%",this.SVGContainer.style.width="100%",this.SVGContainer.style.pointerEvents="none",this.element.parentNode.appendChild(this.SVGContainer),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",t.style.height="100%",this.SVGContainer.appendChild(t)),(n=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.bottom="0px",n.style.right="0px",t.appendChild(n),this.SVG[e]=n),n},d.prototype.getTextInfo=function(e,t,n,i,o){var a,r,s,l;t=""+t,a="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(r=this._textCache[e])&&(r=this._textCache[e]={}),null==(s=r[a])&&(s=r[a]={});var c=function(e){return e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0")}(t);if(!(l=s[c])){var u=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("<br>"))g(t,u,-9999);else{var h=document.createTextNode(t);u.appendChild(h)}u.style.position="absolute",u.style.maxWidth=o,u.setAttributeNS(null,"x",-9999),u.setAttributeNS(null,"y",-9999),"object"==typeof n?(u.style.font=a,u.style.fill=n.fill):"string"==typeof n&&u.setAttribute("class",n),this.getSVGLayer(e).appendChild(u);var p=u.getBBox();for(l=s[c]={width:p.width,height:p.height,measured:!0,element:u,positions:[]};u.firstChild;)u.removeChild(u.firstChild);u.parentNode.removeChild(u)}return l.measured=!0,l},d.prototype.addText=function(e,t,n,i,o,a,r,s,l,c){var u=this.getTextInfo(e,i,o,a,r),h=u.positions;"center"===s?t-=u.width/2:"right"===s&&(t-=u.width),"middle"===l?n-=u.height/2:"bottom"===l&&(n-=u.height),n+=.75*u.height;for(var p,f=0;h[f];f++){if((p=h[f]).x===t&&p.y===n&&p.text===i)return p.active=!0,void m(p.element,c);if(!1===p.active)return p.active=!0,p.text=i,-1!==i.indexOf("<br>")?(n-=.25*u.height,g(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.x=t,p.y=n,void m(p.element,c)}p={active:!0,rendered:!1,element:h.length?u.element.cloneNode():u.element,text:i,x:t,y:n},h.push(p),-1!==i.indexOf("<br>")?(n-=.25*u.height,g(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.element.style.textAlign=s,m(p.element,c)};var g=function(e,t,n){var i,o,a,r=e.split("<br>");for(o=0;o<r.length;o++)t.childNodes[o]?i=t.childNodes[o]:(i=document.createElementNS("http://www.w3.org/2000/svg","tspan"),t.appendChild(i)),i.textContent=r[o],a=(0===o?0:1)+"em",i.setAttributeNS(null,"dy",a),i.setAttributeNS(null,"x",n)};d.prototype.removeText=function(e,t,n,i,o,a){var r,s;if(null==i){var l=this._textCache[e];if(null!=l)for(var c in l)if(Object.prototype.hasOwnProperty.call(l,c)){var u=l[c];for(var h in u)if(Object.prototype.hasOwnProperty.call(u,h)){var p=u[h].positions;null!=p&&p.forEach(function(e){e.active=!1})}}}else(p=(r=this.getTextInfo(e,i,o,a)).positions).forEach(function(e){s=n+.75*r.height,e.x===t&&e.y===s&&e.text===i&&(e.active=!1)})},d.prototype.clearCache=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))for(var n=this.getSVGLayer(t);n.firstChild;)n.removeChild(n.firstChild);this._textCache={}};var v={make:function(e,t,n,i){var o={};return o.r=e||0,o.g=t||0,o.b=n||0,o.a=null!=i?i:1,o.add=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]+=t;return o.normalize()},o.scale=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]*=t;return o.normalize()},o.toString=function(){return o.a>=1?"rgb("+[o.r,o.g,o.b].join(",")+")":"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"},o.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}return o.r=e(0,parseInt(o.r),255),o.g=e(0,parseInt(o.g),255),o.b=e(0,parseInt(o.b),255),o.a=e(0,o.a,1),o},o.clone=function(){return v.make(o.r,o.b,o.g,o.a)},o.normalize()},extract:function(e,t){var n;do{var i=t.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});if(""!==(n=(e.style[i]||getComputedStyle(e)[t]||"").toLowerCase())&&"transparent"!==n)break;e=e.parentElement}while(null!=e&&"body"!==e.nodeName.toLowerCase());return"rgba(0, 0, 0, 0)"===n&&(n="transparent"),v.parse(n)},parse:function(e){var t,n=v.make;if(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10));if(t=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4]));if(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]));if(t=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]),parseFloat(t[4]));if(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return n(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16));if(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return n(parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16));var i=(e||"").trim().toLowerCase();return"transparent"===i?n(255,255,255,0):n((t=x[i]||[0,0,0])[0],t[1],t[2])}},x={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]},b={saturate:function(e){return e===1/0?Number.MAX_VALUE:e===-1/0?-Number.MAX_VALUE:e},delta:function(e,t,n){return(t-e)/n===1/0?t/n-e/n:(t-e)/n},multiply:function(e,t){return b.saturate(e*t)},multiplyAdd:function(e,t,n){if(isFinite(e*t))return b.saturate(e*t+n);for(var i=n,o=0;o<t;o++)i+=e;return b.saturate(i)},floorInBase:function(e,t){return t*Math.floor(e/t)}},y={SNAPPING_CONSTANT:20,PANHINT_LENGTH_CONSTANT:10,MINOR_TICKS_COUNT_CONSTANT:4,TICK_LENGTH_CONSTANT:10,ZOOM_DISTANCE_MARGIN:25},w=new function(){function e(e,t,n,i,o,a,r,s,l,c,u){var h,p,f,d,m=e+i,g=e+o,v=n,x=t,b=!1;h=p=f=!0,c?(b=p=f=!0,h=!1,x=t+i,v=t+o,(g=e)<(m=n)&&(d=g,g=m,m=d,h=!0,p=!1)):(h=p=f=!0,b=!1,m=e+i,g=e+o,(x=t)<(v=n)&&(d=x,x=v,v=d,b=!0,f=!1)),g<r.min||m>r.max||x<s.min||v>s.max||(m<r.min&&(m=r.min,h=!1),g>r.max&&(g=r.max,p=!1),v<s.min&&(v=s.min,b=!1),x>s.max&&(x=s.max,f=!1),m=r.p2c(m),v=s.p2c(v),g=r.p2c(g),x=s.p2c(x),a&&(l.fillStyle=a(v,x),l.fillRect(m,x,g-m,v-x)),u>0&&(h||p||f||b)&&(l.beginPath(),l.moveTo(m,v),h?l.lineTo(m,x):l.moveTo(m,x),f?l.lineTo(g,x):l.moveTo(g,x),p?l.lineTo(g,v):l.moveTo(g,v),b?l.lineTo(m,v):l.moveTo(m,v),l.stroke()))}function t(e,t,n,i,o){var a=e.fill;if(!a)return null;if(e.fillColor)return o(e.fillColor,n,i,t);var r=v.parse(t);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}this.drawSeriesLines=function(e,n,i,o,a,r,s){n.save(),n.translate(i.left,i.top),n.lineJoin="round",e.lines.dashes&&n.setLineDash&&n.setLineDash(e.lines.dashes);var l={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(l.points=e.decimate(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var c=e.lines.lineWidth;n.lineWidth=c,n.strokeStyle=e.color;var u=t(e.lines,e.color,0,a,s);u&&(n.fillStyle=u,function(e,t,n,i,o,a){for(var r=e.points,s=e.pointsize,l=i>n.min?Math.min(n.max,i):n.min,c=0,u=1,h=!1,p=0,f=0,d=null,m=null;!(s>0&&c>r.length+s);){var g=r[(c+=s)-s],v=r[c-s+u],x=r[c],b=r[c+u];if(-2===s&&(v=b=l),h){if(s>0&&null!=g&&null==x){f=c,s=-s,u=2;continue}if(s<0&&c===p+s){o.fill(),h=!1,u=1,c=p=f+(s=-s);continue}}if(null!=g&&null!=x){if(a&&(null!==d&&null!==m?(x=g,b=v,g=d,v=m,d=null,m=null,c-=s):v!==b&&g!==x&&(b=v,d=x,m=v)),g<=x&&g<t.min){if(x<t.min)continue;v=(t.min-g)/(x-g)*(b-v)+v,g=t.min}else if(x<=g&&x<t.min){if(g<t.min)continue;b=(t.min-g)/(x-g)*(b-v)+v,x=t.min}if(g>=x&&g>t.max){if(x>t.max)continue;v=(t.max-g)/(x-g)*(b-v)+v,g=t.max}else if(x>=g&&x>t.max){if(g>t.max)continue;b=(t.max-g)/(x-g)*(b-v)+v,x=t.max}if(h||(o.beginPath(),o.moveTo(t.p2c(g),n.p2c(l)),h=!0),v>=n.max&&b>=n.max)o.lineTo(t.p2c(g),n.p2c(n.max)),o.lineTo(t.p2c(x),n.p2c(n.max));else if(v<=n.min&&b<=n.min)o.lineTo(t.p2c(g),n.p2c(n.min)),o.lineTo(t.p2c(x),n.p2c(n.min));else{var y=g,w=x;v<=b&&v<n.min&&b>=n.min?(g=(n.min-v)/(b-v)*(x-g)+g,v=n.min):b<=v&&b<n.min&&v>=n.min&&(x=(n.min-v)/(b-v)*(x-g)+g,b=n.min),v>=b&&v>n.max&&b<=n.max?(g=(n.max-v)/(b-v)*(x-g)+g,v=n.max):b>=v&&b>n.max&&v<=n.max&&(x=(n.max-v)/(b-v)*(x-g)+g,b=n.max),g!==y&&o.lineTo(t.p2c(y),n.p2c(v)),o.lineTo(t.p2c(g),n.p2c(v)),o.lineTo(t.p2c(x),n.p2c(b)),x!==w&&(o.lineTo(t.p2c(x),n.p2c(b)),o.lineTo(t.p2c(w),n.p2c(b)))}}else d=null,m=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,n,e.lines.steps)),c>0&&function(e,t,n,i,o,a,r){var s=e.points,l=e.pointsize,c=null,u=null,h=0,p=0,f=0,d=0,m=null,g=null,v=0,x=function(e){h=s[e-l],p=s[e-l+1],f=s[e],d=s[e+1]},b=function(){return null!==m&&null!==g?(f=h,d=p,h=m,p=g,m=null,g=null,!0):(p!==d&&h!==f&&(d=p,m=f,g=p),!1)},y=function(){if(p<=d&&p<o.min){if(d<o.min)return!0;h=(o.min-p)/(d-p)*(f-h)+h,p=o.min}else if(d<=p&&d<o.min){if(p<o.min)return!0;f=(o.min-p)/(d-p)*(f-h)+h,d=o.min}},w=function(){if(p>=d&&p>o.max){if(d>o.max)return!0;h=(o.max-p)/(d-p)*(f-h)+h,p=o.max}else if(d>=p&&d>o.max){if(p>o.max)return!0;f=(o.max-p)/(d-p)*(f-h)+h,d=o.max}},T=function(){if(h<=f&&h<i.min){if(f<i.min)return!0;p=(i.min-h)/(f-h)*(d-p)+p,h=i.min}else if(f<=h&&f<i.min){if(h<i.min)return!0;d=(i.min-h)/(f-h)*(d-p)+p,f=i.min}},k=function(){if(h>=f&&h>i.max){if(f>i.max)return!0;p=(i.max-h)/(f-h)*(d-p)+p,h=i.max}else if(f>=h&&f>i.max){if(h>i.max)return!0;d=(i.max-h)/(f-h)*(d-p)+p,f=i.max}},M=function(){h===c&&p===u||a.moveTo(i.p2c(h)+0,o.p2c(p)+0),c=f,u=d,a.lineTo(i.p2c(f)+0,o.p2c(d)+0)};for(a.beginPath(),v=l;v<s.length;v+=l)x(v),null!==h&&null!==f?isNaN(h)||isNaN(f)||isNaN(p)||isNaN(d)?(c=null,u=null):(r&&b()&&(v-=l),y()||w()||T()||k()||M()):(m=null,g=null);null!==m&&null!==g&&(x(v),b(),y()||w()||T()||k()||M()),a.stroke()}(l,0,0,e.xaxis,e.yaxis,n,e.lines.steps),n.restore()},this.drawSeriesPoints=function(e,n,i,o,a,r,s){function l(e,t,n,i,o,a){e.moveTo(t+i,n),e.arc(t,n,i,0,o?Math.PI:2*Math.PI,!1)}l.fill=!0,n.save(),n.translate(i.left,i.top);var c={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimatePoints&&(c.points=e.decimatePoints(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var u,h=e.points.lineWidth,p=e.points.radius,f=e.points.symbol;"circle"===f?u=l:"string"==typeof f&&r&&r[f]?u=r[f]:"function"==typeof r&&(u=r),0===h&&(h=1e-4),n.lineWidth=h,n.fillStyle=t(e.points,e.color,null,null,s),n.strokeStyle=e.color,function(e,t,i,o,a,r,s,l){var c=e.points,u=e.pointsize;n.beginPath();for(var h=0;h<c.length;h+=u){var p=c[h],f=c[h+1];null==p||p<r.min||p>r.max||f<s.min||f>s.max||(p=r.p2c(p),f=s.p2c(f)+0,l(n,p,f,t,a,true))}l.fill&&n.fill(),n.stroke()}(c,p,0,0,!1,e.xaxis,e.yaxis,u),n.restore()},this.drawSeriesBars=function(n,i,o,a,r,s,l){i.save(),i.translate(o.left,o.top);var c,u={format:n.datapoints.format,points:n.datapoints.points,pointsize:n.datapoints.pointsize};n.decimate&&(u.points=n.decimate(n,n.xaxis.min,n.xaxis.max,a)),i.lineWidth=n.bars.lineWidth,i.strokeStyle=n.color;var h=n.bars.barWidth[0]||n.bars.barWidth;switch(n.bars.align){case"left":c=0;break;case"right":c=-h;break;default:c=-h/2}!function(t,o,a,r,s,l){for(var c=t.points,u=t.pointsize,h=n.bars.fillTowards||0,p=h>l.min?Math.min(l.max,h):l.min,f=0;f<c.length;f+=u)if(null!=c[f]){var d=3===u?c[f+2]:p;e(c[f],c[f+1],d,o,a,r,s,l,i,n.bars.horizontal,n.bars.lineWidth)}}(u,c,c+h,n.bars.fill?function(e,i){return t(n.bars,n.color,e,i,l)}:null,n.xaxis,n.yaxis),i.restore()},this.drawBar=e};function T(e){var t,n=[],i=b.saturate(b.floorInBase(e.min,e.tickSize)),o=0,a=Number.NaN;i===-Number.MAX_VALUE&&(n.push(i),i=b.floorInBase(e.min+e.tickSize,e.tickSize));do{t=a,a=b.multiplyAdd(e.tickSize,o,i),n.push(a),++o}while(a<e.max&&a!==t);return n}function k(e,t,n){var i=t.tickDecimals;if(-1!==(""+e).indexOf("e"))return M(e,t,n);n>0&&(t.tickDecimals=n);var o=t.tickDecimals?parseFloat("1e"+t.tickDecimals):1,a=""+Math.round(e*o)/o;if(null!=t.tickDecimals){var r=a.indexOf("."),s=-1===r?0:a.length-r-1;s<t.tickDecimals&&(a=(s?a:a+".")+(""+o).substr(1,t.tickDecimals-s))}return t.tickDecimals=i,a}function M(e,t,n){var i=(""+e).indexOf("e"),o=parseInt((""+e).substr(i+1)),a=-1!==i?o:e>0?Math.floor(Math.log(e)/Math.LN10):0,r=parseFloat("1e"+a),s=e/r;if(n){var l=S(e,n);return(e/r).toFixed(l)+"e"+a}return t.tickDecimals>0?s.toFixed(S(e,t.tickDecimals))+"e"+a:s.toFixed()+"e"+a}function S(e,t){var n=Math.log(Math.abs(e))*Math.LOG10E,i=Math.abs(n+t);return i<=20?Math.floor(i):20}function C(e,t,n,i){var h=[],m={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoScaleMargin:null,autoScale:"exact",windowSize:null,growOnly:null,ticks:null,tickFormatter:null,showTickLabels:"major",labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,showMinorTicks:null,showTicks:null,gridLines:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},yaxis:{autoScaleMargin:.02,autoScale:"loose",growOnly:null,position:"left",showTickLabels:"major",offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:1,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,horizontal:!1,barWidth:.8,fill:!0,fillColor:null,align:"left",zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:1,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:15},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},g=null,x=null,M=null,S=null,C=null,P=[],L=[],N={left:0,right:0,top:0,bottom:0},E=0,z=0,A={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],setupGrid:[],adjustSeriesDataRange:[],setRange:[],drawBackground:[],drawSeries:[],drawAxis:[],draw:[],findNearbyItems:[],axisReserveSpace:[],bindEvents:[],drawOverlay:[],resize:[],shutdown:[]},O=this,I={},R=null;O.setData=F,O.setupGrid=_,O.draw=$,O.getPlaceholder=function(){return e},O.getCanvas=function(){return g.element},O.getSurface=function(){return g},O.getEventHolder=function(){return M},O.getPlotOffset=function(){return N},O.width=function(){return E},O.height=function(){return z},O.offset=function(){var e=M.getBoundingClientRect(),t={left:e.left+window.scrollX,top:e.top+window.scrollY};return t.left+=N.left,t.top+=N.top,t},O.getData=function(){return h},O.getAxes=function(){var e={};return P.concat(L).forEach(function(t){t&&(e[t.direction+(1!==t.n?t.n:"")+"axis"]=t)}),e},O.getXAxes=function(){return P},O.getYAxes=function(){return L},O.c2p=function(e){var t,n,i={};for(t=0;t<P.length;++t)(n=P[t])&&n.used&&(i["x"+n.n]=n.c2p(e.left));for(t=0;t<L.length;++t)(n=L[t])&&n.used&&(i["y"+n.n]=n.c2p(e.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i},O.p2c=function(e){var t,n,i,o={};for(t=0;t<P.length;++t)if((n=P[t])&&n.used&&(null==e[i="x"+n.n]&&1===n.n&&(i="x"),null!=e[i])){o.left=n.p2c(e[i]);break}for(t=0;t<L.length;++t)if((n=L[t])&&n.used&&(null==e[i="y"+n.n]&&1===n.n&&(i="y"),null!=e[i])){o.top=n.p2c(e[i]);break}return o},O.getOptions=function(){return m},O.triggerRedrawOverlay=he,O.pointOffset=function(e){return{left:parseInt(P[X(e,"x")-1].p2c(+e.x)+N.left,10),top:parseInt(L[X(e,"y")-1].p2c(+e.y)+N.top,10)}},O.shutdown=H,O.destroy=function(){var t,n;H(),t=e,(n=l.get(t))&&delete n.plot,e.innerHTML="",h=[],m=null,g=null,x=null,M=null,S=null,C=null,P=[],L=[],A=null,O=null},O.resize=function(){var t=a(e),n=r(e);g.resize(t,n),x.resize(t,n),Y(A.resize,[t,n])},O.clearTextCache=function(){g.clearCache(),x.clearCache()},O.autoScaleAxis=U,O.computeRangeForDataSeries=function(e,t,n){for(var i=e.datapoints.points,o=e.datapoints.pointsize,a=e.datapoints.format,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l={xmin:r,ymin:r,xmax:s,ymax:s},c=0;c<i.length;c+=o)if(null!==i[c]&&("function"!=typeof n||n(i[c])))for(var u=0;u<o;++u){var h=i[c+u],p=a[u];null!=p&&("function"!=typeof n||n(h))&&(t||p.computeRange)&&h!==1/0&&h!==-1/0&&(!0===p.x&&(h<l.xmin&&(l.xmin=h),h>l.xmax&&(l.xmax=h)),!0===p.y&&(h<l.ymin&&(l.ymin=h),h>l.ymax&&(l.ymax=h)))}return l},O.adjustSeriesDataRange=function(e,t){if(e.bars.show){var n,i=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!i&&function(e){var t=[],n=e.datapoints.pointsize,i=Number.MAX_VALUE;e.datapoints.points.length<=n&&(i=1);for(let i=e.bars.horizontal?1:0;i<e.datapoints.points.length;i+=n)isFinite(e.datapoints.points[i])&&null!==e.datapoints.points[i]&&t.push(e.datapoints.points[i]);(t=t.filter(function(e,t,n){return n.indexOf(e)===t})).sort(function(e,t){return e-t});for(let e=1;e<t.length;e++){var o=Math.abs(t[e]-t[e-1]);o<i&&isFinite(o)&&(i=o)}"number"==typeof e.bars.barWidth?e.bars.barWidth=e.bars.barWidth*i:e.bars.barWidth[0]=e.bars.barWidth[0]*i}(e);var o=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":n=0;break;case"right":n=-o;break;default:n=-o/2}e.bars.horizontal?(t.ymin+=n,t.ymax+=n+o):(t.xmin+=n,t.xmax+=n+o)}return(e.bars.show&&e.bars.zero||e.lines.show&&e.lines.zero)&&e.datapoints.pointsize<=2&&(t.ymin=Math.min(0,t.ymin),t.ymax=Math.max(0,t.ymax)),t},O.findNearbyItem=function(e,t,n,i,o){var a=le(e,t,n,i,o);return void 0!==a[0]?a[0]:null},O.findNearbyItems=le,O.findNearbyInterpolationPoint=function(e,t,n){var i,o,a,r,s,l,c,u=Number.MAX_VALUE;for(i=0;i<h.length;++i){if(!n(i))continue;var p=h[i].datapoints.points;l=h[i].datapoints.pointsize;const v=p[p.length-l]<p[0]?function(e,t){return e>t}:function(e,t){return t>e};if(!v(e,p[0])){for(o=l;o<p.length&&!v(e,p[o]);o+=l);var f=p[o-l],d=p[o-l+1],m=p[o],g=p[o+1];void 0!==f&&void 0!==m&&void 0!==d&&void 0!==g&&(t=f===m?g:d+(g-d)*(e-f)/(m-f),(a=(r=Math.abs(h[i].xaxis.p2c(m)-e))*r+(s=Math.abs(h[i].yaxis.p2c(g)-t))*s)<u&&(u=a,c=[e,t,i,o]))}}return c?(i=c[2],o=c[3],l=h[i].datapoints.pointsize,f=(p=h[i].datapoints.points)[o-l],d=p[o-l+1],m=p[o],g=p[o+1],{datapoint:[c[0],c[1]],leftPoint:[f,d],rightPoint:[m,g],seriesIndex:i}):null},O.computeValuePrecision=Z,O.computeTickSize=J,O.addEventHandler=function(e,t,n,i){var o=n+e,a=I[o]||[];a.push({event:e,handler:t,eventHolder:n,priority:i}),a.sort((e,t)=>t.priority-e.priority),a.forEach(e=>{f(e.eventHolder,e.event,e.handler),p(e.eventHolder,e.event,e.handler)}),I[o]=a},O.hooks=A;var W=y.MINOR_TICKS_COUNT_CONSTANT,D=y.TICK_LENGTH_CONSTANT;function Y(e,t){t=[O].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function F(e){var t=h;h=function(e){for(var t=[],n=0;n<e.length;++n){var i=o(!0,{},m.series);null!=e[n].data?(i.data=e[n].data,delete e[n].data,o(!0,i,e[n]),e[n].data=i.data):i.data=e[n],t.push(i)}return t}(e),function(){var e,t=h.length,n=-1;for(e=0;e<h.length;++e){var i=h[e].color;null!=i&&(t--,"number"==typeof i&&i>n&&(n=i))}t<=n&&(t=n+1);var o,a=[],r=m.colors,s=r.length,l=0,c=Math.max(0,h.length-t);for(e=0;e<t;e++)o=v.parse(r[(c+e)%s]||"#666"),e%s===0&&e&&(l=l>=0?l<.5?-l-.2:0:-l),a[e]=o.scale("rgb",1+l);var u,p=0;for(e=0;e<h.length;++e){if(null==(u=h[e]).color?(u.color=a[p].toString(),++p):"number"==typeof u.color&&(u.color=a[u.color].toString()),null==u.lines.show){var f,d=!0;for(f in u)if(u[f]&&u[f].show){d=!1;break}d&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=G(P,X(u,"x")),u.yaxis=G(L,X(u,"y"))}}(),function(e){var t,n,i,o,a,r,s,l,c,u,p,f,d=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;function g(e,t,n){t<e.datamin&&t!==-1/0&&(e.datamin=t),n>e.datamax&&n!==1/0&&(e.datamax=n)}function v(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(B().forEach(function(e){!0!==e.options.growOnly?(e.datamin=d,e.datamax=m):(void 0===e.datamin&&(e.datamin=d),void 0===e.datamax&&(e.datamax=m)),e.used=!1}),t=0;t<h.length;++t)(a=h[t]).datapoints={points:[]},0===a.datapoints.points.length&&(a.datapoints.points=v(e,t)),Y(A.processRawData,[a,a.data,a.datapoints]);for(t=0;t<h.length;++t)if(p=(a=h[t]).data,(f=a.datapoints.format)||((f=[]).push({x:!0,y:!1,number:!0,required:!0,computeRange:"none"!==a.xaxis.options.autoScale,defaultValue:null}),f.push({x:!1,y:!0,number:!0,required:!0,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:null}),(a.stack||a.bars.show||a.lines.show&&a.lines.fill)&&(null!=a.datapoints.pointsize?a.datapoints.pointsize:a.data&&a.data[0]&&a.data[0].length?a.data[0].length:3)>2&&f.push({x:a.bars.horizontal,y:!a.bars.horizontal,number:!0,required:!1,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:0}),a.datapoints.format=f),a.xaxis.used=a.yaxis.used=!0,null==a.datapoints.pointsize){for(a.datapoints.pointsize=f.length,s=a.datapoints.pointsize,r=a.datapoints.points,n=i=0;n<p.length;++n,i+=s){var x=null==(u=p[n]);if(!x)for(o=0;o<s;++o)l=u[o],(c=f[o])&&(c.number&&null!=l&&(l=+l,isNaN(l)&&(l=null)),null==l&&(c.required&&(x=!0),null!=c.defaultValue&&(l=c.defaultValue))),r[i+o]=l;if(x)for(o=0;o<s;++o)null!=(l=r[i+o])&&(c=f[o]).computeRange&&(c.x&&g(a.xaxis,l,l),c.y&&g(a.yaxis,l,l)),r[i+o]=null}r.length=i}for(t=0;t<h.length;++t)a=h[t],Y(A.processDatapoints,[a,a.datapoints]);for(t=0;t<h.length;++t)if(!(f=(a=h[t]).datapoints.format).every(function(e){return!e.computeRange})){var b=O.adjustSeriesDataRange(a,O.computeRangeForDataSeries(a));Y(A.adjustSeriesDataRange,[a,b]),g(a.xaxis,b.xmin,b.xmax),g(a.yaxis,b.ymin,b.ymax)}B().forEach(function(e){e.datamin===d&&(e.datamin=null),e.datamax===m&&(e.datamax=null)})}(t)}function X(e,t){var n=e[t+"axis"];return"object"==typeof n&&(n=n.n),"number"!=typeof n&&(n=1),n}function B(){return P.concat(L).filter(function(e){return e})}function G(e,t){return e[t-1]||(e[t-1]={n:t,direction:e===P?"x":"y",options:o(!0,{},e===P?m.xaxis:m.yaxis)}),e[t-1]}function H(){R&&window.clearTimeout(R),Y(A.shutdown,[M])}function j(e){function t(e){return e}var n,i,o=e.options.transform||t,a=e.options.inverseTransform;"x"===e.direction?(n=isFinite(o(e.max)-o(e.min))?e.scale=E/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(b.delta(o(e.min),o(e.max),E)),i=Math.min(o(e.max),o(e.min))):(n=-(n=isFinite(o(e.max)-o(e.min))?e.scale=z/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(b.delta(o(e.min),o(e.max),z))),i=Math.max(o(e.max),o(e.min))),e.p2c=o===t?function(e){return isFinite(e-i)?(e-i)*n:(e/4-i/4)*n*4}:function(e){var t=o(e);return isFinite(t-i)?(t-i)*n:(t/4-i/4)*n*4},e.c2p=a?function(e){return a(i+e/n)}:function(e){return i+e/n}}function V(e){Y(A.axisReserveSpace,[e]);var t=e.labelWidth,n=e.labelHeight,i=e.options.position,o="x"===e.direction,a=e.options.tickLength,r=e.options.showTicks,s=e.options.showMinorTicks,l=e.options.gridLines,c=m.grid.axisMargin,u=m.grid.labelMargin,h=!0,p=!0,f=!1;(o?P:L).forEach(function(t){t&&(t.show||t.reserveSpace)&&(t===e?f=!0:t.options.position===i&&(f?p=!1:h=!1))}),p&&(c=0),null==a&&(a=D),null==r&&(r=!0),null==s&&(s=!0),null==l&&(l=!!h),isNaN(+a)||(u+=r?+a:0),o?(n+=u,"bottom"===i?(N.bottom+=n+c,e.box={top:g.height-N.bottom,height:n}):(e.box={top:N.top+c,height:n},N.top+=n+c)):(t+=u,"left"===i?(e.box={left:N.left+c,width:t},N.left+=t+c):(N.right+=t+c,e.box={left:g.width-N.right,width:t})),e.position=i,e.tickLength=a,e.showMinorTicks=s,e.showTicks=r,e.gridLines=l,e.box.padding=u,e.innermost=h}function q(e,t,n){"x"===e.direction?("bottom"===e.position&&n(t.bottom)&&(e.box.top-=Math.ceil(t.bottom)),"top"===e.position&&n(t.top)&&(e.box.top+=Math.ceil(t.top))):("left"===e.position&&n(t.left)&&(e.box.left+=Math.ceil(t.left)),"right"===e.position&&n(t.right)&&(e.box.left-=Math.ceil(t.right)))}function _(e){var t,n,i=B(),o=m.grid.show;for(n in N)N[n]=0;for(n in Y(A.processOffset,[N]),N)"object"==typeof m.grid.borderWidth?N[n]+=o?m.grid.borderWidth[n]:0:N[n]+=o?m.grid.borderWidth:0;if(i.forEach(function(t){var n=t.options;t.show=null==n.show?t.used:n.show,t.reserveSpace=null==n.reserveSpace?t.show:n.reserveSpace,function(e){var t=e.options;e.tickFormatter||("function"==typeof t.tickFormatter?e.tickFormatter=function(){var e=Array.prototype.slice.call(arguments);return""+t.tickFormatter.apply(null,e)}:e.tickFormatter=k)}(t),Y(A.setRange,[t,e]),function(e,t){var n="number"==typeof e.options.min?e.options.min:e.min,i="number"==typeof e.options.max?e.options.max:e.max,o=e.options.offset;if(t&&(U(e),n=e.autoScaledMin,i=e.autoScaledMax),(n=(null!=n?n:-1)+(o.below||0))>(i=(null!=i?i:1)+(o.above||0))){var a=n;n=i,i=a,e.options.offset={above:0,below:0}}e.min=b.saturate(n),e.max=b.saturate(i)}(t,e)}),o){E=g.width-N.left-N.right,z=g.height-N.bottom-N.top;var a=i.filter(function(e){return e.show||e.reserveSpace});for(a.forEach(function(e){!function(e){var t,n=e.options;t=K(e.direction,g,n.ticks),e.delta=b.delta(e.min,e.max,t);var i=O.computeValuePrecision(e.min,e.max,e.direction,t,n.tickDecimals);if(e.tickDecimals=Math.max(0,null!=n.tickDecimals?n.tickDecimals:i),e.tickSize=function(e,t,n,i,o){var a=J(e,t,"number"==typeof i.ticks&&i.ticks>0?i.ticks:.3*Math.sqrt("x"===n?g.width:g.height),o);return null!=i.minTickSize&&a<i.minTickSize&&(a=i.minTickSize),i.tickSize||a}(e.min,e.max,e.direction,n,n.tickDecimals),e.tickGenerator||("function"==typeof n.tickGenerator?e.tickGenerator=n.tickGenerator:e.tickGenerator=T),null!=n.alignTicksWithAxis){var o=("x"===e.direction?P:L)[n.alignTicksWithAxis-1];if(o&&o.used&&o!==e){var a=e.tickGenerator(e,O);if(a.length>0&&(null==n.min&&(e.min=Math.min(e.min,a[0])),null==n.max&&a.length>1&&(e.max=Math.max(e.max,a[a.length-1]))),e.tickGenerator=function(e){var t,n,i=[];for(n=0;n<o.ticks.length;++n)t=(o.ticks[n].v-o.min)/(o.max-o.min),t=e.min+t*(e.max-e.min),i.push(t);return i},!e.mode&&null==n.tickDecimals&&e.delta>0){var r=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),s=e.tickGenerator(e,O);s.length>1&&/\..*0$/.test((s[1]-s[0]).toFixed(r))||(e.tickDecimals=r)}}}}(e),function(e){var t,n,i=e.options.ticks,o=[];for(null==i||"number"==typeof i&&i>0?o=e.tickGenerator(e,O):i&&(o="function"==typeof i?i(e):i),e.ticks=[],t=0;t<o.length;++t){var a=null,r=o[t];"object"==typeof r?(n=+r[0],r.length>1&&(a=r[1])):n=+r,isNaN(n)||e.ticks.push(Q(n,a,e,"major"))}}(e),function(e,t,n){"loose"===e.options.autoScale&&t.length>0&&function(e){return e.some(e=>e.datapoints.points.length>0)}(n)&&(e.min=Math.min(e.min,t[0].v),e.max=Math.max(e.max,t[t.length-1].v))}(e,e.ticks,h),j(e),function(e,t){(function(e,t){if("endpoints"===e.options.showTickLabels)return!0;if("all"===e.options.showTickLabels){var n=t.filter(function(t){return t.bars.horizontal?t.yaxis===e:t.xaxis===e}),i=n.some(function(e){return!e.bars.show});return 0===n.length||i}return"major"!==e.options.showTickLabels&&"none"!==e.options.showTickLabels&&void 0})(e,t)&&(e.ticks.unshift(Q(e.min,null,e,"min")),e.ticks.push(Q(e.max,null,e,"max")))}(e,h),function(e){for(var t=e.options,n="none"!==t.showTickLabels&&e.ticks?e.ticks:[],i="major"===t.showTickLabels||"all"===t.showTickLabels,o="endpoints"===t.showTickLabels||"all"===t.showTickLabels,a=t.labelWidth||0,r=t.labelHeight||0,s=e.direction+"Axis "+e.direction+e.n+"Axis",l="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,c=t.font||"flot-tick-label tickLabel",u=0;u<n.length;++u){var h=n[u],p=h.label;if(h.label&&!(!1===i&&u>0&&u<n.length-1)&&(!1!==o||0!==u&&u!==n.length-1)){"object"==typeof h.label&&(p=h.label.name);var f=g.getTextInfo(l,p,c);a=Math.max(a,f.width),r=Math.max(r,f.height)}}e.labelWidth=t.labelWidth||a,e.labelHeight=t.labelHeight||r}(e)}),t=a.length-1;t>=0;--t)V(a[t]);!function(){var e,t=m.grid.minBorderMargin;if(null==t)for(t=0,e=0;e<h.length;++e)t=Math.max(t,2*(h[e].points.radius+h[e].points.lineWidth/2));var n,i={},o={left:t,right:t,top:t,bottom:t};for(n in B().forEach(function(e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(o.left=Math.max(o.left,e.labelWidth/2),o.right=Math.max(o.right,e.labelWidth/2)):(o.bottom=Math.max(o.bottom,e.labelHeight/2),o.top=Math.max(o.top,e.labelHeight/2)))}),o)i[n]=o[n]-N[n];P.concat(L).forEach(function(e){q(e,i,function(e){return e>0})}),N.left=Math.ceil(Math.max(o.left,N.left)),N.right=Math.ceil(Math.max(o.right,N.right)),N.top=Math.ceil(Math.max(o.top,N.top)),N.bottom=Math.ceil(Math.max(o.bottom,N.bottom))}(),a.forEach(function(e){!function(e){"x"===e.direction?(e.box.left=N.left-e.labelWidth/2,e.box.width=g.width-N.left-N.right+e.labelWidth):(e.box.top=N.top-e.labelHeight/2,e.box.height=g.height-N.bottom-N.top+e.labelHeight)}(e)})}if(m.grid.margin){for(n in N){var r=m.grid.margin||0;N[n]+="number"==typeof r?r:r[n]||0}P.concat(L).forEach(function(e){q(e,m.grid.margin,function(e){return null!=e})})}E=g.width-N.left-N.right,z=g.height-N.bottom-N.top,i.forEach(function(e){j(e)}),o&&B().forEach(function(e){var t,n,i,o,a,r,s,l=e.box,c=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+c,h=e.options.font||"flot-tick-label tickLabel",p={x:NaN,y:NaN,width:NaN,height:NaN},f=[],d=function(t,c){return!t||!t.label||t.v<e.min||t.v>e.max?p:(r=g.getTextInfo(u,t.label,h),"x"===e.direction?(o="center",n=N.left+e.p2c(t.v),"bottom"===e.position?i=l.top+l.padding-e.boxPosition.centerY:(i=l.top+l.height-l.padding+e.boxPosition.centerY,a="bottom"),s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}):(a="middle",i=N.top+e.p2c(t.v),"left"===e.position?(n=l.left+l.width-l.padding-e.boxPosition.centerX,o="right"):n=l.left+l.padding+e.boxPosition.centerX,s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}),function(e,t){return t.some(function(t){return n=e.x,i=e.y,o=e.x+e.width,a=e.y+e.height,r=t.x,s=t.y,l=t.x+t.width,c=t.y+t.height,(n<=r&&r<=o||r<=n&&n<=l)&&(i<=s&&s<=a||s<=i&&i<=c);var n,i,o,a,r,s,l,c})}(s,c)?p:(g.addText(u,n,i,t.label,h,null,null,o,a),s))};if(g.removeText(u),Y(A.drawAxis,[e,g]),e.show)switch(e.options.showTickLabels){case"none":break;case"endpoints":f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f));break;case"major":for(f.push(d(e.ticks[0],f)),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f));break;case"all":for(f.push(d(e.ticks[0],[])),f.push(d(e.ticks[e.ticks.length-1],f)),t=1;t<e.ticks.length-1;++t)f.push(d(e.ticks[t],f))}}),Y(A.setupGrid,[])}function U(e){var t,n=e.options,i=n.min,o=n.max,a=e.datamin,r=e.datamax;switch(n.autoScale){case"none":i=+(null!=n.min?n.min:a),o=+(null!=n.max?n.max:r);break;case"loose":if(null!=a&&null!=r){i=a,o=r,t=b.saturate(o-i);var s="number"==typeof n.autoScaleMargin?n.autoScaleMargin:.02;i=b.saturate(i-t*s),o=b.saturate(o+t*s),i<0&&a>=0&&(i=0)}else i=n.min,o=n.max;break;case"exact":i=null!=a?a:n.min,o=null!=r?r:n.max;break;case"sliding-window":r>o&&(o=r,i=Math.max(r-(n.windowSize||100),i))}var l=function(e,t){var n=void 0===e?null:e,i=void 0===t?null:t;if(0===i-n){var o=0===i?1:.01,a=null;null==n&&(a-=o),null!=i&&null==n||(i+=o),null!=a&&(n=a)}return{min:n,max:i}}(i,o);i=l.min,o=l.max,!0===n.growOnly&&"none"!==n.autoScale&&"sliding-window"!==n.autoScale&&(i=i<a?i:null!==a?a:i,o=o>r?o:null!==r?r:o),e.autoScaledMin=i,e.autoScaledMax=o}function Z(e,t,n,i,o){var a=K(n,g,i),r=b.delta(e,t,a),s=-Math.floor(Math.log(r)/Math.LN10);o&&s>o&&(s=o);var l=r/parseFloat("1e"+-s);return l>2.25&&l<3&&(null==o||s+1<=o)&&++s,isFinite(s)?s:0}function J(e,t,n,i){var o=b.delta(e,t,n),a=-Math.floor(Math.log(o)/Math.LN10);i&&a>i&&(a=i);var r,s=parseFloat("1e"+-a),l=o/s;return l<1.5?r=1:l<3?(r=2,l>2.25&&(null==i||a+1<=i)&&(r=2.5)):r=l<7.5?5:10,r*s}function K(e,t,n){return"number"==typeof n&&n>0?n:.3*Math.sqrt("x"===e?t.width:t.height)}function Q(e,t,n,i){if(null===t)switch(i){case"min":case"max":var o=function(e,t){var n=Math.floor(t.p2c(e)),i="x"===t.direction?n+1:n-1;return Z(t.c2p(n),t.c2p(i),t.direction,1)}(e,n);isFinite(o),t=n.tickFormatter(e,n,o,O);break;case"major":t=n.tickFormatter(e,n,void 0,O)}return{v:e,label:t}}function $(){g.clear(),Y(A.drawBackground,[S]);var e=m.grid;e.show&&e.backgroundColor&&(S.save(),S.translate(N.left,N.top),S.fillStyle=fe(m.grid.backgroundColor,z,0,"rgba(255, 255, 255, 0)"),S.fillRect(0,0,E,z),S.restore()),e.show&&!e.aboveData&&re();for(var t=0;t<h.length;++t)Y(A.drawSeries,[S,h[t],t,fe]),se(h[t]);Y(A.draw,[S]),e.show&&e.aboveData&&re(),g.render(),he()}function ee(e,t){for(var n,i,o,a,r=B(),s=0;s<r.length;++s)if((n=r[s]).direction===t&&(e[a=t+n.n+"axis"]||1!==n.n||(a=t+"axis"),e[a])){i=e[a].from,o=e[a].to;break}if(e[a]||(n="x"===t?P[0]:L[0],i=e[t+"1"],o=e[t+"2"]),null!=i&&null!=o&&i>o){var l=i;i=o,o=l}return{from:i,to:o,axis:n}}function te(e){var t=e.box,n=0,i=0;return"x"===e.direction?(n=0,i=t.top-N.top+("top"===e.position?t.height:0)):(i=0,n=t.left-N.left+("left"===e.position?t.width:0)+e.boxPosition.centerX),{x:n,y:i}}function ne(e,t){return e%2!=0?Math.floor(t)+.5:t}function ie(e){S.lineWidth=1;var t=te(e),n=t.x,i=t.y;if(e.show){var o=0,a=0;S.strokeStyle=e.options.color,S.beginPath(),"x"===e.direction?o=E+1:a=z+1,"x"===e.direction?i=ne(S.lineWidth,i):n=ne(S.lineWidth,n),S.moveTo(n,i),S.lineTo(n+o,i+a),S.stroke()}}function oe(e){var t=e.tickLength,n=e.showMinorTicks,i=W,o=te(e),a=o.x,r=o.y,s=0;for(S.strokeStyle=e.options.color,S.beginPath(),s=0;s<e.ticks.length;++s){var l,c=e.ticks[s].v,u=0,h=0,p=0,f=0;if(!isNaN(c)&&c>=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),h=t,"top"===e.position&&(h=-h)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=ne(S.lineWidth,a):r=ne(S.lineWidth,r),S.moveTo(a,r),S.lineTo(a+u,r+h)),!0===n&&s<e.ticks.length-1){var d=e.ticks[s].v,m=(e.ticks[s+1].v-d)/(i+1);for(l=1;l<=i;l++){if("x"===e.direction){if(f=t/2,a=ne(S.lineWidth,e.p2c(d+l*m)),"top"===e.position&&(f=-f),a<0||a>E)continue}else if(p=t/2,r=ne(S.lineWidth,e.p2c(d+l*m)),"left"===e.position&&(p=-p),r<0||r>z)continue;S.moveTo(a,r),S.lineTo(a+p,r+f)}}}S.stroke()}function ae(e){var t,n=function(t){var n=m.grid.borderWidth;return("object"==typeof n&&n[e.position]>0||n>0)&&(t===e.min||t===e.max)};for(S.strokeStyle=m.grid.tickColor,S.beginPath(),t=0;t<e.ticks.length;++t){var i=e.ticks[t].v,o=0,a=0,r=0,s=0;isNaN(i)||i<e.min||i>e.max||n(i)||("x"===e.direction?(r=e.p2c(i),s=z,a=-z):(r=0,s=e.p2c(i),o=E),"x"===e.direction?r=ne(S.lineWidth,r):s=ne(S.lineWidth,s),S.moveTo(r,s),S.lineTo(r+o,s+a))}S.stroke()}function re(){var e,t;S.save(),S.translate(N.left,N.top),function(){var e,t=m.grid.markings;if(t){if("function"==typeof t&&((e=O.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,t=t(e)),!t)return;var n;for(n=0;n<t.length;++n){var i=t[n],o=ee(i,"x"),a=ee(i,"y");if(null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==a.from&&(a.from=a.axis.min),null==a.to&&(a.to=a.axis.max),!(o.to<o.axis.min||o.from>o.axis.max||a.to<a.axis.min||a.from>a.axis.max)){o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max);var r=o.from===o.to,s=a.from===a.to;if(!r||!s)if(o.from=Math.floor(o.axis.p2c(o.from)),o.to=Math.floor(o.axis.p2c(o.to)),a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r||s){var l=i.lineWidth||m.grid.markingsLineWidth,c=l%2?.5:0;S.beginPath(),S.strokeStyle=i.color||m.grid.markingsColor,S.lineWidth=l,r?(S.moveTo(o.to+c,a.from),S.lineTo(o.to+c,a.to)):(S.moveTo(o.from,a.to+c),S.lineTo(o.to,a.to+c)),S.stroke()}else S.fillStyle=i.color||m.grid.markingsColor,S.fillRect(o.from,a.to,o.to-o.from,a.from-a.to)}}}}(),e=B(),t=m.grid.borderWidth;for(var n=0;n<e.length;++n){var i=e[n];i.show&&(ie(i),!0===i.showTicks&&oe(i),!0===i.gridLines&&ae(i))}t&&function(){var e=m.grid.borderWidth,t=m.grid.borderColor;"object"==typeof e||"object"==typeof t?("object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),"object"!=typeof t&&(t={top:t,right:t,bottom:t,left:t}),e.top>0&&(S.strokeStyle=t.top,S.lineWidth=e.top,S.beginPath(),S.moveTo(0-e.left,0-e.top/2),S.lineTo(E,0-e.top/2),S.stroke()),e.right>0&&(S.strokeStyle=t.right,S.lineWidth=e.right,S.beginPath(),S.moveTo(E+e.right/2,0-e.top),S.lineTo(E+e.right/2,z),S.stroke()),e.bottom>0&&(S.strokeStyle=t.bottom,S.lineWidth=e.bottom,S.beginPath(),S.moveTo(E+e.right,z+e.bottom/2),S.lineTo(0,z+e.bottom/2),S.stroke()),e.left>0&&(S.strokeStyle=t.left,S.lineWidth=e.left,S.beginPath(),S.moveTo(0-e.left/2,z+e.bottom),S.lineTo(0-e.left/2,0),S.stroke())):(S.lineWidth=e,S.strokeStyle=m.grid.borderColor,S.strokeRect(-e/2,-e/2,E+e,z+e))}(),S.restore()}function se(e){e.lines.show&&w.drawSeriesLines(e,S,N,E,z,O.drawSymbol,fe),e.bars.show&&w.drawSeriesBars(e,S,N,E,z,O.drawSymbol,fe),e.points.show&&w.drawSeriesPoints(e,S,N,E,z,O.drawSymbol,fe)}function le(e,t,n,i,o){for(var a=function(e,t,n,i,o){var a,r=[],s=[],l=i*i+1;for(a=h.length-1;a>=0;--a)if(n(a)){var c=h[a];if(!c.datapoints)return;var u=!1;if(c.lines.show||c.points.show){var p=ce(c,e,t,i,o);p&&(s.push({seriesIndex:a,dataIndex:p.dataIndex,distance:p.distance}),u=!0)}if(c.bars.show&&!u){var f=ue(c,e,t);f>=0&&s.push({seriesIndex:a,dataIndex:f,distance:l})}}for(a=0;a<s.length;a++){var d=s[a].seriesIndex,m=s[a].dataIndex,g=s[a].distance,v=h[d].datapoints.pointsize;r.push({datapoint:h[d].datapoints.points.slice(m*v,(m+1)*v),dataIndex:m,series:h[d],seriesIndex:d,distance:Math.sqrt(g)})}return r}(e,t,n,i,o),r=0;r<h.length;++r)n(r)&&Y(A.findNearbyItems,[e,t,h,r,i,o,a]);return a.sort((e,t)=>void 0===t.distance?-1:void 0===e.distance&&void 0!==t.distance?1:e.distance-t.distance)}function ce(e,t,n,i,o){var a=e.xaxis.c2p(t),r=e.yaxis.c2p(n),s=i/e.xaxis.scale,l=i/e.yaxis.scale,c=e.datapoints.points,u=e.datapoints.pointsize,h=o?i:i*i;e.xaxis.options.inverseTransform&&(s=Number.MAX_VALUE),e.yaxis.options.inverseTransform&&(l=Number.MAX_VALUE);for(var p=null,f=0;f<c.length;f+=u){var d=c[f],m=c[f+1];if(null!=d&&!(d-a>s||d-a<-s||m-r>l||m-r<-l)){var g=Math.abs(e.xaxis.p2c(d)-t),v=Math.abs(e.yaxis.p2c(m)-n),x=o?o(g,v):g*g+v*v;x<h&&(h=x,p={dataIndex:f/u,distance:x})}}return p}function ue(e,t,n){var i,o,a=e.bars.barWidth[0]||e.bars.barWidth,r=e.xaxis.c2p(t),s=e.yaxis.c2p(n),l=e.datapoints.points,c=e.datapoints.pointsize;switch(e.bars.align){case"left":i=0;break;case"right":i=-a;break;default:i=-a/2}o=i+a;for(var u=e.bars.fillTowards||0,h=u>e.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,p=-1,f=0;f<l.length;f+=c){var d=l[f],m=l[f+1];if(null!=d){var g=3===c?l[f+2]:h;(e.bars.horizontal?r<=Math.max(g,d)&&r>=Math.min(g,d)&&s>=m+i&&s<=m+o:r>=d+i&&r<=d+o&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(p=f/c)}}return p}function he(){var e=m.interaction.redrawOverlayInterval;-1!==e?R||(R=window.setTimeout(function(){pe(O)},e)):pe()}function pe(e){if(R=null,C){x.clear(),Y(A.drawOverlay,[C,x]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),u(e.getPlaceholder(),"drawingdone")}}function fe(e,t,n,i){if("string"==typeof e)return e;if(!isFinite(n)||!isFinite(t))return i;for(var o=S.createLinearGradient(0,n,0,t),a=0,r=e.colors.length;a<r;++a){var s=e.colors[a];if("string"!=typeof s){var l=v.parse(i);null!=s.brightness&&(l=l.scale("rgb",s.brightness)),null!=s.opacity&&(l.a*=s.opacity),s=l.toString()}o.addColorStop(a/(r-1),s)}return o}!function(){for(var e={Canvas:d},t=0;t<i.length;++t){var n=i[t];n.init(O,e),n.options&&o(!0,m,n.options)}}(),function(){s(e,"padding",0),Array.from(e.children).filter(function(e){return!e.classList.contains("flot-overlay")&&!e.classList.contains("flot-base")}).forEach(function(e){e.remove()}),"static"===s(e,"position")&&s(e,"position","relative"),g=new d("flot-base",e),x=new d("flot-overlay",e),S=g.context,C=x.context,f(M=x.element);var t=c(e,"plot");t&&(t.shutdown(),x.clear()),c(e,"plot",O)}(),function(t){o(!0,m,t),t&&t.colors&&(m.colors=t.colors),null==m.xaxis.color&&(m.xaxis.color=v.parse(m.grid.color).scale("a",.22).toString()),null==m.yaxis.color&&(m.yaxis.color=v.parse(m.grid.color).scale("a",.22).toString()),null==m.xaxis.tickColor&&(m.xaxis.tickColor=m.grid.tickColor||m.xaxis.color),null==m.yaxis.tickColor&&(m.yaxis.tickColor=m.grid.tickColor||m.yaxis.color),null==m.grid.borderColor&&(m.grid.borderColor=m.grid.color),null==m.grid.tickColor&&(m.grid.tickColor=v.parse(m.grid.color).scale("a",.22).toString());var n,i,a,r=s(e,"font-size"),l=r?+r.replace("px",""):13,c={style:s(e,"font-style"),size:Math.round(.8*l),variant:s(e,"font-variant"),weight:s(e,"font-weight"),family:s(e,"font-family")};for(a=m.xaxes.length||1,n=0;n<a;++n)(i=m.xaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},m.xaxis,i),m.xaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(a=m.yaxes.length||1,n=0;n<a;++n)(i=m.yaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},m.yaxis,i),m.yaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(n=0;n<m.xaxes.length;++n)G(P,n+1).options=m.xaxes[n];for(n=0;n<m.yaxes.length;++n)G(L,n+1).options=m.yaxes[n];for(var u in B().forEach(function(e){e.boxPosition=e.options.boxPosition||{centerX:0,centerY:0}}),A)m.hooks[u]&&m.hooks[u].length&&(A[u]=A[u].concat(m.hooks[u]));Y(A.processOptions,[m])}(n),F(t),_(!0),$(),Y(A.bindEvents,[M])}var P=[];function L(e,t,n){return new C("string"==typeof e?document.querySelector(e):e,t,n,P)}var N=T;function E(e,t,n,i){if(t.points.errorbars){var o=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}],a=t.points.errorbars;"x"!==a&&"xy"!==a||(t.points.xerr.asymmetric?(o.push({x:!0,number:!0,required:!0}),o.push({x:!0,number:!0,required:!0})):o.push({x:!0,number:!0,required:!0})),"y"!==a&&"xy"!==a||(t.points.yerr.asymmetric?(o.push({y:!0,number:!0,required:!0}),o.push({y:!0,number:!0,required:!0})):o.push({y:!0,number:!0,required:!0})),i.format=o}}function z(e,t){var n=e.datapoints.points,i=null,o=null,a=null,r=null,s=e.points.xerr,l=e.points.yerr,c=e.points.errorbars;"x"===c||"xy"===c?s.asymmetric?(i=n[t+2],o=n[t+3],"xy"===c&&(l.asymmetric?(a=n[t+4],r=n[t+5]):a=n[t+4])):(i=n[t+2],"xy"===c&&(l.asymmetric?(a=n[t+3],r=n[t+4]):a=n[t+3])):"y"===c&&(l.asymmetric?(a=n[t+2],r=n[t+3]):a=n[t+2]),null==o&&(o=i),null==r&&(r=a);var u=[i,o,a,r];return s.show||(u[0]=null,u[1]=null),l.show||(u[2]=null,u[3]=null),u}function A(e,t,n,i,o,a,r,s,l,c,u){i+=c,o+=c,a+=c,"x"===t.err?(o>n+l?O(e,[[o,i],[Math.max(n+l,u[0]),i]]):r=!1,a<n-l?O(e,[[Math.min(n-l,u[1]),i],[a,i]]):s=!1):(o<i-l?O(e,[[n,o],[n,Math.min(i-l,u[0])]]):r=!1,a>i+l?O(e,[[n,Math.max(i+l,u[1])],[n,a]]):s=!1),l=null!=t.radius?t.radius:l,r&&("-"===t.upperCap?"x"===t.err?O(e,[[o,i-l],[o,i+l]]):O(e,[[n-l,o],[n+l,o]]):"function"==typeof t.upperCap&&("x"===t.err?t.upperCap(e,o,i,l):t.upperCap(e,n,o,l))),s&&("-"===t.lowerCap?"x"===t.err?O(e,[[a,i-l],[a,i+l]]):O(e,[[n-l,a],[n+l,a]]):"function"==typeof t.lowerCap&&("x"===t.err?t.lowerCap(e,a,i,l):t.lowerCap(e,n,a,l)))}function O(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var n=1;n<t.length;n++)e.lineTo(t[n][0],t[n][1]);e.stroke()}function I(e,t){var n=e.getPlotOffset();t.save(),t.translate(n.left,n.top),e.getData().forEach(function(e){e.points.errorbars&&(e.points.xerr.show||e.points.yerr.show)&&function(e,t,n){var i,o=n.datapoints.points,a=n.datapoints.pointsize,r=[n.xaxis,n.yaxis],s=n.points.radius,l=[n.points.xerr,n.points.yerr],c=!1;r[0].p2c(r[0].max)<r[0].p2c(r[0].min)&&(c=!0,i=l[0].lowerCap,l[0].lowerCap=l[0].upperCap,l[0].upperCap=i);var u=!1;r[1].p2c(r[1].min)<r[1].p2c(r[1].max)&&(u=!0,i=l[1].lowerCap,l[1].lowerCap=l[1].upperCap,l[1].upperCap=i);for(var h=0;h<n.datapoints.points.length;h+=a)for(var p=z(n,h),f=0;f<l.length;f++){var d=[r[f].min,r[f].max];if(p[f*l.length]){var m=o[h],g=o[h+1],v=[m,g][f]+p[f*l.length+1],x=[m,g][f]-p[f*l.length];if("x"===l[f].err&&(g>r[1].max||g<r[1].min||v<r[0].min||x>r[0].max))continue;if("y"===l[f].err&&(m>r[0].max||m<r[0].min||v<r[1].min||x>r[1].max))continue;var b=!0,y=!0;v>d[1]&&(b=!1,v=d[1]),x<d[0]&&(y=!1,x=d[0]),("x"===l[f].err&&c||"y"===l[f].err&&u)&&(i=x,x=v,v=i,i=y,y=b,b=i,i=d[0],d[0]=d[1],d[1]=i),m=r[0].p2c(m),g=r[1].p2c(g),v=r[f].p2c(v),x=r[f].p2c(x),d[0]=r[f].p2c(d[0]),d[1]=r[f].p2c(d[1]);var w=l[f].lineWidth?l[f].lineWidth:n.points.lineWidth,T=null!=n.points.shadowSize?n.points.shadowSize:n.shadowSize;if(w>0&&T>0){var k=T/2;t.lineWidth=k,t.strokeStyle="rgba(0,0,0,0.1)",A(t,l[f],m,g,v,x,b,y,s,k+k/2,d),t.strokeStyle="rgba(0,0,0,0.2)",A(t,l[f],m,g,v,x,b,y,s,k/2,d)}t.strokeStyle=l[f].color?l[f].color:n.color,t.lineWidth=w,A(t,l[f],m,g,v,x,b,y,s,0,d)}}}(0,t,e)}),t.restore()}P.push({init:function(e){e.hooks.processRawData.push(E),e.hooks.draw.push(I)},options:{series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}},name:"errorbars",version:"1.0"});var R=D(Number.MAX_VALUE,10),W=D(Number.MAX_VALUE,4);function D(e,t){for(var n,i,o=Math.floor(Math.log(e)*Math.LOG10E)-1,a=[],r=-o;r<=o;r++){i=parseFloat("1e"+r);for(var s=1;s<9;s+=t)n=i*s,a.push(n)}return a}var Y=function(e,t,n){var i=[],o=-1,a=-1,r=e.getCanvas(),s=R,l=F(t,e),c=t.max;n||(n=.3*Math.sqrt("x"===t.direction?r.width:r.height)),R.some(function(e,t){return e>=l&&(o=t,!0)}),R.some(function(e,t){return e>=c&&(a=t,!0)}),-1===a&&(a=R.length-1),a-o<=n/4&&s.length!==W.length&&(s=W,o*=2,a*=2);var u,h,p,f=null,d=1/n;if(a-o>=n/4){for(var m=a;m>=o;m--)u=s[m],h=(Math.log(u)-Math.log(l))/(Math.log(c)-Math.log(l)),p=u,null===f?f={pixelCoord:h,idealPixelCoord:h}:Math.abs(h-f.pixelCoord)>=d?f={pixelCoord:h,idealPixelCoord:f.idealPixelCoord-d}:p=null,p&&i.push(p);i.reverse()}else{var g=e.computeTickSize(l,c,n);i=N({min:l,max:c,tickSize:g})}return i},F=function(e,t){var n=e.min,i=e.max;return n<=0&&i<(n=null===e.datamin?e.min=.1:_(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),n},X=function(e,t,n){var i=e>0?Math.floor(Math.log(e)/Math.LN10):0;if(n)return i>=-4&&i<=7?k(e,t,n):M(e,t,n);if(i>=-4&&i<=7){var o=i<0?e.toFixed(-i):e.toFixed(i+2);if(-1!==o.indexOf(".")){for(var a=o.lastIndexOf("0");a===o.length-1;)a=(o=o.slice(0,-1)).lastIndexOf("0");o.indexOf(".")===o.length-1&&(o=o.slice(0,-1))}return o}return M(e,t)},B=function(e){return e<R[0]&&(e=R[0]),Math.log(e)},G=function(e){return Math.exp(e)},H=function(e){return-e},j=function(e){return-B(e)},V=function(e){return G(-e)};function q(e,t){"log"===t.options.mode&&t.datamin<=0&&(null===t.datamin?t.datamin=.1:t.datamin=_(e,t))}function _(e,t){var n=e.getData().filter(function(e){return e.xaxis===t||e.yaxis===t}).map(function(t){return e.computeRangeForDataSeries(t,null,U)}),i="x"===t.direction?Math.min(.1,n&&n[0]?n[0].xmin:.1):Math.min(.1,n&&n[0]?n[0].ymin:.1);return t.min=i,i}function U(e){return e>0}P.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(n){var i=t[n],o=i.options;"log"===o.mode?(i.tickGenerator=function(t){return Y(e,t,11)},"function"!=typeof i.options.tickFormatter&&(i.options.tickFormatter=X),i.options.transform=o.inverted?j:B,i.options.inverseTransform=o.inverted?V:G,i.options.autoScaleMargin=0,e.hooks.setRange.push(q)):o.inverted&&(i.options.transform=H,i.options.inverseTransform=H)})})},options:{xaxis:{}},name:"log",version:"0.1"});var Z=Y,J=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},K=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},Q=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t,n-a),e.lineTo(t+a,n),e.lineTo(t,n+a),e.lineTo(t-a,n),e.lineTo(t,n-a)},$=function(e,t,n,i,o){var a=i*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),r=a*Math.sin(Math.PI/3);e.moveTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2),o||(e.lineTo(t,n-r/2),e.lineTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2))},ee=function(e,t,n,i,o,a){o||(e.moveTo(t+i,n),e.arc(t,n,i,0,2*Math.PI,!1))},te={square:J,rectangle:K,diamond:Q,triangle:$,cross:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.moveTo(t-a,n-a),e.lineTo(t+a,n+a),e.moveTo(t-a,n+a),e.lineTo(t+a,n-a)},ellipse:ee,plus:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t+a,n),e.moveTo(t,n+a),e.lineTo(t,n-a)}};function ne(e,t,n,i){if(!0===t.flatdata){var o=t.start||0,a="number"==typeof t.step?t.step:1;i.pointsize=2;for(var r=0,s=0;r<n.length;r++,s+=2)i.points[s]=o+r*a,i.points[s+1]=n[r];void 0!==i.points?i.points.length=2*n.length:i.points=[]}}J.fill=!0,K.fill=!0,Q.fill=!0,$.fill=!0,ee.fill=!0,P.push({init:function(e){e.drawSymbol=te},name:"symbols",version:"1.0"}),P.push({init:function(e){e.hooks.processRawData.push(ne)},name:"flatdata",version:"0.0.2"});var ie=y.SNAPPING_CONSTANT,oe=y.PANHINT_LENGTH_CONSTANT;function ae(e,n){var i,o=null,a="manual"===n.pan.mode,r="smartLock"===n.pan.mode,l=r||"smart"===n.pan.mode,c="default",h=null,d=null,m={x:0,y:0},g=!1;function v(n){var i=-n.deltaY,o=Math.abs(n.deltaY)<=1?1+Math.abs(n.deltaY)/50:null;if(g&&x(n),e.getOptions().zoom.active)return n.preventDefault(),function(n,i,o){var a=t.getPageXY(n),r=e.offset();r.left=a.X-r.left,r.top=a.Y-r.top;var s=e.getPlaceholder().getBoundingClientRect(),l={left:s.left+window.scrollX,top:s.top+window.scrollY};l.left=a.X-l.left,l.top=a.Y-l.top;var c=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return l.left>t.left&&l.left<t.left+t.width&&l.top>t.top&&l.top<t.top+t.height});0===c.length&&(c=void 0),i?e.zoomOut({center:r,axes:c,amount:o}):e.zoom({center:r,axes:c,amount:o})}(n,i<0,o),!1}function x(n){if(g){d&&(window.clearTimeout(d),d=null),g=!1;var u=t.getPageXY(n);s(e.getPlaceholder(),"cursor",c),l?(e.smartPan({x:i.startPageX-u.X,y:i.startPageY-u.Y},i,o,!1,r),e.smartPan.end()):a&&(e.pan({left:m.x-u.X,top:m.y-u.Y,axes:o}),m.x=0,m.y=0)}}function y(t){if(e.activate(),e.getOptions().recenter.interactive){var n=e.getTouchedAxis(t.clientX,t.clientY);e.recenter({axes:n[0]?n:null}),n[0]?u(e.getPlaceholder(),"re-center",{axisTouched:n[0]}):u(e.getPlaceholder(),"re-center",t)}}function w(t){return e.activate(),g&&x(t),!1}function T(n){if(0===n.button){var u=n.currentTarget;!function(n){g=!0;var r=t.getPageXY(n),u=e.getPlaceholder().getBoundingClientRect(),h={left:u.left+window.scrollX,top:u.top+window.scrollY};h.left=r.X-h.left,h.top=r.Y-h.top,0===(o=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return h.left>t.left&&h.left<t.left+t.width&&h.top>t.top&&h.top<t.top+t.height})).length&&(o=void 0);var p=s(e.getPlaceholder(),"cursor");p&&(c=p),s(e.getPlaceholder(),"cursor",e.getOptions().pan.cursor),l?i=e.navigationState(r.X,r.Y):a&&(m.x=r.X,m.y=r.Y)}(n),u.setPointerCapture(n.pointerId),u.addEventListener("pointermove",h),u.addEventListener("pointerup",p),u.addEventListener("pointercancel",p)}function h(n){!function(n){if(g){var s=t.getPageXY(n),c=e.getOptions().pan.frameRate;-1!==c?!d&&c&&(d=window.setTimeout(function(){l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:o}),m.x=s.X,m.y=s.Y),d=null},1/c*1e3)):l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:m.x-s.X,top:m.y-s.Y,axes:o}),m.x=s.X,m.y=s.Y)}}(n)}function p(e){x(e),u.removeEventListener("pointermove",h),u.removeEventListener("pointerup",p),u.removeEventListener("pointercancel",p),u.releasePointerCapture(e.pointerId)}}e.navigationState=function(e,t){var n=this.getAxes(),i={};return Object.keys(n).forEach(function(e){var t=n[e];i[e]={navigationOffset:{below:t.options.offset.below||0,above:t.options.offset.above||0},axisMin:t.min,axisMax:t.max,diagMode:!1}}),i.startPageX=e||0,i.startPageY=t||0,i},e.activate=function(){var t=e.getOptions();t.pan.active&&t.zoom.active||(t.pan.active=!0,t.zoom.active=!0,u(e.getPlaceholder(),"plotactivated",[e]))},e.zoomOut=function(t){t||(t={}),t.amount||(t.amount=e.getOptions().zoom.amount),t.amount=1/t.amount,e.zoom(t)},e.zoom=function(t){t||(t={});var n=t.center,i=t.amount||e.getOptions().zoom.amount,o=e.width(),a=e.height(),r=t.axes||e.getAxes();n||(n={left:o/2,top:a/2});var s=n.left/o,l=n.top/a,c={x:{min:n.left-s*o/i,max:n.left+(1-s)*o/i},y:{min:n.top-l*a/i,max:n.top+(1-l)*a/i}};for(var h in r)if(r.hasOwnProperty(h)){var p=r[h],f=p.options,d=c[p.direction].min,m=c[p.direction].max,g=p.options.offset;if((f.axisZoom||!t.axes)&&(t.axes||f.plotZoom)){if((d=b.saturate(p.c2p(d)))>(m=b.saturate(p.c2p(m)))){var v=d;d=m,m=v}if(f.zoomRange){if(m-d<f.zoomRange[0])continue;if(m-d>f.zoomRange[1])continue}var x=b.saturate(g.below-(p.min-d)),y=b.saturate(g.above-(p.max-m));f.offset={below:x,above:y}}}e.setupGrid(!0),e.draw(),t.preventEvent||u(e.getPlaceholder(),"plotzoom",[e,t])},e.pan=function(t){var n={x:+t.left,y:+t.top};isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0);var i=t.axes||e.getAxes();Object.keys(i).forEach(function(e){var o=i[e],a=o.options,r=n[o.direction];if((a.axisPan||!t.axes)&&(a.plotPan||t.axes)){var s=o.p2c(a.panRange[0])-o.p2c(o.min),l=o.p2c(a.panRange[1])-o.p2c(o.max);if("y"===o.direction){var c=s;s=l,l=c}if(void 0!==a.panRange[0]&&r>=l&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var u=b.saturate(o.c2p(o.p2c(o.min)+r)-o.c2p(o.p2c(o.min))),h=b.saturate(o.c2p(o.p2c(o.max)+r)-o.c2p(o.p2c(o.max)));isFinite(u)||(u=0),isFinite(h)||(h=0),a.offset={below:b.saturate(u+(a.offset.below||0)),above:b.saturate(h+(a.offset.above||0))}}}}),e.setupGrid(!0),e.draw(),t.preventEvent||u(e.getPlaceholder(),"plotpan",[e,t])},e.recenter=function(t){var n=t.axes||e.getAxes();Object.keys(n).forEach(function(e){var i=n[e];t.axes?"x"===i.direction?i.options.offset={below:0}:"y"===i.direction&&(i.options.offset={above:0}):i.options.offset={below:0,above:0}}),e.setupGrid(!0),e.draw()};var k=null,M={x:0,y:0};e.smartPan=function(t,n,i,o,a){var r,s,l,c,p,f,d=!!a||function(e){return Math.abs(e.y)<ie&&Math.abs(e.x)>=ie||Math.abs(e.x)<ie&&Math.abs(e.y)>=ie}(t),m=e.getAxes();(function(e){return Math.abs(e.x)>0&&Math.abs(e.y)>0})(t=a?function(e){switch(!k&&Math.max(Math.abs(e.x),Math.abs(e.y))>=ie&&(k=Math.abs(e.x)<Math.abs(e.y)?"y":"x"),k){case"x":return{x:e.x,y:0};case"y":return{x:0,y:e.y};default:return{x:0,y:0}}}(t):function(e){return Math.abs(e.x)<ie&&Math.abs(e.y)>=ie?{x:0,y:e.y}:Math.abs(e.y)<ie&&Math.abs(e.x)>=ie?{x:e.x,y:0}:e}(t))&&(n.diagMode=!0),d&&!0===n.diagMode&&(n.diagMode=!1,function(e,t,n){var i;Object.keys(e).forEach(function(o){i=e[o],0===n[i.direction]&&(i.options.offset.below=t[o].navigationOffset.below,i.options.offset.above=t[o].navigationOffset.above)})}(m,n,t)),h=d?{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:{x:n.startPageX-t.x-e.offset().left+e.getPlotOffset().left,y:n.startPageY-t.y-e.offset().top+e.getPlotOffset().top}}:{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:!1},isNaN(t.x)&&(t.x=0),isNaN(t.y)&&(t.y=0),i&&(m=i),Object.keys(m).forEach(function(e){if(s=m[e],l=s.min,c=s.max,r=s.options,f=t[s.direction],p=M[s.direction],(r.axisPan||!i)&&(i||r.plotPan)){var n=p+s.p2c(r.panRange[0])-s.p2c(l),o=p+s.p2c(r.panRange[1])-s.p2c(c);if("y"===s.direction){var a=n;n=o,o=a}if(void 0!==r.panRange[0]&&f>=o&&(f=o),void 0!==r.panRange[1]&&f<=n&&(f=n),0!==f){var u=b.saturate(s.c2p(s.p2c(l)-(p-f))-s.c2p(s.p2c(l))),h=b.saturate(s.c2p(s.p2c(c)-(p-f))-s.c2p(s.p2c(c)));isFinite(u)||(u=0),isFinite(h)||(h=0),s.options.offset.below=b.saturate(u+(s.options.offset.below||0)),s.options.offset.above=b.saturate(h+(s.options.offset.above||0))}}}),M=t,e.setupGrid(!0),e.draw(),o||u(e.getPlaceholder(),"plotpan",[e,t,i,n])},e.smartPan.end=function(){h=null,k=null,M={x:0,y:0},e.triggerRedrawOverlay()},e.getTouchedAxis=function(t,n){var i=e.getPlaceholder().getBoundingClientRect(),o={left:i.left+window.scrollX,top:i.top+window.scrollY};return o.left=t-o.left,o.top=n-o.top,e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return o.left>t.left&&o.left<t.left+t.width&&o.top>t.top&&o.top<t.top+t.height})},e.hooks.drawOverlay.push(function(e,t){if(h){t.strokeStyle="rgba(96, 160, 208, 0.7)",t.lineWidth=2,t.lineJoin="round";var n,i,a=Math.round(h.start.x),r=Math.round(h.start.y);if(o?"x"===o[0].direction?(i=Math.round(h.start.y),n=Math.round(h.end.x)):"y"===o[0].direction&&(n=Math.round(h.start.x),i=Math.round(h.end.y)):(n=Math.round(h.end.x),i=Math.round(h.end.y)),t.beginPath(),!1===h.end)t.moveTo(a,r-oe),t.lineTo(a,r+oe),t.moveTo(a+oe,r),t.lineTo(a-oe,r);else{var s=r===i;t.moveTo(a-(s?0:oe),r-(s?oe:0)),t.lineTo(a+(s?0:oe),r+(s?oe:0)),t.moveTo(a,r),t.lineTo(n,i),t.moveTo(n-(s?0:oe),i-(s?oe:0)),t.lineTo(n+(s?0:oe),i+(s?oe:0))}t.stroke()}}),e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();n.zoom.interactive&&p(t,"wheel",v),n.pan.interactive&&p(t,"pointerdown",T),p(t,"dblclick",y),p(t,"click",w)}),e.hooks.shutdown.push(function(e,t){f(t,"wheel",v),f(t,"pointerdown",T),f(t,"dblclick",y),f(t,"click",w),d&&window.clearTimeout(d)})}function re(e,t,n,i){var o="categories"===t.xaxis.options.mode,a="categories"===t.yaxis.options.mode;if(o||a){var r=i.format;if(!r){var s=t;if((r=[]).push({x:!0,number:!0,required:!0,computeRange:!0}),r.push({y:!0,number:!0,required:!0,computeRange:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);r.push({y:!0,number:!0,required:!1,defaultValue:0,computeRange:l}),s.bars.horizontal&&(delete r[r.length-1].y,r[r.length-1].x=!0)}i.format=r}for(var c=0;c<r.length;++c)r[c].x&&o&&(r[c].number=!1),r[c].y&&a&&(r[c].number=!1,r[c].computeRange=!1)}}function se(e){var t=[];for(var n in e.categories){var i=e.categories[n];i>=e.min&&i<=e.max&&t.push([i,n])}return t.sort(function(e,t){return e[0]-t[0]}),t}function le(e,t,n){if("categories"===e[t].options.mode){if(!e[t].categories){var i={},o=e[t].options.categories||{};if(Array.isArray(o))for(var a=0;a<o.length;++a)i[o[a]]=a;else for(var r in o)i[r]=o[r];e[t].categories=i}e[t].options.ticks||(e[t].options.ticks=se),function(e,t,n){for(var i=e.points,o=e.pointsize,a=e.format,r=t.charAt(0),s=function(e){var t=-1;for(var n in e)e[n]>t&&(t=e[n]);return t+1}(n),l=0;l<i.length;l+=o)if(null!=i[l])for(var c=0;c<o;++c){var u=i[l+c];null!=u&&a[c][r]&&(u in n||(n[u]=s,++s),i[l+c]=n[u])}}(n,t,e[t].categories)}}function ce(e,t,n){le(t,"xaxis",n),le(t,"yaxis",n)}P.push({init:function(e){e.hooks.processOptions.push(ae)},options:{zoom:{interactive:!1,active:!1,amount:1.5},pan:{interactive:!1,active:!1,cursor:"move",frameRate:60,mode:"smart"},recenter:{interactive:!0},xaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]},yaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]}},name:"navigate",version:"1.3"}),P.push({init:function(e){e.hooks.processRawData.push(function(e,t,n,i){if(null!=t.fillBetween){var o=i.format;o||((o=[]).push({x:!0,number:!0,computeRange:"none"!==t.xaxis.options.autoScale,required:!0}),o.push({y:!0,number:!0,computeRange:"none"!==t.yaxis.options.autoScale,required:!0}),void 0!==t.fillBetween&&""!==t.fillBetween&&function(t){for(var n=e.getData(),i=0;i<n.length;i++)if(n[i].id===t)return!0;return!1}(t.fillBetween)&&t.fillBetween!==t.id&&o.push({x:!1,y:!0,number:!0,required:!1,computeRange:"none"!==t.yaxis.options.autoScale,defaultValue:0}),i.format=o)}}),e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.fillBetween){var i=function(e,t){var n;for(n=0;n<t.length;++n)if(t[n].id===e.fillBetween)return t[n];return"number"==typeof e.fillBetween?e.fillBetween<0||e.fillBetween>=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(i){for(var o,a,r,s,l,c,u,h,p=n.pointsize,f=n.points,d=i.datapoints.pointsize,m=i.datapoints.points,g=[],v=t.lines.show,x=p>2&&n.format[2].y,b=v&&t.lines.steps,y=!0,w=0,T=0;!(w>=f.length);){if(u=g.length,null==f[w]){for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(T>=m.length){if(!v)for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(null==m[T]){for(h=0;h<p;++h)g.push(null);y=!0,T+=d}else{if(o=f[w],a=f[w+1],s=m[T],l=m[T+1],c=0,o===s){for(h=0;h<p;++h)g.push(f[w+h]);c=l,w+=p,T+=d}else if(o>s){if(v&&w>0&&null!=f[w-p]){for(r=a+(f[w-p+1]-a)*(s-o)/(f[w-p]-o),g.push(s),g.push(r),h=2;h<p;++h)g.push(f[w+h]);c=l}T+=d}else{if(y&&v){w+=p;continue}for(h=0;h<p;++h)g.push(f[w+h]);v&&T>0&&null!=m[T-d]&&(c=l+(m[T-d+1]-l)*(o-s)/(m[T-d]-s)),w+=p}y=!1,u!==g.length&&x&&(g[u+2]=c)}if(b&&u!==g.length&&u>0&&null!==g[u]&&g[u]!==g[u-p]&&g[u+1]!==g[u-p+1]){for(h=0;h<p;++h)g[u+p+h]=g[u+h];g[u+1]=g[u-p+1]}}n.points=g}}})},options:{series:{fillBetween:null}},name:"fillbetween",version:"1.0"}),P.push({init:function(e){e.hooks.processRawData.push(re),e.hooks.processDatapoints.push(ce)},options:{xaxis:{categories:null},yaxis:{categories:null}},name:"categories",version:"1.0"}),P.push({init:function(e){e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.stack&&!1!==t.stack){var i=t.bars.show||t.lines.show&&t.lines.fill,o=n.pointsize>2&&(t.bars.horizontal?n.format[2].x:n.format[2].y);i&&!o&&function(e,t){for(var n=[],i=0;i<t.points.length;i+=2)n.push(t.points[i]),n.push(t.points[i+1]),n.push(0);t.format.push({x:e.bars.horizontal,y:!e.bars.horizontal,number:!0,required:!1,computeRange:"none"!==e.yaxis.options.autoScale,defaultValue:0}),t.points=n,t.pointsize=3}(t,n);var a=function(e,t){for(var n=null,i=0;i<t.length&&e!==t[i];++i)t[i].stack===e.stack&&(n=t[i]);return n}(t,e.getData());if(a){for(var r,s,l,c,u,h,p,f,d=n.pointsize,m=n.points,g=a.datapoints.pointsize,v=a.datapoints.points,x=[],b=t.lines.show,y=t.bars.horizontal,w=b&&t.lines.steps,T=!0,k=y?1:0,M=y?0:1,S=0,C=0;!(S>=m.length);){if(p=x.length,null==m[S]){for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(C>=v.length){if(!b)for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(null==v[C]){for(f=0;f<d;++f)x.push(null);T=!0,C+=g}else{if(r=m[S+k],s=m[S+M],c=v[C+k],u=v[C+M],h=0,r===c){for(f=0;f<d;++f)x.push(m[S+f]);x[p+M]+=u,h=u,S+=d,C+=g}else if(r>c){if(b&&S>0&&null!=m[S-d]){for(l=s+(m[S-d+M]-s)*(c-r)/(m[S-d+k]-r),x.push(c),x.push(l+u),f=2;f<d;++f)x.push(m[S+f]);h=u}C+=g}else{if(T&&b){S+=d;continue}for(f=0;f<d;++f)x.push(m[S+f]);b&&C>0&&null!=v[C-g]&&(h=u+(v[C-g+M]-u)*(r-c)/(v[C-g+k]-c)),x[p+M]+=h,S+=d}T=!1,p!==x.length&&i&&(x[p+2]+=h)}if(w&&p!==x.length&&p>0&&null!==x[p]&&x[p]!==x[p-d]&&x[p+1]!==x[p-d+1]){for(f=0;f<d;++f)x[p+d+f]=x[p+f];x[p+1]=x[p-d+1]}}n.points=x}}})},options:{series:{stack:null}},name:"stack",version:"1.2"});var ue=y.ZOOM_DISTANCE_MARGIN;function he(e,t){var n,i,o,a,r={zoomEnable:!1,prevDistance:null,prevTapTime:0,prevPanPosition:{x:0,y:0},prevTapPosition:{x:0,y:0}},s={prevTouchedAxis:"none",currentTouchedAxis:"none",touchedAxis:null,navigationConstraint:"unconstrained",initialState:null},l=t.pan.interactive&&"manual"===t.pan.touchMode,c="smartLock"===t.pan.touchMode,h=t.pan.interactive&&(c||"smart"===t.pan.touchMode);function p(t,n,i){s.touchedAxis=function(e,t,n,i){if("pinchstart"!==t.type)return"panstart"===t.type||"pinchend"===t.type?e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY):i.touchedAxis;var o=e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY),a=e.getTouchedAxis(t.detail.touches[1].pageX,t.detail.touches[1].pageY);return o.length===a.length&&o.toString()===a.toString()?o:void 0}(e,t,0,s),pe(s)?s.navigationConstraint="unconstrained":s.navigationConstraint="axisConstrained"}n={start:function(t){if(p(t),fe(t,"pan",r,s),h){var n=ve(t,"pan");s.initialState=e.navigationState(n.x,n.y)}},drag:function(t){if(p(t),h){var n=ve(t,"pan");e.smartPan({x:s.initialState.startPageX-n.x,y:s.initialState.startPageY-n.y},s.initialState,s.touchedAxis,!1,c)}else l&&(e.pan({left:-ge(t,"pan",r).x,top:-ge(t,"pan",r).y,axes:s.touchedAxis}),me(t,"pan",r,s))},end:function(t){p(t),h&&e.smartPan.end(),function(e,t){return t.zoomEnable&&1===e.detail.touches.length}(t,r)&&updateprevPanPosition(t,"pan",r,s)}},i={start:function(e){a&&(clearTimeout(a),a=null),p(e),function(e,t){t.prevDistance=de(e)}(e,r),fe(e,"pinch",r,s)},drag:function(t){a||(a=setTimeout(function(){p(t),e.pan({left:-ge(t,"pinch",r).x,top:-ge(t,"pinch",r).y,axes:s.touchedAxis}),me(t,"pinch",r,s);var n=de(t);(r.zoomEnable||Math.abs(n-r.prevDistance)>ue)&&(function(e,t,n,i){var o=e.offset(),a={left:0,top:0},r=de(t)/n.prevDistance,s=de(t);a.left=ve(t,"pinch").x-o.left,a.top=ve(t,"pinch").y-o.top,e.zoom({center:a,amount:r,axes:i.touchedAxis}),n.prevDistance=s}(e,t,r,s),r.zoomEnable=!0),a=null},1e3/60))},end:function(e){a&&(clearTimeout(a),a=null),p(e),r.prevDistance=null}},o={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(e,t,n,i){(function(e,t,n){var i=e.getTouchedAxis(t.detail.firstTouch.x,t.detail.firstTouch.y);void 0!==i[0]&&(n.prevTouchedAxis=i[0].direction),void 0!==(i=e.getTouchedAxis(t.detail.secondTouch.x,t.detail.secondTouch.y))[0]&&(n.touchedAxis=i,n.currentTouchedAxis=i[0].direction),pe(n)&&(n.touchedAxis=null,n.prevTouchedAxis="none",n.currentTouchedAxis="none")})(e,t,i),("x"===i.currentTouchedAxis&&"x"===i.prevTouchedAxis||"y"===i.currentTouchedAxis&&"y"===i.prevTouchedAxis||"none"===i.currentTouchedAxis&&"none"===i.prevTouchedAxis)&&(e.recenter({axes:i.touchedAxis}),i.touchedAxis?u(e.getPlaceholder(),"re-center",{axisTouched:i.touchedAxis}):u(e.getPlaceholder(),"re-center",t))}(e,t,0,s)}},!0!==t.pan.enableTouch&&!0!==t.zoom.enableTouch||(e.hooks.bindEvents.push(function(e,t){var a=e.getOptions();a.zoom.interactive&&a.zoom.enableTouch&&(t.addEventListener("pinchstart",i.start,!1),t.addEventListener("pinchdrag",i.drag,!1),t.addEventListener("pinchend",i.end,!1)),a.pan.interactive&&a.pan.enableTouch&&(t.addEventListener("panstart",n.start,!1),t.addEventListener("pandrag",n.drag,!1),t.addEventListener("panend",n.end,!1)),a.recenter.interactive&&a.recenter.enableTouch&&t.addEventListener("doubletap",o.recenterPlot,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("panstart",n.start),t.removeEventListener("pandrag",n.drag),t.removeEventListener("panend",n.end),t.removeEventListener("pinchstart",i.start),t.removeEventListener("pinchdrag",i.drag),t.removeEventListener("pinchend",i.end),t.removeEventListener("doubletap",o.recenterPlot)}))}function pe(e){return!e.touchedAxis||0===e.touchedAxis.length}function fe(e,t,n,i){var o,a=ve(e,t);switch(i.navigationConstraint){case"unconstrained":i.touchedAxis=null,n.prevTapPosition={x:n.prevPanPosition.x,y:n.prevPanPosition.y},n.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":o=i.touchedAxis[0].direction,i.currentTouchedAxis=o,n.prevTapPosition[o]=n.prevPanPosition[o],n.prevPanPosition[o]=a[o]}}function de(e){var t,n,i,o,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,n=a.pageY,i=r.pageX,o=r.pageY,Math.sqrt((t-i)*(t-i)+(n-o)*(n-o))}function me(e,t,n,i){var o=ve(e,t);switch(i.navigationConstraint){case"unconstrained":n.prevPanPosition.x=o.x,n.prevPanPosition.y=o.y;break;case"axisConstrained":n.prevPanPosition[i.currentTouchedAxis]=o[i.currentTouchedAxis]}}function ge(e,t,n){var i=ve(e,t);return{x:i.x-n.prevPanPosition.x,y:i.y-n.prevPanPosition.y}}function ve(e,t){return"pinch"===t?{x:(e.detail.touches[0].pageX+e.detail.touches[1].pageX)/2,y:(e.detail.touches[0].pageY+e.detail.touches[1].pageY)/2}:{x:e.detail.touches[0].pageX,y:e.detail.touches[0].pageY}}P.push({init:function(e){e.hooks.processOptions.push(he)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"});var xe="hover";function be(e,t){var n,i={twoTouches:!1,currentTapStart:{x:0,y:0},currentTapEnd:{x:0,y:0},prevTap:{x:0,y:0},currentTap:{x:0,y:0},interceptedLongTap:!1,isUnsupportedGesture:!1,prevTapTime:null,tapStartTime:null,longTapTriggerId:null};function o(t){var o=e.getOptions();(o.pan.active||o.zoom.active)&&(function(e){e.touches.length>=3?i.isUnsupportedGesture=!0:i.isUnsupportedGesture=!1}(t),n.dispatchEvent(new CustomEvent("touchevent",{detail:t})),m(t)?a(t,"pinch"):(a(t,"pan"),d(t)||(function(e){var t=(new Date).getTime(),n=t-i.prevTapTime;return n>=0&&n<500&&f(i.prevTap.x,i.prevTap.y,i.currentTap.x,i.currentTap.y)<20?(e.firstTouch=i.prevTap,e.secondTouch=i.currentTap,!0):(i.prevTapTime=t,!1)}(t)&&a(t,"doubleTap"),a(t,"tap"),a(t,"longTap"))))}function a(e,t){switch(t){case"pan":r[e.type](e);break;case"pinch":s[e.type](e);break;case"doubleTap":l.onDoubleTap(e);break;case"longTap":c[e.type](e);break;case"tap":u[e.type](e)}}var r={touchstart:function(e){i.prevTap={x:i.currentTap.x,y:i.currentTap.y},h(e),function(e){i.tapStartTime=(new Date).getTime(),i.interceptedLongTap=!1,i.currentTapStart={x:e.touches[0].pageX,y:e.touches[0].pageY},i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){p(e),h(e),function(e){i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){p(e),d(e)?(n.dispatchEvent(new CustomEvent("pinchend",{detail:e})),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))):function(e){return e.touches&&0===e.touches.length}(e)&&n.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){n.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){p(e),i.twoTouches=m(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){p(e)}},l={onDoubleTap:function(e){p(e),n.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)},isLongTap:function(e){return(new Date).getTime()-i.tapStartTime>=1500&&!i.interceptedLongTap&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20&&(i.interceptedLongTap=!0,!0)},waitForLongTap:function(e){i.longTapTriggerId||(i.longTapTriggerId=setTimeout(function(){c.isLongTap(e)&&n.dispatchEvent(new CustomEvent("longtap",{detail:e})),i.longTapTriggerId=null},1500))}},u={touchstart:function(e){i.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(n.dispatchEvent(new CustomEvent("tap",{detail:e})),p(e))},isTap:function(e){return(new Date).getTime()-i.tapStartTime<=125&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20}};function h(e){i.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function p(t){i.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function f(e,t,n,i){return Math.sqrt((e-n)*(e-n)+(t-i)*(t-i))}function d(e){return i.twoTouches&&1===e.touches.length}function m(t){return!!(t.touches&&t.touches.length>=2&&t.touches[0].target===e.getEventHolder()&&t.touches[1].target===e.getEventHolder())}(!0===t.pan.enableTouch||t.zoom.enableTouch)&&(e.hooks.bindEvents.push(function(e,t){n=t,t.addEventListener("touchstart",o,!1),t.addEventListener("touchmove",o,!1),t.addEventListener("touchend",o,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",o),t.removeEventListener("touchend",o),i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)}))}P.push({init:function(e){var n,i=[];function o(t){var n=e.getOptions(),i=new CustomEvent("mouseevent");return i.pageX=t.detail.changedTouches[0].pageX,i.pageY=t.detail.changedTouches[0].pageY,i.clientX=t.detail.changedTouches[0].clientX,i.clientY=t.detail.changedTouches[0].clientY,n.grid.hoverable&&a(i,xe,30),!1}function a(t,n,i){var o=e.getData();if(void 0!==t&&o.length>0&&void 0!==o[0].xaxis.c2p&&void 0!==o[0].yaxis.c2p){var a=n+"able";h("plot"+n,t,function(e){return!1!==o[e][a]},i)}}function r(t){n=t,e.getPlaceholder().lastMouseMoveEvent=t,a(t,xe)}function s(t){n=void 0,e.getPlaceholder().lastMouseMoveEvent=void 0,h("plothover",t,function(e){return!1})}function l(e){a(e,"click")}function c(){e.unhighlight(),u(e.getPlaceholder(),"plothovercleanup")}function h(n,o,a,r){var s=e.getOptions(),l=e.offset(),c=t.getPageXY(o),h=c.X-l.left,p=c.Y-l.top,f=e.c2p({left:h,top:p}),g=void 0!==r?r:s.grid.mouseActiveRadius;f.pageX=c.X,f.pageY=c.Y;var v=e.findNearbyItems(h,p,a,g),x=v[0];for(let e=1;e<v.length;++e)(void 0===x.distance||v[e].distance<x.distance)&&(x=v[e]);if(x?(x.pageX=parseInt(x.series.xaxis.p2c(x.datapoint[0])+l.left,10),x.pageY=parseInt(x.series.yaxis.p2c(x.datapoint[1])+l.top,10)):x=null,s.grid.autoHighlight){for(let e=0;e<i.length;++e){var b=i[e];(b.auto!==n||x&&b.series===x.series&&b.point[0]===x.datapoint[0]&&b.point[1]===x.datapoint[1])&&x||m(b.series,b.point)}x&&d(x.series,x.datapoint,n)}u(e.getPlaceholder(),n,[f,x,v])}function d(t,n,o){if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var a=t.datapoints.pointsize;n=t.datapoints.points.slice(a*n,a*(n+1))}var r=g(t,n);-1===r?(i.push({series:t,point:n,auto:o}),e.triggerRedrawOverlay()):o||(i[r].auto=!1)}function m(t,n){if(null==t&&null==n)return i=[],void e.triggerRedrawOverlay();if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var o=t.datapoints.pointsize;n=t.datapoints.points.slice(o*n,o*(n+1))}var a=g(t,n);-1!==a&&(i.splice(a,1),e.triggerRedrawOverlay())}function g(e,t){for(var n=0;n<i.length;++n){var o=i[n];if(o.series===e&&o.point[0]===t[0]&&o.point[1]===t[1])return n}return-1}function x(){c(),a(n,xe)}function b(){a(n,xe)}function y(e,t,n){var o,a,r=e.getPlotOffset();for(t.save(),t.translate(r.left,r.top),o=0;o<i.length;++o)(a=i[o]).series.bars.show?k(a.series,a.point,t):T(a.series,a.point,t,e);t.restore()}function T(e,t,n,i){var o=t[0],a=t[1],r=e.xaxis,s=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:v.parse(e.color).scale("a",.5).toString();if(!(o<r.min||o>r.max||a<s.min||a>s.max)){var c=e.points.radius+e.points.lineWidth/2;n.lineWidth=c,n.strokeStyle=l;var u=1.5*c;o=r.p2c(o),a=s.p2c(a),n.beginPath();var h=e.points.symbol;"circle"===h?n.arc(o,a,u,0,2*Math.PI,!1):"string"==typeof h&&i.drawSymbol&&i.drawSymbol[h]&&i.drawSymbol[h](n,o,a,u,!1),n.closePath(),n.stroke()}}function k(e,t,n){var i,o="string"==typeof e.highlightColor?e.highlightColor:v.parse(e.color).scale("a",.5).toString(),a=o,r=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":i=0;break;case"right":i=-r;break;default:i=-r/2}n.lineWidth=e.bars.lineWidth,n.strokeStyle=o;var s=e.bars.fillTowards||0,l=s>e.yaxis.min?Math.min(e.yaxis.max,s):e.yaxis.min;w.drawBar(t[0],t[1],t[2]||l,i,i+r,function(){return a},e.xaxis,e.yaxis,n,e.bars.horizontal,e.bars.lineWidth)}e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();(n.grid.hoverable||n.grid.clickable)&&(t.addEventListener("touchevent",c,!1),t.addEventListener("tap",o,!1)),n.grid.clickable&&p(t,"click",l),n.grid.hoverable&&(p(t,"mousemove",r),p(t,"mouseleave",s))}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("tap",o),t.removeEventListener("touchevent",c),f(t,"mousemove",r),f(t,"mouseleave",s),f(t,"click",l),i=[]}),e.hooks.processOptions.push(function(e,t){e.highlight=d,e.unhighlight=m,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(y),e.hooks.processDatapoints.push(x),e.hooks.setupGrid.push(b)),n=e.getPlaceholder().lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"}),P.push({init:function(e){e.hooks.processOptions.push(be)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"});var ye=b.floorInBase,we=function(e,t){var n=new e(t),i=n.setTime.bind(n);n.update=function(e){e=Math.round(1e3*e)/1e3,i(e),this.microseconds=1e3*(e-Math.floor(e))};var o=n.getTime.bind(n);return n.getTime=function(){return o()+this.microseconds/1e3},n.setTime=function(e){this.update(e)},n.getMicroseconds=function(){return this.microseconds},n.setMicroseconds=function(e){var t=o()+e/1e3;this.update(t)},n.setUTCMicroseconds=function(e){this.setMicroseconds(e)},n.getUTCMicroseconds=function(){return this.getMicroseconds()},n.microseconds=null,n.microEpoch=null,n.update(t),n};function Te(e,t,n,i){if("function"==typeof e.strftime)return e.strftime(t);var o,a=function(e,t){return t=""+(null==t?"0":t),1===(e=""+e).length?t+e:e},r=function(e,t,n){var i,o=1e3*e+t;if(n<6&&n>0){var a=parseFloat("1e"+(n-6));i=("00000"+(o=Math.round(Math.round(o*a)/a))).slice(-6,-(6-n))}else i=("00000"+(o=Math.round(o))).slice(-6);return i},s=[],l=!1,c=e.getHours(),u=c<12;n||(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),i||(i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),o=c>12?c-12:0===c?12:c;for(var h=-1,p=0;p<t.length;++p){var f=t.charAt(p);if(!isNaN(Number(f))&&Number(f)>0)h=Number(f);else if(l){switch(f){case"a":f=""+i[e.getDay()];break;case"b":f=""+n[e.getMonth()];break;case"d":f=a(e.getDate());break;case"e":f=a(e.getDate()," ");break;case"h":case"H":f=a(c);break;case"I":f=a(o);break;case"l":f=a(o," ");break;case"m":f=a(e.getMonth()+1);break;case"M":f=a(e.getMinutes());break;case"q":f=""+(Math.floor(e.getMonth()/3)+1);break;case"S":f=a(e.getSeconds());break;case"s":f=""+r(e.getMilliseconds(),e.getMicroseconds(),h);break;case"y":f=a(e.getFullYear()%100);break;case"Y":f=""+e.getFullYear();break;case"p":f=u?"am":"pm";break;case"P":f=u?"AM":"PM";break;case"w":f=""+e.getDay()}s.push(f),l=!1}else"%"===f?l=!0:s.push(f)}return s.join("")}function ke(e){function t(e,t,n,i){e[t]=function(){return n[i].apply(n,arguments)}}var n={date:e};void 0!==e.strftime&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");for(var i=["Date","Day","FullYear","Hours","Minutes","Month","Seconds","Milliseconds","Microseconds"],o=0;o<i.length;o++)t(n,"get"+i[o],e,"getUTC"+i[o]),t(n,"set"+i[o],e,"setUTC"+i[o]);return n}function Me(e,t){var n=864e13;if(t&&"seconds"===t.timeBase?e*=1e3:"microseconds"===t.timeBase&&(e/=1e3),e>n?e=n:e<-n&&(e=-n),"browser"===t.timezone)return we(Date,e);if(t.timezone&&"utc"!==t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=we(timezoneJS.Date,e);return i.setTimezone(t.timezone),i.setTime(e),i}return ke(we(Date,e))}return ke(we(Date,e))}var Se={microsecond:1e-6,millisecond:.001,second:1,minute:60,hour:3600,day:86400,month:2592e3,quarter:7776e3,year:525949.2*60},Ce={microsecond:.001,millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},Pe={microsecond:1,millisecond:1e3,second:1e6,minute:6e7,hour:36e8,day:864e8,month:2592e9,quarter:7776e9,year:31556951999999.996},Le=[[1,"microsecond"],[2,"microsecond"],[5,"microsecond"],[10,"microsecond"],[25,"microsecond"],[50,"microsecond"],[100,"microsecond"],[250,"microsecond"],[500,"microsecond"],[1,"millisecond"],[2,"millisecond"],[5,"millisecond"],[10,"millisecond"],[25,"millisecond"],[50,"millisecond"],[100,"millisecond"],[250,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],Ne=Le.concat([[3,"month"],[6,"month"],[1,"year"]]),Ee=Le.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function ze(e){var t,n=e.options,i=[],o=Me(e.min,n),a=0,r=n.tickSize&&"quarter"===n.tickSize[1]||n.minTickSize&&"quarter"===n.minTickSize[1]?Ee:Ne;t="seconds"===n.timeBase?Se:"microseconds"===n.timeBase?Pe:Ce,null!==n.minTickSize&&void 0!==n.minTickSize&&(a="number"==typeof n.tickSize?n.tickSize:n.minTickSize[0]*t[n.minTickSize[1]]);for(var s=0;s<r.length-1&&!(e.delta<(r[s][0]*t[r[s][1]]+r[s+1][0]*t[r[s+1][1]])/2&&r[s][0]*t[r[s][1]]>=a);++s);var l=r[s][0],c=r[s][1];if("year"===c){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])l=Math.floor(n.minTickSize[0]);else{var u=parseFloat("1e"+Math.floor(Math.log(e.delta/t.year)/Math.LN10)),h=e.delta/t.year/u;l=h<1.5?1:h<3?2:h<7.5?5:10,l*=u}l<1&&(l=1)}e.tickSize=n.tickSize||[l,c];var p=e.tickSize[0],f=p*t[c=e.tickSize[1]];"microsecond"===c?o.setMicroseconds(ye(o.getMicroseconds(),p)):"millisecond"===c?o.setMilliseconds(ye(o.getMilliseconds(),p)):"second"===c?o.setSeconds(ye(o.getSeconds(),p)):"minute"===c?o.setMinutes(ye(o.getMinutes(),p)):"hour"===c?o.setHours(ye(o.getHours(),p)):"month"===c?o.setMonth(ye(o.getMonth(),p)):"quarter"===c?o.setMonth(3*ye(o.getMonth()/3,p)):"year"===c&&o.setFullYear(ye(o.getFullYear(),p)),f>=t.millisecond&&o.setMicroseconds(0),f>=t.second&&o.setMilliseconds(0),f>=t.minute&&o.setSeconds(0),f>=t.hour&&o.setMinutes(0),f>=t.day&&o.setHours(0),f>=4*t.day&&o.setDate(1),f>=2*t.month&&o.setMonth(ye(o.getMonth(),3)),f>=2*t.quarter&&o.setMonth(ye(o.getMonth(),6)),f>=t.year&&o.setMonth(0);var d,m,g=0,v=Number.NaN;do{if(m=v,d=o.getTime(),v=n&&"seconds"===n.timeBase?d/1e3:n&&"microseconds"===n.timeBase?1e3*d:d,i.push(v),"month"===c||"quarter"===c)if(p<1){o.setDate(1);var x=o.getTime();o.setMonth(o.getMonth()+("quarter"===c?3:1));var b=o.getTime();o.setTime(v+g*t.hour+(b-x)*p),g=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+p*("quarter"===c?3:1));else"year"===c?o.setFullYear(o.getFullYear()+p):"seconds"===n.timeBase?o.setTime(1e3*(v+f)):"microseconds"===n.timeBase?o.setTime((v+f)/1e3):o.setTime(v+f)}while(v<e.max&&v!==m);return i}function Ae(e,t,n,i,o,a){this.axisName=e,this.position=t,this.padding=n,this.placeholder=i,this.axisLabel=o,this.surface=a,this.width=0,this.height=0,this.elem=null}P.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(e){var n=t[e],i=n.options;if("time"===i.mode){if(n.tickGenerator=ze,"tickFormatter"in i&&"function"==typeof i.tickFormatter)return;n.tickFormatter=function(e,t){var n=Me(e,t.options);if(null!=i.timeformat)return Te(n,i.timeformat,i.monthNames,i.dayNames);var o,a=t.options.tickSize&&"quarter"===t.options.tickSize[1]||t.options.minTickSize&&"quarter"===t.options.minTickSize[1];o="seconds"===i.timeBase?Se:"microseconds"===i.timeBase?Pe:Ce;var r,s,l=t.tickSize[0]*o[t.tickSize[1]],c=t.max-t.min,u=i.twelveHourClock?" %p":"",h=i.twelveHourClock?"%I":"%H";if(r="seconds"===i.timeBase?1:"microseconds"===i.timeBase?1e6:1e3,l<o.second){var p=-Math.floor(Math.log10(l/r));String(l).indexOf("25")>-1&&p++,s="%S.%"+p+"s"}else s=l<o.minute?h+":%M:%S"+u:l<o.day?c<2*o.day?h+":%M"+u:"%b %d "+h+":%M"+u:l<o.month?"%b %d":a&&l<o.quarter||!a&&l<o.year?c<o.year?"%b":"%b %Y":a&&l<o.year?c<o.year?"Q%q":"Q%q %Y":"%Y";return Te(n,s,i.monthNames,i.dayNames)}}})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null,timeBase:"seconds"},yaxis:{timeBase:"seconds"}},name:"time",version:"1.0"}),Ae.prototype.calculateSize=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels",i=this.surface.getTextInfo(t,this.axisLabel,n);this.labelWidth=i.width,this.labelHeight=i.height,"left"===this.position||"right"===this.position?(this.width=this.labelHeight+this.padding,this.height=0):(this.width=0,this.height=this.labelHeight+this.padding)},Ae.prototype.transforms=function(e,t,n,i){var o,a,r=[];if(0===t&&0===n||((o=i.createSVGTransform()).setTranslate(t,n),r.push(o)),0!==e){a=i.createSVGTransform();var s=Math.round(this.labelWidth/2);a.setRotate(e,s,0),r.push(a)}return r},Ae.prototype.calculateOffsets=function(e){var t={x:0,y:0,degrees:0};return"bottom"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top+e.height-this.labelHeight):"top"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top):"left"===this.position?(t.degrees=-90,t.x=e.left-this.labelWidth/2,t.y=e.height/2+e.top):"right"===this.position&&(t.degrees=90,t.x=e.left+e.width-this.labelWidth/2,t.y=e.height/2+e.top),t.x=Math.round(t.x),t.y=Math.round(t.y),t},Ae.prototype.cleanup=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels";this.surface.removeText(t,0,0,this.axisLabel,n)},Ae.prototype.draw=function(e){var t=this.axisName+"Label",n=t+"Layer",i=t+" axisLabels",o=this.calculateOffsets(e),a={position:"absolute",bottom:"",right:"",display:"inline-block","white-space":"nowrap"},r=this.surface.getSVGLayer(n),s=this.transforms(o.degrees,o.x,o.y,r.parentNode);this.surface.addText(n,0,0,this.axisLabel,i,void 0,void 0,void 0,void 0,s),this.surface.render(),Object.keys(a).forEach(function(e){r.style[e]=a[e]})},P.push({init:function(e){e.hooks.processOptions.push(function(e,t){if(t.axisLabels.show){var n={};e.hooks.axisReserveSpace.push(function(e,t){var i=t.options,o=t.direction+t.n;if(t.labelHeight+=t.boxPosition.centerY,t.labelWidth+=t.boxPosition.centerX,i&&i.axisLabel&&t.show){var a=void 0===i.axisLabelPadding?2:i.axisLabelPadding,r=n[o];r||(r=new Ae(o,i.position,a,e.getPlaceholder(),i.axisLabel,e.getSurface()),n[o]=r),r.calculateSize(),t.labelHeight+=r.height,t.labelWidth+=r.width}}),e.hooks.draw.push(function(e,t){var i=e.getAxes();Object.keys(i).forEach(function(e){var t=i[e],o=t.options;if(o&&o.axisLabel&&t.show){var a=t.direction+t.n;n[a].draw(t.box)}})}),e.hooks.shutdown.push(function(e,t){for(var i in n)n[i].cleanup()})}})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"3.0"}),P.push({init:function(e){var t={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,currentMode:"xy",active:!1},n=y.SNAPPING_CONSTANT,i={};function o(){if(!d())return null;if(!t.show)return null;var n={},i={x:t.first.x,y:t.first.y},o={x:t.second.x,y:t.second.y};"x"===s(e)&&(i.y=0,o.y=e.height()),"y"===s(e)&&(i.x=0,o.x=e.width());var a=e.getAxes();return Object.keys(a).forEach(function(e){var t=a[e];if(t.used){var r=t.c2p(i[t.direction]),s=t.c2p(o[t.direction]);n[e]={from:Math.min(r,s),to:Math.max(r,s)}}}),n}function a(){var t=o();u(e.getPlaceholder(),"plotselected",[t]),t.xaxis&&t.yaxis&&u(e.getPlaceholder(),"selected",[{x1:t.xaxis.from,y1:t.yaxis.from,x2:t.xaxis.to,y2:t.yaxis.to}])}function r(e,t,n){return t<e?e:t>n?n:t}function s(e){var n=e.getOptions();return"smart"===n.selection.mode?t.currentMode:n.selection.mode}function l(i,o){var a=e.getPlaceholder().getBoundingClientRect(),l=a.left+window.scrollX,c=a.top+window.scrollY,u=e.getPlotOffset();i.x=r(0,o.pageX-l-u.left,e.width()),i.y=r(0,o.pageY-c-u.top,e.height()),i!==t.first&&function(e){if(t.first){var i={x:e.x-t.first.x,y:e.y-t.first.y};Math.abs(i.x)<n?t.currentMode="y":Math.abs(i.y)<n?t.currentMode="x":t.currentMode="xy"}}(i),"y"===s(e)&&(i.x=i===t.first?0:e.width()),"x"===s(e)&&(i.y=i===t.first?0:e.height())}function c(n){null!=n.pageX&&(l(t.second,n),d()?(t.show=!0,e.triggerRedrawOverlay()):h(!0))}function h(n){t.show&&(t.show=!1,t.currentMode="",e.triggerRedrawOverlay(),n||u(e.getPlaceholder(),"plotunselected",[]))}function p(t,n){var i,o,a,r,s=e.getAxes();for(var l in s)if((i=s[l]).direction===n&&(t[r=n+i.n+"axis"]||1!==i.n||(r=n+"axis"),t[r])){o=t[r].from,a=t[r].to;break}if(t[r]||(i="x"===n?e.getXAxes()[0]:e.getYAxes()[0],o=t[n+"1"],a=t[n+"2"]),null!=o&&null!=a&&o>a){var c=o;o=a,a=c}return{from:o,to:a,axis:i}}function d(){var n=e.getOptions().selection.minSize;return Math.abs(t.second.x-t.first.x)>=n&&Math.abs(t.second.y-t.first.y)>=n}function m(n){if(0===n.button){var r=n.currentTarget;!function(n){var o=e.getOptions();0===n.button&&null!==o.selection.mode&&(t.currentMode="xy",document.body.focus(),void 0!==document.onselectstart&&null==i.onselectstart&&(i.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!==document.ondrag&&null==i.ondrag&&(i.ondrag=document.ondrag,document.ondrag=function(){return!1}),l(t.first,n),t.active=!0)}(n),r.setPointerCapture(n.pointerId),r.addEventListener("pointermove",s),r.addEventListener("pointerup",h),r.addEventListener("pointercancel",h)}function s(n){!function(n){t.active&&(c(n),u(e.getPlaceholder(),"plotselecting",[o()]))}(n)}function h(n){!function(n){void 0!==document.onselectstart&&(document.onselectstart=i.onselectstart),void 0!==document.ondrag&&(document.ondrag=i.ondrag),t.active=!1,c(n),d()?a():(u(e.getPlaceholder(),"plotunselected",[]),u(e.getPlaceholder(),"plotselecting",[null]))}(n),r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",h),r.removeEventListener("pointercancel",h),r.releasePointerCapture(n.pointerId)}}e.clearSelection=h,e.setSelection=function(n,i){var o;"y"===s(e)?(t.first.x=0,t.second.x=e.width()):(o=p(n,"x"),t.first.x=o.axis.p2c(o.from),t.second.x=o.axis.p2c(o.to)),"x"===s(e)?(t.first.y=0,t.second.y=e.height()):(o=p(n,"y"),t.first.y=o.axis.p2c(o.from),t.second.y=o.axis.p2c(o.to)),t.show=!0,e.triggerRedrawOverlay(),!i&&d()&&a()},e.getSelection=o,e.hooks.bindEvents.push(function(e,t){null!=e.getOptions().selection.mode&&e.addEventHandler("pointerdown",m,t,0)}),e.hooks.drawOverlay.push(function(e,n){if(t.show&&d()){var i=e.getPlotOffset(),o=e.getOptions();n.save(),n.translate(i.left,i.top);var a=v.parse(o.selection.color),r=o.selection.visualization,l=o.selection.displaySelectionDecorations,c=1;"fill"===r&&(c=.8),n.strokeStyle=a.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=o.selection.shape,n.fillStyle=a.scale("a",.4).toString();var u=Math.min(t.first.x,t.second.x)+.5,h=u,p=Math.min(t.first.y,t.second.y)+.5,f=p,m=Math.abs(t.second.x-t.first.x)-1,g=Math.abs(t.second.y-t.first.y)-1;"x"===s(e)&&(g+=p,p=0),"y"===s(e)&&(m+=u,u=0),"fill"===r?(n.fillRect(u,p,m,g),n.strokeRect(u,p,m,g)):(n.fillRect(0,0,e.width(),e.height()),n.clearRect(u,p,m,g),l&&function(e,t,n,i,o,a,r,s){var l=15,c=Math.max(0,Math.min(l,i/2-2,o/2-2));e.fillStyle="#ffffff","xy"===s&&(e.beginPath(),e.moveTo(t,n+c),e.lineTo(t-3,n+c),e.lineTo(t-3,n-3),e.lineTo(t+c,n-3),e.lineTo(t+c,n),e.lineTo(t,n),e.closePath(),e.moveTo(t,n+o-c),e.lineTo(t-3,n+o-c),e.lineTo(t-3,n+o+3),e.lineTo(t+c,n+o+3),e.lineTo(t+c,n+o),e.lineTo(t,n+o),e.closePath(),e.moveTo(t+i,n+c),e.lineTo(t+i+3,n+c),e.lineTo(t+i+3,n-3),e.lineTo(t+i-c,n-3),e.lineTo(t+i-c,n),e.lineTo(t+i,n),e.closePath(),e.moveTo(t+i,n+o-c),e.lineTo(t+i+3,n+o-c),e.lineTo(t+i+3,n+o+3),e.lineTo(t+i-c,n+o+3),e.lineTo(t+i-c,n+o),e.lineTo(t+i,n+o),e.closePath(),e.stroke(),e.fill()),t=a,n=r,"x"===s&&(e.beginPath(),e.moveTo(t,n+l),e.lineTo(t,n-l),e.lineTo(t-3,n-l),e.lineTo(t-3,n+l),e.closePath(),e.moveTo(t+i,n+l),e.lineTo(t+i,n-l),e.lineTo(t+i+3,n-l),e.lineTo(t+i+3,n+l),e.closePath(),e.stroke(),e.fill()),"y"===s&&(e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.lineTo(t+l,n-3),e.lineTo(t-l,n-3),e.closePath(),e.moveTo(t-l,n+o),e.lineTo(t+l,n+o),e.lineTo(t+l,n+o+3),e.lineTo(t-l,n+o+3),e.closePath(),e.stroke(),e.fill())}(n,u,p,m,g,h,f,s(e))),n.restore()}}),e.hooks.shutdown.push(function(e,t){f(t,"pointerdown",m)})},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"});var Oe=1,Ie=t.getPixelRatio;function Re(e,n){var i=e.filter(We);Oe=Ie(n.getContext("2d"));var o=i.map(function(e){var n=new Image,i=new Promise(function(e,n){return e.sourceDescription='<info className="'+n.className+'" tagName="'+n.tagName+'" id="'+n.id+'">',e.sourceComponent=n,function(i,o){var a,r,s,l,c;e.onload=function(t){e.successfullyLoaded=!0,i(e)},e.onabort=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},e.onerror=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},r=e,"CANVAS"===(a=n).tagName&&(s=a,r.src=s.toDataURL("image/png")),"svg"===a.tagName&&(l=a,c=r,t.isSafari()||t.isMobileSafari()?function(e,t){var n,i,o=Ye(De(document),e);o=Fe(o),i=function(e){var t="";const n=new Uint8Array(e);for(var i=0;i<n.length;i+=16384)t+=String.fromCharCode.apply(null,n.subarray(i,i+16384));return t}((new(TextEncoder||TextEncoderLite)).encode(o)),n="data:image/svg+xml;base64,"+btoa(i),t.src=n}(l,c):function(e,t){var n=Ye(De(document),e);n=Fe(n);var i=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=(self.URL||self.webkitURL||self).createObjectURL(i);t.src=o}(l,c)),r.srcImgTagName=a.tagName,function(e,t){t.genLeft=e.getBoundingClientRect().left,t.genTop=e.getBoundingClientRect().top,"CANVAS"===e.tagName&&(t.genRight=t.genLeft+e.width,t.genBottom=t.genTop+e.height),"svg"===e.tagName&&(t.genRight=e.getBoundingClientRect().right,t.genBottom=e.getBoundingClientRect().bottom)}(a,r)}}(n,e));return i}),a=Promise.all(o).then(function(e){return function(t){var n=function(e,t){var n=function(e,t){var n=0;if(0===e.length)n=-1;else{var i=e[0].genLeft,o=e[0].genTop,a=e[0].genRight,r=e[0].genBottom,s=0;for(s=1;s<e.length;s++)i>e[s].genLeft&&(i=e[s].genLeft),o>e[s].genTop&&(o=e[s].genTop);for(s=1;s<e.length;s++)a<e[s].genRight&&(a=e[s].genRight),r<e[s].genBottom&&(r=e[s].genBottom);if(a-i<=0||r-o<=0)n=-2;else{for(t.width=Math.round(a-i),t.height=Math.round(r-o),s=0;s<e.length;s++)e[s].xCompOffset=e[s].genLeft-i,e[s].yCompOffset=e[s].genTop-o;!function(e,t){void 0!==t.find(function(e){return"svg"===e.srcImgTagName})&&Oe<1&&(e.width=e.width*Oe,e.height=e.height*Oe)}(t,e)}}return n}(e,t);if(0===n)for(var i=t.getContext("2d"),o=0;o<e.length;o++)!0===e[o].successfullyLoaded&&i.drawImage(e[o],e[o].xCompOffset*Oe,e[o].yCompOffset*Oe);return n}(t,e);return n}}(n),Xe);return a}function We(e){var t=!0,n=!0;return null==e?n=!1:"CANVAS"===e.tagName&&(e.getBoundingClientRect().right!==e.getBoundingClientRect().left&&e.getBoundingClientRect().bottom!==e.getBoundingClientRect().top||(t=!1)),n&&t&&"visible"===window.getComputedStyle(e).visibility}function De(e){for(var t=e.styleSheets,n=[],i=0;i<t.length;i++)try{for(var o=t[i].cssRules||[],a=0;a<o.length;a++){var r=o[a];n.push(r.cssText)}}catch(e){console.log("Failed to get some css rules")}return n}function Ye(e,t){return['<svg class="snapshot '+t.classList+'" width="'+t.width.baseVal.value*Oe+'" height="'+t.height.baseVal.value*Oe+'" viewBox="0 0 '+t.width.baseVal.value+" "+t.height.baseVal.value+'" xmlns="http://www.w3.org/2000/svg">',"<style>","/* <![CDATA[ */",e.join("\n"),"/* ]]> */","</style>",t.innerHTML,"</svg>"].join("\n")}function Fe(e){var t="";return e.match(/^<svg[^>]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"')),e.match(/^<svg[^>]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^<svg/,'<svg xmlns:xlink="http://www.w3.org/1999/xlink"')),'<?xml version="1.0" standalone="no"?>\r\n'+t}function Xe(){return-100}function Be(e){var t="",n=e.name,i=e.xPos,o=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(n){case"circle":default:t='<use xlink:href="#circle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"diamond":t='<use xlink:href="#diamond" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"cross":t='<use xlink:href="#cross" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"rectangle":t='<use xlink:href="#rectangle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"plus":t='<use xlink:href="#plus" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"bar":t='<use xlink:href="#bars" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"area":t='<use xlink:href="#area" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"line":t='<use xlink:href="#line" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"box":t='<use xlink:href="#box" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>'}return t}P.push({init:function(e){e.composeImages=Re},name:"composeImages",version:"1.0"});function Ge(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]!==t[n])return!0;return!1}P.push({init:function(e){e.hooks.setupGrid.push(function(e){var t=e.getOptions(),n=e.getData(),i=t.legend.labelFormatter,o=t.legend.legendEntries,a=t.legend.plotOffset,r=function(e,t,n){var i=t,o=e.reduce(function(e,t,n){var o=i?i(t.label,t):t.label;if(!t.hasOwnProperty("label")||o){var a={label:o||"Plot "+(n+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e},[]);if(n)if("function"==typeof n)o.sort(n);else if("reverse"===n)o.reverse();else{var a="descending"!==n;o.sort(function(e,t){return e.label===t.label?0:e.label<t.label!==a?1:-1})}return o}(n,i,t.legend.sorted),s=e.getPlotOffset();(function(e,t){if(!e||!t)return!0;if(e.length!==t.length)return!0;var n,i,o;for(n=0;n<t.length;n++){if(i=t[n],o=e[n],i.label!==o.label)return!0;if(i.color!==o.color)return!0;if(Ge(i.options.lines,o.options.lines))return!0;if(Ge(i.options.points,o.options.points))return!0;if(Ge(i.options.bars,o.options.bars))return!0}return!1}(o,r)||Ge(a,s))&&function(e,t,n,i){if(null!=t.legend.container)t.legend.container.innerHTML="";else for(var o=n.querySelectorAll(".legend"),a=0;a<o.length;a++)o[a].remove();if(t.legend.show){var r,s,l,c,u=t.legend.legendEntries=i,h=t.legend.plotOffset=e.getPlotOffset(),p=[],f=0,d="",m=t.legend.position,g=t.legend.margin,v={name:"",label:"",xPos:"",yPos:""};p[f++]='<svg class="legendLayer" style="width:inherit;height:inherit;">',p[f++]='<rect class="background" width="100%" height="100%"/>',p[f++]='<defs><symbol id="line" fill="none" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0"/></symbol><symbol id="box" stroke-width="1" viewBox="-5 -5 25 25"><rect x="0" y="0" width="15" height="15"/></symbol><symbol id="area" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0, 15,15, 0,15"/></symbol><symbol id="bars" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="1.5,15.5 1.5,12.5, 4.5,12.5 4.5,15.5 6.5,15.5 6.5,3.5, 9.5,3.5 9.5,15.5 11.5,15.5 11.5,7.5 14.5,7.5 14.5,15.5 1.5,15.5"/></symbol><symbol id="circle" viewBox="-5 -5 25 25"><circle cx="0" cy="15" r="2.5"/><circle cx="5" cy="5" r="2.5"/><circle cx="10" cy="10" r="2.5"/><circle cx="15" cy="0" r="2.5"/></symbol><symbol id="rectangle" viewBox="-5 -5 25 25"><rect x="-2.1" y="12.9" width="4.2" height="4.2"/><rect x="2.9" y="2.9" width="4.2" height="4.2"/><rect x="7.9" y="7.9" width="4.2" height="4.2"/><rect x="12.9" y="-2.1" width="4.2" height="4.2"/></symbol><symbol id="diamond" viewBox="-5 -5 25 25"><path d="M-3,15 L0,12 L3,15, L0,18 Z"/><path d="M2,5 L5,2 L8,5, L5,8 Z"/><path d="M7,10 L10,7 L13,10, L10,13 Z"/><path d="M12,0 L15,-3 L18,0, L15,3 Z"/></symbol><symbol id="cross" fill="none" viewBox="-5 -5 25 25"><path d="M-2.1,12.9 L2.1,17.1, M2.1,12.9 L-2.1,17.1 Z"/><path d="M2.9,2.9 L7.1,7.1 M7.1,2.9 L2.9,7.1 Z"/><path d="M7.9,7.9 L12.1,12.1 M12.1,7.9 L7.9,12.1 Z"/><path d="M12.9,-2.1 L17.1,2.1 M17.1,-2.1 L12.9,2.1 Z"/></symbol><symbol id="plus" fill="none" viewBox="-5 -5 25 25"><path d="M0,12 L0,18, M-3,15 L3,15 Z"/><path d="M5,2 L5,8 M2,5 L8,5 Z"/><path d="M10,7 L10,13 M7,10 L13,10 Z"/><path d="M15,-3 L15,3 M12,0 L18,0 Z"/></symbol></defs>';var x=0,b=[],y=window.getComputedStyle(document.querySelector("body"));for(c=0;c<u.length;++c){let n=c%t.legend.noColumns;r=u[c],v.label=r.label;var w=e.getSurface().getTextInfo("",v.label,{style:y.fontStyle,variant:y.fontVariant,weight:y.fontWeight,size:parseInt(y.fontSize),lineHeight:parseInt(y.lineHeight),family:y.fontFamily}).width;b[n]?w>b[n]&&(b[n]=w+48):b[n]=w+48}for(c=0;c<u.length;++c){let e=c%t.legend.noColumns;r=u[c],l="",v.label=r.label,v.xPos=x+3+"px",x+=b[e],(c+1)%t.legend.noColumns===0&&(x=0),v.yPos=1.5*Math.floor(c/t.legend.noColumns)+"em",r.options.lines.show&&r.options.lines.fill&&(v.name="area",v.fillColor=r.color,l+=Be(v)),r.options.bars.show&&(v.name="bar",v.fillColor=r.color,l+=Be(v)),r.options.lines.show&&!r.options.lines.fill&&(v.name="line",v.strokeColor=r.color,v.strokeWidth=r.options.lines.lineWidth,l+=Be(v)),r.options.points.show&&(v.name=r.options.points.symbol,v.strokeColor=r.color,v.fillColor=r.options.points.fillColor,v.strokeWidth=r.options.points.lineWidth,l+=Be(v)),""===l&&(v.name="box",v.fillColor=r.color,l+=Be(v)),s='<text x="'+v.xPos+'" y="'+v.yPos+'" text-anchor="start"><tspan dx="2em" dy="1.2em">'+v.label+"</tspan></text>",p[f++]="<g>"+l+s+"</g>"}p[f++]="</svg>",null==g[0]&&(g=[g,g]),"n"===m.charAt(0)?d+="top:"+(g[1]+h.top)+"px;":"s"===m.charAt(0)&&(d+="bottom:"+(g[1]+h.bottom)+"px;"),"e"===m.charAt(1)?d+="right:"+(g[0]+h.right)+"px;":"w"===m.charAt(1)&&(d+="left:"+(g[0]+h.left)+"px;");var T=6;for(c=0;c<b.length;++c)T+=b[c];var k,M=1.6*Math.ceil(u.length/t.legend.noColumns);if(t.legend.container){var S=t.legend.container;S&&"function"==typeof S.get&&S[0]&&(S=S[0]),S.innerHTML=p.join(""),S.style.width=T+"px",S.style.height=M+"em"}else(k=document.createElement("div")).className="legend",k.style.cssText="position:absolute;"+d,k.innerHTML=p.join(""),k.style.width=T+"px",k.style.height=M+"em",k.style.pointerEvents="none",n.appendChild(k)}}(e,t,e.getPlaceholder(),r)})},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"}),e.plot=function(t,n,i){return L("string"==typeof t?document.querySelector(t):t instanceof e?t[0]:t,n,i)},e.plot.plugins=P,e.plot.version="5.1.1",e.plot.saturated=b,e.plot.browser=t,e.plot.uiConstants=y,e.plot.drawSeries=w,e.plot.linearTickGenerator=N,e.plot.defaultTickFormatter=k,e.plot.expRepTickFormatter=M,e.plot.logTicksGenerator=Z,e.plot.logTickFormatter=X,e.plot.formatDate=Te,e.plot.makeUtcWrapper=ke,e.plot.dateGenerator=Me,e.plot.dateTickGenerator=ze,e.plot.composeImages=Re;var He=v.extract;e.color=Object.create(v),e.color.extract=function(t,n){return t instanceof e&&t.length&&(t=t[0]),He(t,n)},e.fn.plot=function(e,t){return this.each(function(){L(this,e,t)})},"undefined"!=typeof window&&(window.Flot||(window.Flot={}),window.Flot.Canvas=d)}(jQuery);
|
|
1
|
+
!function(e){"use strict";var t={getPageXY:function(e){var t=document.documentElement;return{X:e.clientX+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0),Y:e.clientY+(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}},getPixelRatio:function(e){return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},isSafari:function(){var e=window.top;return!!e&&(/constructor/i.test(e.HTMLElement)||"[object SafariRemoteNotification]"===(!e.safari||void 0!==e.safari&&e.safari.pushNotification).toString())},isMobileSafari:function(){return navigator.userAgent.match(/(iPod|iPhone|iPad)/)&&navigator.userAgent.match(/AppleWebKit/)},isOpera:function(){return!!window.opr&&!!window.opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0},isFirefox:function(){return"undefined"!=typeof InstallTrigger},isIE:function(){return!!document.documentMode},isEdge:function(){return!t.isIE()&&!!window.StyleMedia},isChrome:function(){return!!window.chrome&&!!window.chrome.webstore},isBlink:function(){return(t.isChrome()||t.isOpera())&&!!window.CSS}};function n(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function i(e){if(Array.isArray(e))return e.map(i);if(n(e)){for(var t={},o=Object.keys(e),a=0;a<o.length;a++){var r=o[a],s=e[r];void 0!==s&&(t[r]=i(s))}return t}return e}function o(e,t){var a=Array.prototype.slice.call(arguments,2);"boolean"!=typeof e&&(a.unshift(t),t=e,e=!1);for(var r=0;r<a.length;r++){var s=a[r];if(null!=s)for(var l=Object.keys(s),c=0;c<l.length;c++){var u=l[c];if("__proto__"!==u&&"constructor"!==u){var h=s[u];void 0!==h&&(e&&Array.isArray(h)?t[u]=i(h):e&&n(h)?("object"==typeof t[u]&&null!=t[u]||(t[u]={}),o(!0,t[u],h)):t[u]=h)}}}return t}function a(e){return e.clientWidth}function r(e){return e.clientHeight}function s(e,t,n){if(void 0===n)return getComputedStyle(e)[t];e.style[t]="number"==typeof n?n+"px":n}var l=new WeakMap;function c(e,t,n){var i=l.get(e);if(i||(i={},l.set(e,i)),void 0===n)return i[t];i[t]=n}function u(e,t){var n=l.get(e);n&&(t?delete n[t]:l.delete(e))}var h=function(e,t,n){var i=new CustomEvent(t,{detail:n||[],bubbles:!0,cancelable:!0});return e.dispatchEvent(i),i};function p(e,t,n){return h(e,t,n)}function f(e){h=e}var d=new WeakMap;function m(e,t,n){e.addEventListener(t,n);var i=d.get(e);i||(i=[],d.set(e,i)),i.push({type:t,handler:n})}function g(e,t,n){var i;if(t&&n)return e.removeEventListener(t,n),void((i=d.get(e))&&d.set(e,i.filter(function(e){return e.type!==t||e.handler!==n})));if(i=d.get(e)){for(var o=[],a=0;a<i.length;a++)t&&i[a].type!==t?o.push(i[a]):e.removeEventListener(i[a].type,i[a].handler);d.set(e,o)}}var v=Object.freeze({__proto__:null,bind:m,css:s,data:c,extend:o,height:r,removeData:u,setTrigger:f,trigger:p,unbind:g,width:a}),x=function(e,n){var i=n.getElementsByClassName(e)[0];if(!i&&((i=document.createElement("canvas")).className=e,i.style.direction="ltr",i.style.position="absolute",i.style.left="0px",i.style.top="0px",n.appendChild(i),!i.getContext))throw new Error("Canvas is not available.");this.element=i;var o=this.context=i.getContext("2d");this.pixelRatio=t.getPixelRatio(o);var s=a(n),l=r(n);this.resize(s,l),this.SVGContainer=null,this.SVG={},this._textCache={}};function b(e,t){e.transform.baseVal.clear(),t&&t.forEach(function(t){e.transform.baseVal.appendItem(t)})}x.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var n=this.element,i=this.context,o=this.pixelRatio;this.width!==e&&(n.width=e*o,n.style.width=e+"px",this.width=e),this.height!==t&&(n.height=t*o,n.style.height=t+"px",this.height=t),i.restore(),i.save(),i.scale(o,o)},x.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},x.prototype.render=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var n=this.getSVGLayer(t),i=e[t],o=n.style.display;for(var a in n.style.display="none",i)if(Object.prototype.hasOwnProperty.call(i,a)){var r=i[a];for(var s in r)if(Object.prototype.hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,h=0;u[h];h++)if((l=u[h]).active)l.rendered||(n.appendChild(l.element),l.rendered=!0);else if(u.splice(h--,1),l.rendered){for(;l.element.firstChild;)l.element.removeChild(l.element.firstChild);l.element.parentNode.removeChild(l.element)}0===u.length&&(c.measured?c.measured=!1:delete r[s])}}n.style.display=o}},x.prototype.getSVGLayer=function(e){var t,n=this.SVG[e];return n||(this.SVGContainer?t=this.SVGContainer.firstChild:(this.SVGContainer=document.createElement("div"),this.SVGContainer.className="flot-svg",this.SVGContainer.style.position="absolute",this.SVGContainer.style.top="0px",this.SVGContainer.style.left="0px",this.SVGContainer.style.height="100%",this.SVGContainer.style.width="100%",this.SVGContainer.style.pointerEvents="none",this.element.parentNode.appendChild(this.SVGContainer),(t=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",t.style.height="100%",this.SVGContainer.appendChild(t)),(n=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.bottom="0px",n.style.right="0px",t&&t.appendChild(n),this.SVG[e]=n),n},x.prototype.getTextInfo=function(e,t,n,i,o){var a,r,s,l;t=""+t,a="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(r=this._textCache[e])&&(r=this._textCache[e]={}),null==(s=r[a])&&(s=r[a]={});var c=function(e){return e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0")}(t);if(!(l=s[c])){var u=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("<br>"))y(t,u,-9999);else{var h=document.createTextNode(t);u.appendChild(h)}u.style.position="absolute",u.style.maxWidth=o,u.setAttributeNS(null,"x",String(-9999)),u.setAttributeNS(null,"y",String(-9999)),"object"==typeof n?(u.style.font=a,u.style.fill=n.fill):"string"==typeof n&&u.setAttribute("class",n),this.getSVGLayer(e).appendChild(u);var p=u.getBBox();for(l=s[c]={width:p.width,height:p.height,measured:!0,element:u,positions:[]};u.firstChild;)u.removeChild(u.firstChild);u.parentNode&&u.parentNode.removeChild(u)}return l.measured=!0,l},x.prototype.addText=function(e,t,n,i,o,a,r,s,l,c){var u=this.getTextInfo(e,i,o,a,r),h=u.positions;"center"===s?t-=u.width/2:"right"===s&&(t-=u.width),"middle"===l?n-=u.height/2:"bottom"===l&&(n-=u.height),n+=.75*u.height;for(var p,f=0;h[f];f++){if((p=h[f]).x===t&&p.y===n&&p.text===i)return p.active=!0,void b(p.element,c);if(!1===p.active)return p.active=!0,p.text=i,-1!==i.indexOf("<br>")?(n-=.25*u.height,y(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.x=t,p.y=n,void b(p.element,c)}p={active:!0,rendered:!1,element:h.length?u.element.cloneNode():u.element,text:i,x:t,y:n},h.push(p),-1!==i.indexOf("<br>")?(n-=.25*u.height,y(i,p.element,t)):p.element.textContent=i,p.element.setAttributeNS(null,"x",t),p.element.setAttributeNS(null,"y",n),p.element.style.textAlign=s,b(p.element,c)};var y=function(e,t,n){var i,o,a,r=e.split("<br>");for(o=0;o<r.length;o++)t.childNodes[o]?i=t.childNodes[o]:(i=document.createElementNS("http://www.w3.org/2000/svg","tspan"),t.appendChild(i)),i.textContent=r[o],a=(0===o?0:1)+"em",i.setAttributeNS(null,"dy",a),i.setAttributeNS(null,"x",n)};x.prototype.removeText=function(e,t,n,i,o,a){var r,s;if(null==i){var l=this._textCache[e];if(null!=l)for(var c in l)if(Object.prototype.hasOwnProperty.call(l,c)){var u=l[c];for(var h in u)if(Object.prototype.hasOwnProperty.call(u,h)){var p=u[h].positions;null!=p&&p.forEach(function(e){e.active=!1})}}}else(p=(r=this.getTextInfo(e,i,o,a)).positions).forEach(function(e){s=n+.75*r.height,e.x===t&&e.y===s&&e.text===i&&(e.active=!1)})},x.prototype.clearCache=function(){var e=this._textCache;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))for(var n=this.getSVGLayer(t);n.firstChild;)n.removeChild(n.firstChild);this._textCache={}};var w={make:function(e,t,n,i){var o={};return o.r=e||0,o.g=t||0,o.b=n||0,o.a=null!=i?i:1,o.add=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]+=t;return o.normalize()},o.scale=function(e,t){for(var n=0;n<e.length;++n)o[e.charAt(n)]*=t;return o.normalize()},o.toString=function(){return o.a>=1?"rgb("+[o.r,o.g,o.b].join(",")+")":"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"},o.normalize=function(){function e(e,t,n){return t<e?e:t>n?n:t}return o.r=e(0,parseInt(o.r),255),o.g=e(0,parseInt(o.g),255),o.b=e(0,parseInt(o.b),255),o.a=e(0,o.a,1),o},o.clone=function(){return w.make(o.r,o.b,o.g,o.a)},o.normalize()},extract:function(e,t){var n;do{var i=t.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});if(""!==(n=(e.style[i]||getComputedStyle(e)[t]||"").toLowerCase())&&"transparent"!==n)break;e=e.parentElement}while(null!=e&&"body"!==e.nodeName.toLowerCase());return"rgba(0, 0, 0, 0)"===n&&(n="transparent"),w.parse(n)},parse:function(e){var t,n=w.make;if(t=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10));if(t=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(parseInt(t[1],10),parseInt(t[2],10),parseInt(t[3],10),parseFloat(t[4]));if(t=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]));if(t=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(e))return n(2.55*parseFloat(t[1]),2.55*parseFloat(t[2]),2.55*parseFloat(t[3]),parseFloat(t[4]));if(t=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(e))return n(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16));if(t=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(e))return n(parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16));var i=(e||"").trim().toLowerCase();return"transparent"===i?n(255,255,255,0):n((t=T[i]||[0,0,0])[0],t[1],t[2])}},T={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]},k={saturate:function(e){return e===1/0?Number.MAX_VALUE:e===-1/0?-Number.MAX_VALUE:e},delta:function(e,t,n){return(t-e)/n===1/0?t/n-e/n:(t-e)/n},multiply:function(e,t){return k.saturate(e*t)},multiplyAdd:function(e,t,n){if(isFinite(e*t))return k.saturate(e*t+n);for(var i=n,o=0;o<t;o++)i+=e;return k.saturate(i)},floorInBase:function(e,t){return t*Math.floor(e/t)}},M={SNAPPING_CONSTANT:20,PANHINT_LENGTH_CONSTANT:10,MINOR_TICKS_COUNT_CONSTANT:4,TICK_LENGTH_CONSTANT:10,ZOOM_DISTANCE_MARGIN:25},S=new function(){function e(e,t,n,i,o,a,r,s,l,c,u){var h,p,f,d,m=e+i,g=e+o,v=n,x=t,b=!1;h=p=f=!0,c?(b=p=f=!0,h=!1,x=t+i,v=t+o,(g=e)<(m=n)&&(d=g,g=m,m=d,h=!0,p=!1)):(h=p=f=!0,b=!1,m=e+i,g=e+o,(x=t)<(v=n)&&(d=x,x=v,v=d,b=!0,f=!1)),g<r.min||m>r.max||x<s.min||v>s.max||(m<r.min&&(m=r.min,h=!1),g>r.max&&(g=r.max,p=!1),v<s.min&&(v=s.min,b=!1),x>s.max&&(x=s.max,f=!1),m=r.p2c(m),v=s.p2c(v),g=r.p2c(g),x=s.p2c(x),a&&(l.fillStyle=a(v,x),l.fillRect(m,x,g-m,v-x)),u>0&&(h||p||f||b)&&(l.beginPath(),l.moveTo(m,v),h?l.lineTo(m,x):l.moveTo(m,x),f?l.lineTo(g,x):l.moveTo(g,x),p?l.lineTo(g,v):l.moveTo(g,v),b?l.lineTo(m,v):l.moveTo(m,v),l.stroke()))}function t(e,t,n,i,o){var a=e.fill;if(!a)return null;if(e.fillColor)return o(e.fillColor,n,i,t);var r=w.parse(t);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}this.drawSeriesLines=function(e,n,i,o,a,r,s){n.save(),n.translate(i.left,i.top),n.lineJoin="round",e.lines.dashes&&n.setLineDash&&n.setLineDash(e.lines.dashes);var l={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(l.points=e.decimate(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var c=e.lines.lineWidth;n.lineWidth=c,n.strokeStyle=e.color;var u=t(e.lines,e.color,0,a,s);u&&(n.fillStyle=u,function(e,t,n,i,o,a){for(var r=e.points,s=e.pointsize,l=i>n.min?Math.min(n.max,i):n.min,c=0,u=1,h=!1,p=0,f=0,d=null,m=null;!(s>0&&c>r.length+s);){var g=r[(c+=s)-s],v=r[c-s+u],x=r[c],b=r[c+u];if(-2===s&&(v=b=l),h){if(s>0&&null!=g&&null==x){f=c,s=-s,u=2;continue}if(s<0&&c===p+s){o.fill(),h=!1,u=1,c=p=f+(s=-s);continue}}if(null!=g&&null!=x){if(a&&(null!==d&&null!==m?(x=g,b=v,g=d,v=m,d=null,m=null,c-=s):v!==b&&g!==x&&(b=v,d=x,m=v)),g<=x&&g<t.min){if(x<t.min)continue;v=(t.min-g)/(x-g)*(b-v)+v,g=t.min}else if(x<=g&&x<t.min){if(g<t.min)continue;b=(t.min-g)/(x-g)*(b-v)+v,x=t.min}if(g>=x&&g>t.max){if(x>t.max)continue;v=(t.max-g)/(x-g)*(b-v)+v,g=t.max}else if(x>=g&&x>t.max){if(g>t.max)continue;b=(t.max-g)/(x-g)*(b-v)+v,x=t.max}if(h||(o.beginPath(),o.moveTo(t.p2c(g),n.p2c(l)),h=!0),v>=n.max&&b>=n.max)o.lineTo(t.p2c(g),n.p2c(n.max)),o.lineTo(t.p2c(x),n.p2c(n.max));else if(v<=n.min&&b<=n.min)o.lineTo(t.p2c(g),n.p2c(n.min)),o.lineTo(t.p2c(x),n.p2c(n.min));else{var y=g,w=x;v<=b&&v<n.min&&b>=n.min?(g=(n.min-v)/(b-v)*(x-g)+g,v=n.min):b<=v&&b<n.min&&v>=n.min&&(x=(n.min-v)/(b-v)*(x-g)+g,b=n.min),v>=b&&v>n.max&&b<=n.max?(g=(n.max-v)/(b-v)*(x-g)+g,v=n.max):b>=v&&b>n.max&&v<=n.max&&(x=(n.max-v)/(b-v)*(x-g)+g,b=n.max),g!==y&&o.lineTo(t.p2c(y),n.p2c(v)),o.lineTo(t.p2c(g),n.p2c(v)),o.lineTo(t.p2c(x),n.p2c(b)),x!==w&&(o.lineTo(t.p2c(x),n.p2c(b)),o.lineTo(t.p2c(w),n.p2c(b)))}}else d=null,m=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,n,e.lines.steps)),c>0&&function(e,t,n,i,o,a,r){var s=e.points,l=e.pointsize,c=null,u=null,h=0,p=0,f=0,d=0,m=null,g=null,v=0,x=function(e){h=s[e-l],p=s[e-l+1],f=s[e],d=s[e+1]},b=function(){return null!==m&&null!==g?(f=h,d=p,h=m,p=g,m=null,g=null,!0):(p!==d&&h!==f&&(d=p,m=f,g=p),!1)},y=function(){if(p<=d&&p<o.min){if(d<o.min)return!0;h=(o.min-p)/(d-p)*(f-h)+h,p=o.min}else if(d<=p&&d<o.min){if(p<o.min)return!0;f=(o.min-p)/(d-p)*(f-h)+h,d=o.min}},w=function(){if(p>=d&&p>o.max){if(d>o.max)return!0;h=(o.max-p)/(d-p)*(f-h)+h,p=o.max}else if(d>=p&&d>o.max){if(p>o.max)return!0;f=(o.max-p)/(d-p)*(f-h)+h,d=o.max}},T=function(){if(h<=f&&h<i.min){if(f<i.min)return!0;p=(i.min-h)/(f-h)*(d-p)+p,h=i.min}else if(f<=h&&f<i.min){if(h<i.min)return!0;d=(i.min-h)/(f-h)*(d-p)+p,f=i.min}},k=function(){if(h>=f&&h>i.max){if(f>i.max)return!0;p=(i.max-h)/(f-h)*(d-p)+p,h=i.max}else if(f>=h&&f>i.max){if(h>i.max)return!0;d=(i.max-h)/(f-h)*(d-p)+p,f=i.max}},M=function(){h===c&&p===u||a.moveTo(i.p2c(h)+0,o.p2c(p)+0),c=f,u=d,a.lineTo(i.p2c(f)+0,o.p2c(d)+0)};for(a.beginPath(),v=l;v<s.length;v+=l)x(v),null!==h&&null!==f?isNaN(h)||isNaN(f)||isNaN(p)||isNaN(d)?(c=null,u=null):(r&&b()&&(v-=l),y()||w()||T()||k()||M()):(m=null,g=null);null!==m&&null!==g&&(x(v),b(),y()||w()||T()||k()||M()),a.stroke()}(l,0,0,e.xaxis,e.yaxis,n,e.lines.steps),n.restore()},this.drawSeriesPoints=function(e,n,i,o,a,r,s){function l(e,t,n,i,o,a){e.moveTo(t+i,n),e.arc(t,n,i,0,o?Math.PI:2*Math.PI,!1)}l.fill=!0,n.save(),n.translate(i.left,i.top);var c={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimatePoints&&(c.points=e.decimatePoints(e,e.xaxis.min,e.xaxis.max,o,e.yaxis.min,e.yaxis.max,a));var u,h=e.points.lineWidth,p=e.points.radius,f=e.points.symbol;"circle"===f?u=l:"string"==typeof f&&r&&r[f]?u=r[f]:"function"==typeof r&&(u=r),0===h&&(h=1e-4),n.lineWidth=h,n.fillStyle=t(e.points,e.color,null,null,s),n.strokeStyle=e.color,function(e,t,i,o,a,r,s,l){var c=e.points,u=e.pointsize;n.beginPath();for(var h=0;h<c.length;h+=u){var p=c[h],f=c[h+1];null==p||p<r.min||p>r.max||f<s.min||f>s.max||(p=r.p2c(p),f=s.p2c(f)+0,l(n,p,f,t,a,true))}l.fill&&n.fill(),n.stroke()}(c,p,0,0,!1,e.xaxis,e.yaxis,u),n.restore()},this.drawSeriesBars=function(n,i,o,a,r,s,l){i.save(),i.translate(o.left,o.top);var c,u={format:n.datapoints.format,points:n.datapoints.points,pointsize:n.datapoints.pointsize};n.decimate&&(u.points=n.decimate(n,n.xaxis.min,n.xaxis.max,a)),i.lineWidth=n.bars.lineWidth,i.strokeStyle=n.color;var h=n.bars.barWidth[0]||n.bars.barWidth;switch(n.bars.align){case"left":c=0;break;case"right":c=-h;break;default:c=-h/2}!function(t,o,a,r,s,l){for(var c=t.points,u=t.pointsize,h=n.bars.fillTowards||0,p=h>l.min?Math.min(l.max,h):l.min,f=0;f<c.length;f+=u)if(null!=c[f]){var d=3===u?c[f+2]:p;e(c[f],c[f+1],d,o,a,r,s,l,i,n.bars.horizontal,n.bars.lineWidth)}}(u,c,c+h,n.bars.fill?function(e,i){return t(n.bars,n.color,e,i,l)}:null,n.xaxis,n.yaxis),i.restore()},this.drawBar=e};function C(e){var t,n=[],i=k.saturate(k.floorInBase(e.min,e.tickSize)),o=0,a=Number.NaN;i===-Number.MAX_VALUE&&(n.push(i),i=k.floorInBase(e.min+e.tickSize,e.tickSize));do{t=a,a=k.multiplyAdd(e.tickSize,o,i),n.push(a),++o}while(a<e.max&&a!==t);return n}function P(e,t,n){var i=t.tickDecimals;if(-1!==(""+e).indexOf("e"))return L(e,t,n);n>0&&(t.tickDecimals=n);var o=t.tickDecimals?parseFloat("1e"+t.tickDecimals):1,a=""+Math.round(e*o)/o;if(null!=t.tickDecimals){var r=a.indexOf("."),s=-1===r?0:a.length-r-1;s<t.tickDecimals&&(a=(s?a:a+".")+(""+o).substr(1,t.tickDecimals-s))}return t.tickDecimals=i,a}function L(e,t,n){var i=(""+e).indexOf("e"),o=parseInt((""+e).substr(i+1)),a=-1!==i?o:e>0?Math.floor(Math.log(e)/Math.LN10):0,r=parseFloat("1e"+a),s=e/r;if(n){var l=N(e,n);return(e/r).toFixed(l)+"e"+a}return t.tickDecimals>0?s.toFixed(N(e,t.tickDecimals))+"e"+a:s.toFixed()+"e"+a}function N(e,t){var n=Math.log(Math.abs(e))*Math.LOG10E,i=Math.abs(n+t);return i<=20?Math.floor(i):20}function E(e,t,n,i){var l=[],h={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoScaleMargin:null,autoScale:"exact",windowSize:null,growOnly:null,ticks:null,tickFormatter:null,showTickLabels:"major",labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,showMinorTicks:null,showTicks:null,gridLines:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},yaxis:{autoScaleMargin:.02,autoScale:"loose",growOnly:null,position:"left",showTickLabels:"major",offset:{below:0,above:0},boxPosition:{centerX:0,centerY:0}},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:1,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,horizontal:!1,barWidth:.8,fill:!0,fillColor:null,align:"left",zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:1,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:15},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},f=null,d=null,v=null,b=null,y=null,T=[],L=[],N={left:0,right:0,top:0,bottom:0},E=0,z=0,A={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],setupGrid:[],adjustSeriesDataRange:[],setRange:[],drawBackground:[],drawSeries:[],drawAxis:[],draw:[],findNearbyItems:[],axisReserveSpace:[],bindEvents:[],drawOverlay:[],resize:[],shutdown:[]},O=this,I={},R=null;O.setData=Y,O.setupGrid=_,O.draw=$,O.getPlaceholder=function(){return e},O.getCanvas=function(){return f.element},O.getSurface=function(){return f},O.getEventHolder=function(){return v},O.getPlotOffset=function(){return N},O.width=function(){return E},O.height=function(){return z},O.offset=function(){var e=v.getBoundingClientRect(),t={left:e.left+window.scrollX,top:e.top+window.scrollY};return t.left+=N.left,t.top+=N.top,t},O.getData=function(){return l},O.getAxes=function(){var e={};return T.concat(L).forEach(function(t){t&&(e[t.direction+(1!==t.n?t.n:"")+"axis"]=t)}),e},O.getXAxes=function(){return T},O.getYAxes=function(){return L},O.c2p=function(e){var t,n,i={};for(t=0;t<T.length;++t)(n=T[t])&&n.used&&(i["x"+n.n]=n.c2p(e.left));for(t=0;t<L.length;++t)(n=L[t])&&n.used&&(i["y"+n.n]=n.c2p(e.top));return void 0!==i.x1&&(i.x=i.x1),void 0!==i.y1&&(i.y=i.y1),i},O.p2c=function(e){var t,n,i,o={};for(t=0;t<T.length;++t)if((n=T[t])&&n.used&&(null==e[i="x"+n.n]&&1===n.n&&(i="x"),null!=e[i])){o.left=n.p2c(e[i]);break}for(t=0;t<L.length;++t)if((n=L[t])&&n.used&&(null==e[i="y"+n.n]&&1===n.n&&(i="y"),null!=e[i])){o.top=n.p2c(e[i]);break}return o},O.getOptions=function(){return h},O.triggerRedrawOverlay=he,O.pointOffset=function(e){return{left:parseInt(T[X(e,"x")-1].p2c(+e.x)+N.left,10),top:parseInt(L[X(e,"y")-1].p2c(+e.y)+N.top,10)}},O.shutdown=j,O.destroy=function(){j(),u(e,"plot"),e.innerHTML="",l=[],h=null,f=null,d=null,v=null,b=null,y=null,T=[],L=[],A=null,O=null},O.resize=function(){var t=a(e),n=r(e);f.resize(t,n),d.resize(t,n),F(A.resize,[t,n])},O.clearTextCache=function(){f.clearCache(),d.clearCache()},O.autoScaleAxis=U,O.computeRangeForDataSeries=function(e,t,n){for(var i=e.datapoints.points,o=e.datapoints.pointsize,a=e.datapoints.format,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l={xmin:r,ymin:r,xmax:s,ymax:s},c=0;c<i.length;c+=o)if(null!==i[c]&&("function"!=typeof n||n(i[c])))for(var u=0;u<o;++u){var h=i[c+u],p=a[u];null!=p&&("function"!=typeof n||n(h))&&(t||p.computeRange)&&h!==1/0&&h!==-1/0&&(!0===p.x&&(h<l.xmin&&(l.xmin=h),h>l.xmax&&(l.xmax=h)),!0===p.y&&(h<l.ymin&&(l.ymin=h),h>l.ymax&&(l.ymax=h)))}return l},O.adjustSeriesDataRange=function(e,t){if(e.bars.show){var n,i=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!i&&function(e){var t=[],n=e.datapoints.pointsize,i=Number.MAX_VALUE;e.datapoints.points.length<=n&&(i=1);for(let i=e.bars.horizontal?1:0;i<e.datapoints.points.length;i+=n)isFinite(e.datapoints.points[i])&&null!==e.datapoints.points[i]&&t.push(e.datapoints.points[i]);(t=t.filter(function(e,t,n){return n.indexOf(e)===t})).sort(function(e,t){return e-t});for(let e=1;e<t.length;e++){var o=Math.abs(t[e]-t[e-1]);o<i&&isFinite(o)&&(i=o)}"number"==typeof e.bars.barWidth?e.bars.barWidth=e.bars.barWidth*i:e.bars.barWidth[0]=e.bars.barWidth[0]*i}(e);var o=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":n=0;break;case"right":n=-o;break;default:n=-o/2}e.bars.horizontal?(t.ymin+=n,t.ymax+=n+o):(t.xmin+=n,t.xmax+=n+o)}return(e.bars.show&&e.bars.zero||e.lines.show&&e.lines.zero)&&e.datapoints.pointsize<=2&&(t.ymin=Math.min(0,t.ymin),t.ymax=Math.max(0,t.ymax)),t},O.findNearbyItem=function(e,t,n,i,o){var a=le(e,t,n,i,o);return void 0!==a[0]?a[0]:null},O.findNearbyItems=le,O.findNearbyInterpolationPoint=function(e,t,n){var i,o,a,r,s,c,u,h=Number.MAX_VALUE;for(i=0;i<l.length;++i){if(!n(i))continue;var p=l[i].datapoints.points;c=l[i].datapoints.pointsize;const v=p[p.length-c]<p[0]?function(e,t){return e>t}:function(e,t){return t>e};if(!v(e,p[0])){for(o=c;o<p.length&&!v(e,p[o]);o+=c);var f=p[o-c],d=p[o-c+1],m=p[o],g=p[o+1];void 0!==f&&void 0!==m&&void 0!==d&&void 0!==g&&(t=f===m?g:d+(g-d)*(e-f)/(m-f),(a=(r=Math.abs(l[i].xaxis.p2c(m)-e))*r+(s=Math.abs(l[i].yaxis.p2c(g)-t))*s)<h&&(h=a,u=[e,t,i,o]))}}return u?(i=u[2],o=u[3],c=l[i].datapoints.pointsize,f=(p=l[i].datapoints.points)[o-c],d=p[o-c+1],m=p[o],g=p[o+1],{datapoint:[u[0],u[1]],leftPoint:[f,d],rightPoint:[m,g],seriesIndex:i}):null},O.computeValuePrecision=Z,O.computeTickSize=J,O.addEventHandler=function(e,t,n,i){var o=n+e,a=I[o]||[];a.push({event:e,handler:t,eventHolder:n,priority:i}),a.sort((e,t)=>t.priority-e.priority),a.forEach(e=>{g(e.eventHolder,e.event,e.handler),m(e.eventHolder,e.event,e.handler)}),I[o]=a},O.hooks=A;var D=M.MINOR_TICKS_COUNT_CONSTANT,W=M.TICK_LENGTH_CONSTANT;function F(e,t){t=[O].concat(t);for(var n=0;n<e.length;++n)e[n].apply(this,t)}function Y(e){var t=l;l=function(e){for(var t=[],n=0;n<e.length;++n){var i=o(!0,{},h.series);null!=e[n].data?(i.data=e[n].data,delete e[n].data,o(!0,i,e[n]),e[n].data=i.data):i.data=e[n],t.push(i)}return t}(e),function(){var e,t=l.length,n=-1;for(e=0;e<l.length;++e){var i=l[e].color;null!=i&&(t--,"number"==typeof i&&i>n&&(n=i))}t<=n&&(t=n+1);var o,a=[],r=h.colors,s=r.length,c=0,u=Math.max(0,l.length-t);for(e=0;e<t;e++)o=w.parse(r[(u+e)%s]||"#666"),e%s===0&&e&&(c=c>=0?c<.5?-c-.2:0:-c),a[e]=o.scale("rgb",1+c);var p,f=0;for(e=0;e<l.length;++e){if(null==(p=l[e]).color?(p.color=a[f].toString(),++f):"number"==typeof p.color&&(p.color=a[p.color].toString()),null==p.lines.show){var d,m=!0;for(d in p)if(p[d]&&p[d].show){m=!1;break}m&&(p.lines.show=!0)}null==p.lines.zero&&(p.lines.zero=!!p.lines.fill),p.xaxis=G(T,X(p,"x")),p.yaxis=G(L,X(p,"y"))}}(),function(e){var t,n,i,o,a,r,s,c,u,h,p,f,d=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY;function g(e,t,n){t<e.datamin&&t!==-1/0&&(e.datamin=t),n>e.datamax&&n!==1/0&&(e.datamax=n)}function v(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(B().forEach(function(e){!0!==e.options.growOnly?(e.datamin=d,e.datamax=m):(void 0===e.datamin&&(e.datamin=d),void 0===e.datamax&&(e.datamax=m)),e.used=!1}),t=0;t<l.length;++t)(a=l[t]).datapoints={points:[]},0===a.datapoints.points.length&&(a.datapoints.points=v(e,t)),F(A.processRawData,[a,a.data,a.datapoints]);for(t=0;t<l.length;++t)if(p=(a=l[t]).data,(f=a.datapoints.format)||((f=[]).push({x:!0,y:!1,number:!0,required:!0,computeRange:"none"!==a.xaxis.options.autoScale,defaultValue:null}),f.push({x:!1,y:!0,number:!0,required:!0,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:null}),(a.stack||a.bars.show||a.lines.show&&a.lines.fill)&&(null!=a.datapoints.pointsize?a.datapoints.pointsize:a.data&&a.data[0]&&a.data[0].length?a.data[0].length:3)>2&&f.push({x:a.bars.horizontal,y:!a.bars.horizontal,number:!0,required:!1,computeRange:"none"!==a.yaxis.options.autoScale,defaultValue:0}),a.datapoints.format=f),a.xaxis.used=a.yaxis.used=!0,null==a.datapoints.pointsize){for(a.datapoints.pointsize=f.length,s=a.datapoints.pointsize,r=a.datapoints.points,n=i=0;n<p.length;++n,i+=s){var x=null==(h=p[n]);if(!x)for(o=0;o<s;++o)c=h[o],(u=f[o])&&(u.number&&null!=c&&(c=+c,isNaN(c)&&(c=null)),null==c&&(u.required&&(x=!0),null!=u.defaultValue&&(c=u.defaultValue))),r[i+o]=c;if(x)for(o=0;o<s;++o)null!=(c=r[i+o])&&(u=f[o]).computeRange&&(u.x&&g(a.xaxis,c,c),u.y&&g(a.yaxis,c,c)),r[i+o]=null}r.length=i}for(t=0;t<l.length;++t)a=l[t],F(A.processDatapoints,[a,a.datapoints]);for(t=0;t<l.length;++t)if(!(f=(a=l[t]).datapoints.format).every(function(e){return!e.computeRange})){var b=O.adjustSeriesDataRange(a,O.computeRangeForDataSeries(a));F(A.adjustSeriesDataRange,[a,b]),g(a.xaxis,b.xmin,b.xmax),g(a.yaxis,b.ymin,b.ymax)}B().forEach(function(e){e.datamin===d&&(e.datamin=null),e.datamax===m&&(e.datamax=null)})}(t)}function X(e,t){var n=e[t+"axis"];return"object"==typeof n&&(n=n.n),"number"!=typeof n&&(n=1),n}function B(){return T.concat(L).filter(function(e){return e})}function G(e,t){return e[t-1]||(e[t-1]={n:t,direction:e===T?"x":"y",options:o(!0,{},e===T?h.xaxis:h.yaxis)}),e[t-1]}function j(){R&&window.clearTimeout(R),F(A.shutdown,[v])}function H(e){function t(e){return e}var n,i,o=e.options.transform||t,a=e.options.inverseTransform;"x"===e.direction?(n=isFinite(o(e.max)-o(e.min))?e.scale=E/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(k.delta(o(e.min),o(e.max),E)),i=Math.min(o(e.max),o(e.min))):(n=-(n=isFinite(o(e.max)-o(e.min))?e.scale=z/Math.abs(o(e.max)-o(e.min)):e.scale=1/Math.abs(k.delta(o(e.min),o(e.max),z))),i=Math.max(o(e.max),o(e.min))),e.p2c=o===t?function(e){return isFinite(e-i)?(e-i)*n:(e/4-i/4)*n*4}:function(e){var t=o(e);return isFinite(t-i)?(t-i)*n:(t/4-i/4)*n*4},e.c2p=a?function(e){return a(i+e/n)}:function(e){return i+e/n}}function V(e){F(A.axisReserveSpace,[e]);var t=e.labelWidth,n=e.labelHeight,i=e.options.position,o="x"===e.direction,a=e.options.tickLength,r=e.options.showTicks,s=e.options.showMinorTicks,l=e.options.gridLines,c=h.grid.axisMargin,u=h.grid.labelMargin,p=!0,d=!0,m=!1;(o?T:L).forEach(function(t){t&&(t.show||t.reserveSpace)&&(t===e?m=!0:t.options.position===i&&(m?d=!1:p=!1))}),d&&(c=0),null==a&&(a=W),null==r&&(r=!0),null==s&&(s=!0),null==l&&(l=!!p),isNaN(+a)||(u+=r?+a:0),o?(n+=u,"bottom"===i?(N.bottom+=n+c,e.box={top:f.height-N.bottom,height:n}):(e.box={top:N.top+c,height:n},N.top+=n+c)):(t+=u,"left"===i?(e.box={left:N.left+c,width:t},N.left+=t+c):(N.right+=t+c,e.box={left:f.width-N.right,width:t})),e.position=i,e.tickLength=a,e.showMinorTicks=s,e.showTicks=r,e.gridLines=l,e.box.padding=u,e.innermost=p}function q(e,t,n){"x"===e.direction?("bottom"===e.position&&n(t.bottom)&&(e.box.top-=Math.ceil(t.bottom)),"top"===e.position&&n(t.top)&&(e.box.top+=Math.ceil(t.top))):("left"===e.position&&n(t.left)&&(e.box.left+=Math.ceil(t.left)),"right"===e.position&&n(t.right)&&(e.box.left-=Math.ceil(t.right)))}function _(e){var t,n,i=B(),o=h.grid.show;for(n in N)N[n]=0;for(n in F(A.processOffset,[N]),N)"object"==typeof h.grid.borderWidth?N[n]+=o?h.grid.borderWidth[n]:0:N[n]+=o?h.grid.borderWidth:0;if(i.forEach(function(t){var n=t.options;t.show=null==n.show?t.used:n.show,t.reserveSpace=null==n.reserveSpace?t.show:n.reserveSpace,function(e){var t=e.options;e.tickFormatter||("function"==typeof t.tickFormatter?e.tickFormatter=function(){var e=Array.prototype.slice.call(arguments);return""+t.tickFormatter.apply(null,e)}:e.tickFormatter=P)}(t),F(A.setRange,[t,e]),function(e,t){var n="number"==typeof e.options.min?e.options.min:e.min,i="number"==typeof e.options.max?e.options.max:e.max,o=e.options.offset;if(t&&(U(e),n=e.autoScaledMin,i=e.autoScaledMax),(n=(null!=n?n:-1)+(o.below||0))>(i=(null!=i?i:1)+(o.above||0))){var a=n;n=i,i=a,e.options.offset={above:0,below:0}}e.min=k.saturate(n),e.max=k.saturate(i)}(t,e)}),o){E=f.width-N.left-N.right,z=f.height-N.bottom-N.top;var a=i.filter(function(e){return e.show||e.reserveSpace});for(a.forEach(function(e){!function(e){var t,n=e.options;t=K(e.direction,f,n.ticks),e.delta=k.delta(e.min,e.max,t);var i=O.computeValuePrecision(e.min,e.max,e.direction,t,n.tickDecimals);if(e.tickDecimals=Math.max(0,null!=n.tickDecimals?n.tickDecimals:i),e.tickSize=function(e,t,n,i,o){var a=J(e,t,"number"==typeof i.ticks&&i.ticks>0?i.ticks:.3*Math.sqrt("x"===n?f.width:f.height),o);return null!=i.minTickSize&&a<i.minTickSize&&(a=i.minTickSize),i.tickSize||a}(e.min,e.max,e.direction,n,n.tickDecimals),e.tickGenerator||("function"==typeof n.tickGenerator?e.tickGenerator=n.tickGenerator:e.tickGenerator=C),null!=n.alignTicksWithAxis){var o=("x"===e.direction?T:L)[n.alignTicksWithAxis-1];if(o&&o.used&&o!==e){var a=e.tickGenerator(e,O);if(a.length>0&&(null==n.min&&(e.min=Math.min(e.min,a[0])),null==n.max&&a.length>1&&(e.max=Math.max(e.max,a[a.length-1]))),e.tickGenerator=function(e){var t,n,i=[];for(n=0;n<o.ticks.length;++n)t=(o.ticks[n].v-o.min)/(o.max-o.min),t=e.min+t*(e.max-e.min),i.push(t);return i},!e.mode&&null==n.tickDecimals&&e.delta>0){var r=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),s=e.tickGenerator(e,O);s.length>1&&/\..*0$/.test((s[1]-s[0]).toFixed(r))||(e.tickDecimals=r)}}}}(e),function(e){var t,n,i=e.options.ticks,o=[];for(null==i||"number"==typeof i&&i>0?o=e.tickGenerator(e,O):i&&(o="function"==typeof i?i(e):i),e.ticks=[],t=0;t<o.length;++t){var a=null,r=o[t];"object"==typeof r?(n=+r[0],r.length>1&&(a=r[1])):n=+r,isNaN(n)||e.ticks.push(Q(n,a,e,"major"))}}(e),function(e,t,n){"loose"===e.options.autoScale&&t.length>0&&function(e){return e.some(e=>e.datapoints.points.length>0)}(n)&&(e.min=Math.min(e.min,t[0].v),e.max=Math.max(e.max,t[t.length-1].v))}(e,e.ticks,l),H(e),function(e,t){(function(e,t){if("endpoints"===e.options.showTickLabels)return!0;if("all"===e.options.showTickLabels){var n=t.filter(function(t){return t.bars.horizontal?t.yaxis===e:t.xaxis===e}),i=n.some(function(e){return!e.bars.show});return 0===n.length||i}return"major"!==e.options.showTickLabels&&"none"!==e.options.showTickLabels&&void 0})(e,t)&&(e.ticks.unshift(Q(e.min,null,e,"min")),e.ticks.push(Q(e.max,null,e,"max")))}(e,l),function(e){for(var t=e.options,n="none"!==t.showTickLabels&&e.ticks?e.ticks:[],i="major"===t.showTickLabels||"all"===t.showTickLabels,o="endpoints"===t.showTickLabels||"all"===t.showTickLabels,a=t.labelWidth||0,r=t.labelHeight||0,s=e.direction+"Axis "+e.direction+e.n+"Axis",l="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+s,c=t.font||"flot-tick-label tickLabel",u=0;u<n.length;++u){var h=n[u],p=h.label;if(h.label&&!(!1===i&&u>0&&u<n.length-1)&&(!1!==o||0!==u&&u!==n.length-1)){"object"==typeof h.label&&(p=h.label.name);var d=f.getTextInfo(l,p,c);a=Math.max(a,d.width),r=Math.max(r,d.height)}}e.labelWidth=t.labelWidth||a,e.labelHeight=t.labelHeight||r}(e)}),t=a.length-1;t>=0;--t)V(a[t]);!function(){var e,t=h.grid.minBorderMargin;if(null==t)for(t=0,e=0;e<l.length;++e)t=Math.max(t,2*(l[e].points.radius+l[e].points.lineWidth/2));var n,i={},o={left:t,right:t,top:t,bottom:t};for(n in B().forEach(function(e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(o.left=Math.max(o.left,e.labelWidth/2),o.right=Math.max(o.right,e.labelWidth/2)):(o.bottom=Math.max(o.bottom,e.labelHeight/2),o.top=Math.max(o.top,e.labelHeight/2)))}),o)i[n]=o[n]-N[n];T.concat(L).forEach(function(e){q(e,i,function(e){return e>0})}),N.left=Math.ceil(Math.max(o.left,N.left)),N.right=Math.ceil(Math.max(o.right,N.right)),N.top=Math.ceil(Math.max(o.top,N.top)),N.bottom=Math.ceil(Math.max(o.bottom,N.bottom))}(),a.forEach(function(e){!function(e){"x"===e.direction?(e.box.left=N.left-e.labelWidth/2,e.box.width=f.width-N.left-N.right+e.labelWidth):(e.box.top=N.top-e.labelHeight/2,e.box.height=f.height-N.bottom-N.top+e.labelHeight)}(e)})}if(h.grid.margin){for(n in N){var r=h.grid.margin||0;N[n]+="number"==typeof r?r:r[n]||0}T.concat(L).forEach(function(e){q(e,h.grid.margin,function(e){return null!=e})})}E=f.width-N.left-N.right,z=f.height-N.bottom-N.top,i.forEach(function(e){H(e)}),o&&B().forEach(function(e){var t,n,i,o,a,r,s,l=e.box,c=e.direction+"Axis "+e.direction+e.n+"Axis",u="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+c,h=e.options.font||"flot-tick-label tickLabel",p={x:NaN,y:NaN,width:NaN,height:NaN},d=[],m=function(t,c){return!t||!t.label||t.v<e.min||t.v>e.max?p:(r=f.getTextInfo(u,t.label,h),"x"===e.direction?(o="center",n=N.left+e.p2c(t.v),"bottom"===e.position?i=l.top+l.padding-e.boxPosition.centerY:(i=l.top+l.height-l.padding+e.boxPosition.centerY,a="bottom"),s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}):(a="middle",i=N.top+e.p2c(t.v),"left"===e.position?(n=l.left+l.width-l.padding-e.boxPosition.centerX,o="right"):n=l.left+l.padding+e.boxPosition.centerX,s={x:n-r.width/2-3,y:i-3,width:r.width+6,height:r.height+6}),function(e,t){return t.some(function(t){return n=e.x,i=e.y,o=e.x+e.width,a=e.y+e.height,r=t.x,s=t.y,l=t.x+t.width,c=t.y+t.height,(n<=r&&r<=o||r<=n&&n<=l)&&(i<=s&&s<=a||s<=i&&i<=c);var n,i,o,a,r,s,l,c})}(s,c)?p:(f.addText(u,n,i,t.label,h,null,null,o,a),s))};if(f.removeText(u),F(A.drawAxis,[e,f]),e.show)switch(e.options.showTickLabels){case"none":break;case"endpoints":d.push(m(e.ticks[0],d)),d.push(m(e.ticks[e.ticks.length-1],d));break;case"major":for(d.push(m(e.ticks[0],d)),d.push(m(e.ticks[e.ticks.length-1],d)),t=1;t<e.ticks.length-1;++t)d.push(m(e.ticks[t],d));break;case"all":for(d.push(m(e.ticks[0],[])),d.push(m(e.ticks[e.ticks.length-1],d)),t=1;t<e.ticks.length-1;++t)d.push(m(e.ticks[t],d))}}),F(A.setupGrid,[])}function U(e){var t,n=e.options,i=n.min,o=n.max,a=e.datamin,r=e.datamax;switch(n.autoScale){case"none":i=+(null!=n.min?n.min:a),o=+(null!=n.max?n.max:r);break;case"loose":if(null!=a&&null!=r){i=a,o=r,t=k.saturate(o-i);var s="number"==typeof n.autoScaleMargin?n.autoScaleMargin:.02;i=k.saturate(i-t*s),o=k.saturate(o+t*s),i<0&&a>=0&&(i=0)}else i=n.min,o=n.max;break;case"exact":i=null!=a?a:n.min,o=null!=r?r:n.max;break;case"sliding-window":r>o&&(o=r,i=Math.max(r-(n.windowSize||100),i))}var l=function(e,t){var n=void 0===e?null:e,i=void 0===t?null:t;if(0===i-n){var o=0===i?1:.01,a=null;null==n&&(a-=o),null!=i&&null==n||(i+=o),null!=a&&(n=a)}return{min:n,max:i}}(i,o);i=l.min,o=l.max,!0===n.growOnly&&"none"!==n.autoScale&&"sliding-window"!==n.autoScale&&(i=i<a?i:null!==a?a:i,o=o>r?o:null!==r?r:o),e.autoScaledMin=i,e.autoScaledMax=o}function Z(e,t,n,i,o){var a=K(n,f,i),r=k.delta(e,t,a),s=-Math.floor(Math.log(r)/Math.LN10);o&&s>o&&(s=o);var l=r/parseFloat("1e"+-s);return l>2.25&&l<3&&(null==o||s+1<=o)&&++s,isFinite(s)?s:0}function J(e,t,n,i){var o=k.delta(e,t,n),a=-Math.floor(Math.log(o)/Math.LN10);i&&a>i&&(a=i);var r,s=parseFloat("1e"+-a),l=o/s;return l<1.5?r=1:l<3?(r=2,l>2.25&&(null==i||a+1<=i)&&(r=2.5)):r=l<7.5?5:10,r*s}function K(e,t,n){return"number"==typeof n&&n>0?n:.3*Math.sqrt("x"===e?t.width:t.height)}function Q(e,t,n,i){if(null===t)switch(i){case"min":case"max":var o=function(e,t){var n=Math.floor(t.p2c(e)),i="x"===t.direction?n+1:n-1;return Z(t.c2p(n),t.c2p(i),t.direction,1)}(e,n);isFinite(o),t=n.tickFormatter(e,n,o,O);break;case"major":t=n.tickFormatter(e,n,void 0,O)}return{v:e,label:t}}function $(){f.clear(),F(A.drawBackground,[b]);var e=h.grid;e.show&&e.backgroundColor&&(b.save(),b.translate(N.left,N.top),b.fillStyle=fe(h.grid.backgroundColor,z,0,"rgba(255, 255, 255, 0)"),b.fillRect(0,0,E,z),b.restore()),e.show&&!e.aboveData&&re();for(var t=0;t<l.length;++t)F(A.drawSeries,[b,l[t],t,fe]),se(l[t]);F(A.draw,[b]),e.show&&e.aboveData&&re(),f.render(),he()}function ee(e,t){for(var n,i,o,a,r=B(),s=0;s<r.length;++s)if((n=r[s]).direction===t&&(e[a=t+n.n+"axis"]||1!==n.n||(a=t+"axis"),e[a])){i=e[a].from,o=e[a].to;break}if(e[a]||(n="x"===t?T[0]:L[0],i=e[t+"1"],o=e[t+"2"]),null!=i&&null!=o&&i>o){var l=i;i=o,o=l}return{from:i,to:o,axis:n}}function te(e){var t=e.box,n=0,i=0;return"x"===e.direction?(n=0,i=t.top-N.top+("top"===e.position?t.height:0)):(i=0,n=t.left-N.left+("left"===e.position?t.width:0)+e.boxPosition.centerX),{x:n,y:i}}function ne(e,t){return e%2!=0?Math.floor(t)+.5:t}function ie(e){b.lineWidth=1;var t=te(e),n=t.x,i=t.y;if(e.show){var o=0,a=0;b.strokeStyle=e.options.color,b.beginPath(),"x"===e.direction?o=E+1:a=z+1,"x"===e.direction?i=ne(b.lineWidth,i):n=ne(b.lineWidth,n),b.moveTo(n,i),b.lineTo(n+o,i+a),b.stroke()}}function oe(e){var t=e.tickLength,n=e.showMinorTicks,i=D,o=te(e),a=o.x,r=o.y,s=0;for(b.strokeStyle=e.options.color,b.beginPath(),s=0;s<e.ticks.length;++s){var l,c=e.ticks[s].v,u=0,h=0,p=0,f=0;if(!isNaN(c)&&c>=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),h=t,"top"===e.position&&(h=-h)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=ne(b.lineWidth,a):r=ne(b.lineWidth,r),b.moveTo(a,r),b.lineTo(a+u,r+h)),!0===n&&s<e.ticks.length-1){var d=e.ticks[s].v,m=(e.ticks[s+1].v-d)/(i+1);for(l=1;l<=i;l++){if("x"===e.direction){if(f=t/2,a=ne(b.lineWidth,e.p2c(d+l*m)),"top"===e.position&&(f=-f),a<0||a>E)continue}else if(p=t/2,r=ne(b.lineWidth,e.p2c(d+l*m)),"left"===e.position&&(p=-p),r<0||r>z)continue;b.moveTo(a,r),b.lineTo(a+p,r+f)}}}b.stroke()}function ae(e){var t,n=function(t){var n=h.grid.borderWidth;return("object"==typeof n&&n[e.position]>0||n>0)&&(t===e.min||t===e.max)};for(b.strokeStyle=h.grid.tickColor,b.beginPath(),t=0;t<e.ticks.length;++t){var i=e.ticks[t].v,o=0,a=0,r=0,s=0;isNaN(i)||i<e.min||i>e.max||n(i)||("x"===e.direction?(r=e.p2c(i),s=z,a=-z):(r=0,s=e.p2c(i),o=E),"x"===e.direction?r=ne(b.lineWidth,r):s=ne(b.lineWidth,s),b.moveTo(r,s),b.lineTo(r+o,s+a))}b.stroke()}function re(){var e,t;b.save(),b.translate(N.left,N.top),function(){var e,t=h.grid.markings;if(t){if("function"==typeof t&&((e=O.getAxes()).xmin=e.xaxis.min,e.xmax=e.xaxis.max,e.ymin=e.yaxis.min,e.ymax=e.yaxis.max,t=t(e)),!t)return;var n;for(n=0;n<t.length;++n){var i=t[n],o=ee(i,"x"),a=ee(i,"y");if(null==o.from&&(o.from=o.axis.min),null==o.to&&(o.to=o.axis.max),null==a.from&&(a.from=a.axis.min),null==a.to&&(a.to=a.axis.max),!(o.to<o.axis.min||o.from>o.axis.max||a.to<a.axis.min||a.from>a.axis.max)){o.from=Math.max(o.from,o.axis.min),o.to=Math.min(o.to,o.axis.max),a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max);var r=o.from===o.to,s=a.from===a.to;if(!r||!s)if(o.from=Math.floor(o.axis.p2c(o.from)),o.to=Math.floor(o.axis.p2c(o.to)),a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r||s){var l=i.lineWidth||h.grid.markingsLineWidth,c=l%2?.5:0;b.beginPath(),b.strokeStyle=i.color||h.grid.markingsColor,b.lineWidth=l,r?(b.moveTo(o.to+c,a.from),b.lineTo(o.to+c,a.to)):(b.moveTo(o.from,a.to+c),b.lineTo(o.to,a.to+c)),b.stroke()}else b.fillStyle=i.color||h.grid.markingsColor,b.fillRect(o.from,a.to,o.to-o.from,a.from-a.to)}}}}(),e=B(),t=h.grid.borderWidth;for(var n=0;n<e.length;++n){var i=e[n];i.show&&(ie(i),!0===i.showTicks&&oe(i),!0===i.gridLines&&ae(i))}t&&function(){var e=h.grid.borderWidth,t=h.grid.borderColor;"object"==typeof e||"object"==typeof t?("object"!=typeof e&&(e={top:e,right:e,bottom:e,left:e}),"object"!=typeof t&&(t={top:t,right:t,bottom:t,left:t}),e.top>0&&(b.strokeStyle=t.top,b.lineWidth=e.top,b.beginPath(),b.moveTo(0-e.left,0-e.top/2),b.lineTo(E,0-e.top/2),b.stroke()),e.right>0&&(b.strokeStyle=t.right,b.lineWidth=e.right,b.beginPath(),b.moveTo(E+e.right/2,0-e.top),b.lineTo(E+e.right/2,z),b.stroke()),e.bottom>0&&(b.strokeStyle=t.bottom,b.lineWidth=e.bottom,b.beginPath(),b.moveTo(E+e.right,z+e.bottom/2),b.lineTo(0,z+e.bottom/2),b.stroke()),e.left>0&&(b.strokeStyle=t.left,b.lineWidth=e.left,b.beginPath(),b.moveTo(0-e.left/2,z+e.bottom),b.lineTo(0-e.left/2,0),b.stroke())):(b.lineWidth=e,b.strokeStyle=h.grid.borderColor,b.strokeRect(-e/2,-e/2,E+e,z+e))}(),b.restore()}function se(e){e.lines.show&&S.drawSeriesLines(e,b,N,E,z,O.drawSymbol,fe),e.bars.show&&S.drawSeriesBars(e,b,N,E,z,O.drawSymbol,fe),e.points.show&&S.drawSeriesPoints(e,b,N,E,z,O.drawSymbol,fe)}function le(e,t,n,i,o){for(var a=function(e,t,n,i,o){var a,r=[],s=[],c=i*i+1;for(a=l.length-1;a>=0;--a)if(n(a)){var u=l[a];if(!u.datapoints)return;var h=!1;if(u.lines.show||u.points.show){var p=ce(u,e,t,i,o);p&&(s.push({seriesIndex:a,dataIndex:p.dataIndex,distance:p.distance}),h=!0)}if(u.bars.show&&!h){var f=ue(u,e,t);f>=0&&s.push({seriesIndex:a,dataIndex:f,distance:c})}}for(a=0;a<s.length;a++){var d=s[a].seriesIndex,m=s[a].dataIndex,g=s[a].distance,v=l[d].datapoints.pointsize;r.push({datapoint:l[d].datapoints.points.slice(m*v,(m+1)*v),dataIndex:m,series:l[d],seriesIndex:d,distance:Math.sqrt(g)})}return r}(e,t,n,i,o),r=0;r<l.length;++r)n(r)&&F(A.findNearbyItems,[e,t,l,r,i,o,a]);return a.sort((e,t)=>void 0===t.distance?-1:void 0===e.distance&&void 0!==t.distance?1:e.distance-t.distance)}function ce(e,t,n,i,o){var a=e.xaxis.c2p(t),r=e.yaxis.c2p(n),s=i/e.xaxis.scale,l=i/e.yaxis.scale,c=e.datapoints.points,u=e.datapoints.pointsize,h=o?i:i*i;e.xaxis.options.inverseTransform&&(s=Number.MAX_VALUE),e.yaxis.options.inverseTransform&&(l=Number.MAX_VALUE);for(var p=null,f=0;f<c.length;f+=u){var d=c[f],m=c[f+1];if(null!=d&&!(d-a>s||d-a<-s||m-r>l||m-r<-l)){var g=Math.abs(e.xaxis.p2c(d)-t),v=Math.abs(e.yaxis.p2c(m)-n),x=o?o(g,v):g*g+v*v;x<h&&(h=x,p={dataIndex:f/u,distance:x})}}return p}function ue(e,t,n){var i,o,a=e.bars.barWidth[0]||e.bars.barWidth,r=e.xaxis.c2p(t),s=e.yaxis.c2p(n),l=e.datapoints.points,c=e.datapoints.pointsize;switch(e.bars.align){case"left":i=0;break;case"right":i=-a;break;default:i=-a/2}o=i+a;for(var u=e.bars.fillTowards||0,h=u>e.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,p=-1,f=0;f<l.length;f+=c){var d=l[f],m=l[f+1];if(null!=d){var g=3===c?l[f+2]:h;(e.bars.horizontal?r<=Math.max(g,d)&&r>=Math.min(g,d)&&s>=m+i&&s<=m+o:r>=d+i&&r<=d+o&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(p=f/c)}}return p}function he(){var e=h.interaction.redrawOverlayInterval;-1!==e?R||(R=window.setTimeout(function(){pe(O)},e)):pe()}function pe(e){if(R=null,y){d.clear(),F(A.drawOverlay,[y,d]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),p(e.getPlaceholder(),"drawingdone")}}function fe(e,t,n,i){if("string"==typeof e)return e;if(!isFinite(n)||!isFinite(t))return i;for(var o=b.createLinearGradient(0,n,0,t),a=0,r=e.colors.length;a<r;++a){var s=e.colors[a];if("string"!=typeof s){var l=w.parse(i);null!=s.brightness&&(l=l.scale("rgb",s.brightness)),null!=s.opacity&&(l.a*=s.opacity),s=l.toString()}o.addColorStop(a/(r-1),s)}return o}!function(){for(var e={Canvas:x},t=0;t<i.length;++t){var n=i[t];n.init(O,e),n.options&&o(!0,h,n.options)}}(),function(){s(e,"padding",0),Array.from(e.children).filter(function(e){return!e.classList.contains("flot-overlay")&&!e.classList.contains("flot-base")}).forEach(function(e){e.remove()}),"static"===s(e,"position")&&s(e,"position","relative"),f=new x("flot-base",e),d=new x("flot-overlay",e),b=f.context,y=d.context,g(v=d.element);var t=c(e,"plot");t&&(t.shutdown(),d.clear()),c(e,"plot",O)}(),function(t){o(!0,h,t),t&&t.colors&&(h.colors=t.colors),null==h.xaxis.color&&(h.xaxis.color=w.parse(h.grid.color).scale("a",.22).toString()),null==h.yaxis.color&&(h.yaxis.color=w.parse(h.grid.color).scale("a",.22).toString()),null==h.xaxis.tickColor&&(h.xaxis.tickColor=h.grid.tickColor||h.xaxis.color),null==h.yaxis.tickColor&&(h.yaxis.tickColor=h.grid.tickColor||h.yaxis.color),null==h.grid.borderColor&&(h.grid.borderColor=h.grid.color),null==h.grid.tickColor&&(h.grid.tickColor=w.parse(h.grid.color).scale("a",.22).toString());var n,i,a,r=s(e,"font-size"),l=r?+r.replace("px",""):13,c={style:s(e,"font-style"),size:Math.round(.8*l),variant:s(e,"font-variant"),weight:s(e,"font-weight"),family:s(e,"font-family")};for(a=h.xaxes.length||1,n=0;n<a;++n)(i=h.xaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},h.xaxis,i),h.xaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(a=h.yaxes.length||1,n=0;n<a;++n)(i=h.yaxes[n])&&!i.tickColor&&(i.tickColor=i.color),i=o(!0,{},h.yaxis,i),h.yaxes[n]=i,i.font&&(i.font=o({},c,i.font),i.font.color||(i.font.color=i.color),i.font.lineHeight||(i.font.lineHeight=Math.round(1.15*i.font.size)));for(n=0;n<h.xaxes.length;++n)G(T,n+1).options=h.xaxes[n];for(n=0;n<h.yaxes.length;++n)G(L,n+1).options=h.yaxes[n];for(var u in B().forEach(function(e){e.boxPosition=e.options.boxPosition||{centerX:0,centerY:0}}),A)h.hooks[u]&&h.hooks[u].length&&(A[u]=A[u].concat(h.hooks[u]));F(A.processOptions,[h])}(n),Y(t),_(!0),$(),F(A.bindEvents,[v])}var z=[];function A(e,t,n){return new E("string"==typeof e?document.querySelector(e):e,t,n,z)}var O=C;function I(e,t,n,i){if(t.points.errorbars){var o=[{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}],a=t.points.errorbars;"x"!==a&&"xy"!==a||(t.points.xerr.asymmetric?(o.push({x:!0,number:!0,required:!0}),o.push({x:!0,number:!0,required:!0})):o.push({x:!0,number:!0,required:!0})),"y"!==a&&"xy"!==a||(t.points.yerr.asymmetric?(o.push({y:!0,number:!0,required:!0}),o.push({y:!0,number:!0,required:!0})):o.push({y:!0,number:!0,required:!0})),i.format=o}}function R(e,t){var n=e.datapoints.points,i=null,o=null,a=null,r=null,s=e.points.xerr,l=e.points.yerr,c=e.points.errorbars;"x"===c||"xy"===c?s.asymmetric?(i=n[t+2],o=n[t+3],"xy"===c&&(l.asymmetric?(a=n[t+4],r=n[t+5]):a=n[t+4])):(i=n[t+2],"xy"===c&&(l.asymmetric?(a=n[t+3],r=n[t+4]):a=n[t+3])):"y"===c&&(l.asymmetric?(a=n[t+2],r=n[t+3]):a=n[t+2]),null==o&&(o=i),null==r&&(r=a);var u=[i,o,a,r];return s.show||(u[0]=null,u[1]=null),l.show||(u[2]=null,u[3]=null),u}function D(e,t,n,i,o,a,r,s,l,c,u){i+=c,o+=c,a+=c,"x"===t.err?(o>n+l?W(e,[[o,i],[Math.max(n+l,u[0]),i]]):r=!1,a<n-l?W(e,[[Math.min(n-l,u[1]),i],[a,i]]):s=!1):(o<i-l?W(e,[[n,o],[n,Math.min(i-l,u[0])]]):r=!1,a>i+l?W(e,[[n,Math.max(i+l,u[1])],[n,a]]):s=!1),l=null!=t.radius?t.radius:l,r&&("-"===t.upperCap?"x"===t.err?W(e,[[o,i-l],[o,i+l]]):W(e,[[n-l,o],[n+l,o]]):"function"==typeof t.upperCap&&("x"===t.err?t.upperCap(e,o,i,l):t.upperCap(e,n,o,l))),s&&("-"===t.lowerCap?"x"===t.err?W(e,[[a,i-l],[a,i+l]]):W(e,[[n-l,a],[n+l,a]]):"function"==typeof t.lowerCap&&("x"===t.err?t.lowerCap(e,a,i,l):t.lowerCap(e,n,a,l)))}function W(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var n=1;n<t.length;n++)e.lineTo(t[n][0],t[n][1]);e.stroke()}function F(e,t){var n=e.getPlotOffset();t.save(),t.translate(n.left,n.top),e.getData().forEach(function(e){e.points.errorbars&&(e.points.xerr.show||e.points.yerr.show)&&function(e,t,n){var i,o=n.datapoints.points,a=n.datapoints.pointsize,r=[n.xaxis,n.yaxis],s=n.points.radius,l=[n.points.xerr,n.points.yerr],c=!1;r[0].p2c(r[0].max)<r[0].p2c(r[0].min)&&(c=!0,i=l[0].lowerCap,l[0].lowerCap=l[0].upperCap,l[0].upperCap=i);var u=!1;r[1].p2c(r[1].min)<r[1].p2c(r[1].max)&&(u=!0,i=l[1].lowerCap,l[1].lowerCap=l[1].upperCap,l[1].upperCap=i);for(var h=0;h<n.datapoints.points.length;h+=a)for(var p=R(n,h),f=0;f<l.length;f++){var d=[r[f].min,r[f].max];if(p[f*l.length]){var m=o[h],g=o[h+1],v=[m,g][f]+p[f*l.length+1],x=[m,g][f]-p[f*l.length];if("x"===l[f].err&&(g>r[1].max||g<r[1].min||v<r[0].min||x>r[0].max))continue;if("y"===l[f].err&&(m>r[0].max||m<r[0].min||v<r[1].min||x>r[1].max))continue;var b=!0,y=!0;v>d[1]&&(b=!1,v=d[1]),x<d[0]&&(y=!1,x=d[0]),("x"===l[f].err&&c||"y"===l[f].err&&u)&&(i=x,x=v,v=i,i=y,y=b,b=i,i=d[0],d[0]=d[1],d[1]=i),m=r[0].p2c(m),g=r[1].p2c(g),v=r[f].p2c(v),x=r[f].p2c(x),d[0]=r[f].p2c(d[0]),d[1]=r[f].p2c(d[1]);var w=l[f].lineWidth?l[f].lineWidth:n.points.lineWidth,T=null!=n.points.shadowSize?n.points.shadowSize:n.shadowSize;if(w>0&&T>0){var k=T/2;t.lineWidth=k,t.strokeStyle="rgba(0,0,0,0.1)",D(t,l[f],m,g,v,x,b,y,s,k+k/2,d),t.strokeStyle="rgba(0,0,0,0.2)",D(t,l[f],m,g,v,x,b,y,s,k/2,d)}t.strokeStyle=l[f].color?l[f].color:n.color,t.lineWidth=w,D(t,l[f],m,g,v,x,b,y,s,0,d)}}}(0,t,e)}),t.restore()}z.push({init:function(e){e.hooks.processRawData.push(I),e.hooks.draw.push(F)},options:{series:{points:{errorbars:null,xerr:{err:"x",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null},yerr:{err:"y",show:null,asymmetric:null,upperCap:null,lowerCap:null,color:null,radius:null}}}},name:"errorbars",version:"1.0"});var Y=B(Number.MAX_VALUE,10),X=B(Number.MAX_VALUE,4);function B(e,t){for(var n,i,o=Math.floor(Math.log(e)*Math.LOG10E)-1,a=[],r=-o;r<=o;r++){i=parseFloat("1e"+r);for(var s=1;s<9;s+=t)n=i*s,a.push(n)}return a}var G=function(e,t,n){var i=[],o=-1,a=-1,r=e.getCanvas(),s=Y,l=j(t,e),c=t.max;n||(n=.3*Math.sqrt("x"===t.direction?r.width:r.height)),Y.some(function(e,t){return e>=l&&(o=t,!0)}),Y.some(function(e,t){return e>=c&&(a=t,!0)}),-1===a&&(a=Y.length-1),a-o<=n/4&&s.length!==X.length&&(s=X,o*=2,a*=2);var u,h,p,f=null,d=1/n;if(a-o>=n/4){for(var m=a;m>=o;m--)u=s[m],h=(Math.log(u)-Math.log(l))/(Math.log(c)-Math.log(l)),p=u,null===f?f={pixelCoord:h,idealPixelCoord:h}:Math.abs(h-f.pixelCoord)>=d?f={pixelCoord:h,idealPixelCoord:f.idealPixelCoord-d}:p=null,p&&i.push(p);i.reverse()}else{var g=e.computeTickSize(l,c,n);i=O({min:l,max:c,tickSize:g})}return i},j=function(e,t){var n=e.min,i=e.max;return n<=0&&i<(n=null===e.datamin?e.min=.1:K(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),n},H=function(e,t,n){var i=e>0?Math.floor(Math.log(e)/Math.LN10):0;if(n)return i>=-4&&i<=7?P(e,t,n):L(e,t,n);if(i>=-4&&i<=7){var o=i<0?e.toFixed(-i):e.toFixed(i+2);if(-1!==o.indexOf(".")){for(var a=o.lastIndexOf("0");a===o.length-1;)a=(o=o.slice(0,-1)).lastIndexOf("0");o.indexOf(".")===o.length-1&&(o=o.slice(0,-1))}return o}return L(e,t)},V=function(e){return e<Y[0]&&(e=Y[0]),Math.log(e)},q=function(e){return Math.exp(e)},_=function(e){return-e},U=function(e){return-V(e)},Z=function(e){return q(-e)};function J(e,t){"log"===t.options.mode&&t.datamin<=0&&(null===t.datamin?t.datamin=.1:t.datamin=K(e,t))}function K(e,t){var n=e.getData().filter(function(e){return e.xaxis===t||e.yaxis===t}).map(function(t){return e.computeRangeForDataSeries(t,null,Q)}),i="x"===t.direction?Math.min(.1,n&&n[0]?n[0].xmin:.1):Math.min(.1,n&&n[0]?n[0].ymin:.1);return t.min=i,i}function Q(e){return e>0}z.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(n){var i=t[n],o=i.options;"log"===o.mode?(i.tickGenerator=function(t){return G(e,t,11)},"function"!=typeof i.options.tickFormatter&&(i.options.tickFormatter=H),i.options.transform=o.inverted?U:V,i.options.inverseTransform=o.inverted?Z:q,i.options.autoScaleMargin=0,e.hooks.setRange.push(J)):o.inverted&&(i.options.transform=_,i.options.inverseTransform=_)})})},options:{xaxis:{}},name:"log",version:"0.1"});var $=G,ee=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},te=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.rect(t-a,n-a,a+a,a+a)},ne=function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t,n-a),e.lineTo(t+a,n),e.lineTo(t,n+a),e.lineTo(t-a,n),e.lineTo(t,n-a)},ie=function(e,t,n,i,o){var a=i*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),r=a*Math.sin(Math.PI/3);e.moveTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2),o||(e.lineTo(t,n-r/2),e.lineTo(t-a/2,n+r/2),e.lineTo(t+a/2,n+r/2))},oe=function(e,t,n,i,o,a){o||(e.moveTo(t+i,n),e.arc(t,n,i,0,2*Math.PI,!1))},ae={square:ee,rectangle:te,diamond:ne,triangle:ie,cross:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI)/2;e.moveTo(t-a,n-a),e.lineTo(t+a,n+a),e.moveTo(t-a,n+a),e.lineTo(t+a,n-a)},ellipse:oe,plus:function(e,t,n,i,o){var a=i*Math.sqrt(Math.PI/2);e.moveTo(t-a,n),e.lineTo(t+a,n),e.moveTo(t,n+a),e.lineTo(t,n-a)}};function re(e,t,n,i){if(!0===t.flatdata){var o=t.start||0,a="number"==typeof t.step?t.step:1;i.pointsize=2;for(var r=0,s=0;r<n.length;r++,s+=2)i.points[s]=o+r*a,i.points[s+1]=n[r];void 0!==i.points?i.points.length=2*n.length:i.points=[]}}ee.fill=!0,te.fill=!0,ne.fill=!0,ie.fill=!0,oe.fill=!0,z.push({init:function(e){e.drawSymbol=ae},name:"symbols",version:"1.0"}),z.push({init:function(e){e.hooks.processRawData.push(re)},name:"flatdata",version:"0.0.2"});var se=M.SNAPPING_CONSTANT,le=M.PANHINT_LENGTH_CONSTANT;function ce(e,n){var i,o=null,a="manual"===n.pan.mode,r="smartLock"===n.pan.mode,l=r||"smart"===n.pan.mode,c="default",u=null,h=null,f={x:0,y:0},d=!1;function v(n){var i=-n.deltaY,o=Math.abs(n.deltaY)<=1?1+Math.abs(n.deltaY)/50:null;if(d&&x(n),e.getOptions().zoom.active)return n.preventDefault(),function(n,i,o){var a=t.getPageXY(n),r=e.offset();r.left=a.X-r.left,r.top=a.Y-r.top;var s=e.getPlaceholder().getBoundingClientRect(),l={left:s.left+window.scrollX,top:s.top+window.scrollY};l.left=a.X-l.left,l.top=a.Y-l.top;var c=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return l.left>t.left&&l.left<t.left+t.width&&l.top>t.top&&l.top<t.top+t.height});0===c.length&&(c=void 0),i?e.zoomOut({center:r,axes:c,amount:o}):e.zoom({center:r,axes:c,amount:o})}(n,i<0,o),!1}function x(n){if(d){h&&(window.clearTimeout(h),h=null),d=!1;var u=t.getPageXY(n);s(e.getPlaceholder(),"cursor",c),l?(e.smartPan({x:i.startPageX-u.X,y:i.startPageY-u.Y},i,o,!1,r),e.smartPan.end()):a&&(e.pan({left:f.x-u.X,top:f.y-u.Y,axes:o}),f.x=0,f.y=0)}}function b(t){if(e.activate(),e.getOptions().recenter.interactive){var n=e.getTouchedAxis(t.clientX,t.clientY);e.recenter({axes:n[0]?n:null}),n[0]?p(e.getPlaceholder(),"re-center",{axisTouched:n[0]}):p(e.getPlaceholder(),"re-center",t)}}function y(t){return e.activate(),d&&x(t),!1}function w(n){if(0===n.button){var u=n.currentTarget;!function(n){d=!0;var r=t.getPageXY(n),u=e.getPlaceholder().getBoundingClientRect(),h={left:u.left+window.scrollX,top:u.top+window.scrollY};h.left=r.X-h.left,h.top=r.Y-h.top,0===(o=e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return h.left>t.left&&h.left<t.left+t.width&&h.top>t.top&&h.top<t.top+t.height})).length&&(o=void 0);var p=s(e.getPlaceholder(),"cursor");p&&(c=p),s(e.getPlaceholder(),"cursor",e.getOptions().pan.cursor),l?i=e.navigationState(r.X,r.Y):a&&(f.x=r.X,f.y=r.Y)}(n),u.setPointerCapture(n.pointerId),u.addEventListener("pointermove",p),u.addEventListener("pointerup",m),u.addEventListener("pointercancel",m)}function p(n){!function(n){if(d){var s=t.getPageXY(n),c=e.getOptions().pan.frameRate;-1!==c?!h&&c&&(h=window.setTimeout(function(){l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:f.x-s.X,top:f.y-s.Y,axes:o}),f.x=s.X,f.y=s.Y),h=null},1/c*1e3)):l?e.smartPan({x:i.startPageX-s.X,y:i.startPageY-s.Y},i,o,!1,r):a&&(e.pan({left:f.x-s.X,top:f.y-s.Y,axes:o}),f.x=s.X,f.y=s.Y)}}(n)}function m(e){x(e),u.removeEventListener("pointermove",p),u.removeEventListener("pointerup",m),u.removeEventListener("pointercancel",m),u.releasePointerCapture(e.pointerId)}}e.navigationState=function(e,t){var n=this.getAxes(),i={};return Object.keys(n).forEach(function(e){var t=n[e];i[e]={navigationOffset:{below:t.options.offset.below||0,above:t.options.offset.above||0},axisMin:t.min,axisMax:t.max,diagMode:!1}}),i.startPageX=e||0,i.startPageY=t||0,i},e.activate=function(){var t=e.getOptions();t.pan.active&&t.zoom.active||(t.pan.active=!0,t.zoom.active=!0,p(e.getPlaceholder(),"plotactivated",[e]))},e.zoomOut=function(t){t||(t={}),t.amount||(t.amount=e.getOptions().zoom.amount),t.amount=1/t.amount,e.zoom(t)},e.zoom=function(t){t||(t={});var n=t.center,i=t.amount||e.getOptions().zoom.amount,o=e.width(),a=e.height(),r=t.axes||e.getAxes();n||(n={left:o/2,top:a/2});var s=n.left/o,l=n.top/a,c={x:{min:n.left-s*o/i,max:n.left+(1-s)*o/i},y:{min:n.top-l*a/i,max:n.top+(1-l)*a/i}};for(var u in r)if(r.hasOwnProperty(u)){var h=r[u],f=h.options,d=c[h.direction].min,m=c[h.direction].max,g=h.options.offset;if((f.axisZoom||!t.axes)&&(t.axes||f.plotZoom)){if((d=k.saturate(h.c2p(d)))>(m=k.saturate(h.c2p(m)))){var v=d;d=m,m=v}if(f.zoomRange){if(m-d<f.zoomRange[0])continue;if(m-d>f.zoomRange[1])continue}var x=k.saturate(g.below-(h.min-d)),b=k.saturate(g.above-(h.max-m));f.offset={below:x,above:b}}}e.setupGrid(!0),e.draw(),t.preventEvent||p(e.getPlaceholder(),"plotzoom",[e,t])},e.pan=function(t){var n={x:+t.left,y:+t.top};isNaN(n.x)&&(n.x=0),isNaN(n.y)&&(n.y=0);var i=t.axes||e.getAxes();Object.keys(i).forEach(function(e){var o=i[e],a=o.options,r=n[o.direction];if((a.axisPan||!t.axes)&&(a.plotPan||t.axes)){var s=o.p2c(a.panRange[0])-o.p2c(o.min),l=o.p2c(a.panRange[1])-o.p2c(o.max);if("y"===o.direction){var c=s;s=l,l=c}if(void 0!==a.panRange[0]&&r>=l&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var u=k.saturate(o.c2p(o.p2c(o.min)+r)-o.c2p(o.p2c(o.min))),h=k.saturate(o.c2p(o.p2c(o.max)+r)-o.c2p(o.p2c(o.max)));isFinite(u)||(u=0),isFinite(h)||(h=0),a.offset={below:k.saturate(u+(a.offset.below||0)),above:k.saturate(h+(a.offset.above||0))}}}}),e.setupGrid(!0),e.draw(),t.preventEvent||p(e.getPlaceholder(),"plotpan",[e,t])},e.recenter=function(t){var n=t.axes||e.getAxes();Object.keys(n).forEach(function(e){var i=n[e];t.axes?"x"===i.direction?i.options.offset={below:0}:"y"===i.direction&&(i.options.offset={above:0}):i.options.offset={below:0,above:0}}),e.setupGrid(!0),e.draw()};var T=null,M={x:0,y:0};e.smartPan=function(t,n,i,o,a){var r,s,l,c,h,f,d=!!a||function(e){return Math.abs(e.y)<se&&Math.abs(e.x)>=se||Math.abs(e.x)<se&&Math.abs(e.y)>=se}(t),m=e.getAxes();(function(e){return Math.abs(e.x)>0&&Math.abs(e.y)>0})(t=a?function(e){switch(!T&&Math.max(Math.abs(e.x),Math.abs(e.y))>=se&&(T=Math.abs(e.x)<Math.abs(e.y)?"y":"x"),T){case"x":return{x:e.x,y:0};case"y":return{x:0,y:e.y};default:return{x:0,y:0}}}(t):function(e){return Math.abs(e.x)<se&&Math.abs(e.y)>=se?{x:0,y:e.y}:Math.abs(e.y)<se&&Math.abs(e.x)>=se?{x:e.x,y:0}:e}(t))&&(n.diagMode=!0),d&&!0===n.diagMode&&(n.diagMode=!1,function(e,t,n){var i;Object.keys(e).forEach(function(o){i=e[o],0===n[i.direction]&&(i.options.offset.below=t[o].navigationOffset.below,i.options.offset.above=t[o].navigationOffset.above)})}(m,n,t)),u=d?{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:{x:n.startPageX-t.x-e.offset().left+e.getPlotOffset().left,y:n.startPageY-t.y-e.offset().top+e.getPlotOffset().top}}:{start:{x:n.startPageX-e.offset().left+e.getPlotOffset().left,y:n.startPageY-e.offset().top+e.getPlotOffset().top},end:!1},isNaN(t.x)&&(t.x=0),isNaN(t.y)&&(t.y=0),i&&(m=i),Object.keys(m).forEach(function(e){if(s=m[e],l=s.min,c=s.max,r=s.options,f=t[s.direction],h=M[s.direction],(r.axisPan||!i)&&(i||r.plotPan)){var n=h+s.p2c(r.panRange[0])-s.p2c(l),o=h+s.p2c(r.panRange[1])-s.p2c(c);if("y"===s.direction){var a=n;n=o,o=a}if(void 0!==r.panRange[0]&&f>=o&&(f=o),void 0!==r.panRange[1]&&f<=n&&(f=n),0!==f){var u=k.saturate(s.c2p(s.p2c(l)-(h-f))-s.c2p(s.p2c(l))),p=k.saturate(s.c2p(s.p2c(c)-(h-f))-s.c2p(s.p2c(c)));isFinite(u)||(u=0),isFinite(p)||(p=0),s.options.offset.below=k.saturate(u+(s.options.offset.below||0)),s.options.offset.above=k.saturate(p+(s.options.offset.above||0))}}}),M=t,e.setupGrid(!0),e.draw(),o||p(e.getPlaceholder(),"plotpan",[e,t,i,n])},e.smartPan.end=function(){u=null,T=null,M={x:0,y:0},e.triggerRedrawOverlay()},e.getTouchedAxis=function(t,n){var i=e.getPlaceholder().getBoundingClientRect(),o={left:i.left+window.scrollX,top:i.top+window.scrollY};return o.left=t-o.left,o.top=n-o.top,e.getXAxes().concat(e.getYAxes()).filter(function(e){var t=e.box;if(void 0!==t)return o.left>t.left&&o.left<t.left+t.width&&o.top>t.top&&o.top<t.top+t.height})},e.hooks.drawOverlay.push(function(e,t){if(u){t.strokeStyle="rgba(96, 160, 208, 0.7)",t.lineWidth=2,t.lineJoin="round";var n=Math.round(u.start.x),i=Math.round(u.start.y),a=0,r=0;if(o?"x"===o[0].direction?(r=Math.round(u.start.y),a=Math.round(u.end.x)):"y"===o[0].direction&&(a=Math.round(u.start.x),r=Math.round(u.end.y)):(a=Math.round(u.end.x),r=Math.round(u.end.y)),t.beginPath(),!1===u.end)t.moveTo(n,i-le),t.lineTo(n,i+le),t.moveTo(n+le,i),t.lineTo(n-le,i);else{var s=i===r;t.moveTo(n-(s?0:le),i-(s?le:0)),t.lineTo(n+(s?0:le),i+(s?le:0)),t.moveTo(n,i),t.lineTo(a,r),t.moveTo(a-(s?0:le),r-(s?le:0)),t.lineTo(a+(s?0:le),r+(s?le:0))}t.stroke()}}),e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();n.zoom.interactive&&m(t,"wheel",v),n.pan.interactive&&m(t,"pointerdown",w),m(t,"dblclick",b),m(t,"click",y)}),e.hooks.shutdown.push(function(e,t){g(t,"wheel",v),g(t,"pointerdown",w),g(t,"dblclick",b),g(t,"click",y),h&&window.clearTimeout(h)})}function ue(e,t,n,i){var o="categories"===t.xaxis.options.mode,a="categories"===t.yaxis.options.mode;if(o||a){var r=i.format;if(!r){var s=t;if((r=[]).push({x:!0,number:!0,required:!0,computeRange:!0}),r.push({y:!0,number:!0,required:!0,computeRange:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);r.push({y:!0,number:!0,required:!1,defaultValue:0,computeRange:l}),s.bars.horizontal&&(delete r[r.length-1].y,r[r.length-1].x=!0)}i.format=r}for(var c=0;c<r.length;++c)r[c].x&&o&&(r[c].number=!1),r[c].y&&a&&(r[c].number=!1,r[c].computeRange=!1)}}function he(e){var t=[];for(var n in e.categories){var i=e.categories[n];i>=e.min&&i<=e.max&&t.push([i,n])}return t.sort(function(e,t){return e[0]-t[0]}),t}function pe(e,t,n){if("categories"===e[t].options.mode){if(!e[t].categories){var i={},o=e[t].options.categories||{};if(Array.isArray(o))for(var a=0;a<o.length;++a)i[o[a]]=a;else for(var r in o)i[r]=o[r];e[t].categories=i}e[t].options.ticks||(e[t].options.ticks=he),function(e,t,n){for(var i=e.points,o=e.pointsize,a=e.format,r=t.charAt(0),s=function(e){var t=-1;for(var n in e)e[n]>t&&(t=e[n]);return t+1}(n),l=0;l<i.length;l+=o)if(null!=i[l])for(var c=0;c<o;++c){var u=i[l+c];null!=u&&a[c][r]&&(u in n||(n[u]=s,++s),i[l+c]=n[u])}}(n,t,e[t].categories)}}function fe(e,t,n){pe(t,"xaxis",n),pe(t,"yaxis",n)}z.push({init:function(e){e.hooks.processOptions.push(ce)},options:{zoom:{interactive:!1,active:!1,amount:1.5},pan:{interactive:!1,active:!1,cursor:"move",frameRate:60,mode:"smart"},recenter:{interactive:!0},xaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]},yaxis:{axisZoom:!0,plotZoom:!0,axisPan:!0,plotPan:!0,panRange:[void 0,void 0],zoomRange:[void 0,void 0]}},name:"navigate",version:"1.3"}),z.push({init:function(e){e.hooks.processRawData.push(function(e,t,n,i){if(null!=t.fillBetween){var o=i.format;o||((o=[]).push({x:!0,number:!0,computeRange:"none"!==t.xaxis.options.autoScale,required:!0}),o.push({y:!0,number:!0,computeRange:"none"!==t.yaxis.options.autoScale,required:!0}),void 0!==t.fillBetween&&""!==t.fillBetween&&function(t){for(var n=e.getData(),i=0;i<n.length;i++)if(n[i].id===t)return!0;return!1}(t.fillBetween)&&t.fillBetween!==t.id&&o.push({x:!1,y:!0,number:!0,required:!1,computeRange:"none"!==t.yaxis.options.autoScale,defaultValue:0}),i.format=o)}}),e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.fillBetween){var i=function(e,t){var n;for(n=0;n<t.length;++n)if(t[n].id===e.fillBetween)return t[n];return"number"==typeof e.fillBetween?e.fillBetween<0||e.fillBetween>=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(i){for(var o,a,r,s,l,c,u,h,p=n.pointsize,f=n.points,d=i.datapoints.pointsize,m=i.datapoints.points,g=[],v=t.lines.show,x=p>2&&n.format[2].y,b=v&&t.lines.steps,y=!0,w=0,T=0;!(w>=f.length);){if(u=g.length,null==f[w]){for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(T>=m.length){if(!v)for(h=0;h<p;++h)g.push(f[w+h]);w+=p}else if(null==m[T]){for(h=0;h<p;++h)g.push(null);y=!0,T+=d}else{if(o=f[w],a=f[w+1],s=m[T],l=m[T+1],c=0,o===s){for(h=0;h<p;++h)g.push(f[w+h]);c=l,w+=p,T+=d}else if(o>s){if(v&&w>0&&null!=f[w-p]){for(r=a+(f[w-p+1]-a)*(s-o)/(f[w-p]-o),g.push(s),g.push(r),h=2;h<p;++h)g.push(f[w+h]);c=l}T+=d}else{if(y&&v){w+=p;continue}for(h=0;h<p;++h)g.push(f[w+h]);v&&T>0&&null!=m[T-d]&&(c=l+(m[T-d+1]-l)*(o-s)/(m[T-d]-s)),w+=p}y=!1,u!==g.length&&x&&(g[u+2]=c)}if(b&&u!==g.length&&u>0&&null!==g[u]&&g[u]!==g[u-p]&&g[u+1]!==g[u-p+1]){for(h=0;h<p;++h)g[u+p+h]=g[u+h];g[u+1]=g[u-p+1]}}n.points=g}}})},options:{series:{fillBetween:null}},name:"fillbetween",version:"1.0"}),z.push({init:function(e){e.hooks.processRawData.push(ue),e.hooks.processDatapoints.push(fe)},options:{xaxis:{categories:null},yaxis:{categories:null}},name:"categories",version:"1.0"}),z.push({init:function(e){e.hooks.processDatapoints.push(function(e,t,n){if(null!=t.stack&&!1!==t.stack){var i=t.bars.show||t.lines.show&&t.lines.fill,o=n.pointsize>2&&(t.bars.horizontal?n.format[2].x:n.format[2].y);i&&!o&&function(e,t){for(var n=[],i=0;i<t.points.length;i+=2)n.push(t.points[i]),n.push(t.points[i+1]),n.push(0);t.format.push({x:e.bars.horizontal,y:!e.bars.horizontal,number:!0,required:!1,computeRange:"none"!==e.yaxis.options.autoScale,defaultValue:0}),t.points=n,t.pointsize=3}(t,n);var a=function(e,t){for(var n=null,i=0;i<t.length&&e!==t[i];++i)t[i].stack===e.stack&&(n=t[i]);return n}(t,e.getData());if(a){for(var r,s,l,c,u,h,p,f,d=n.pointsize,m=n.points,g=a.datapoints.pointsize,v=a.datapoints.points,x=[],b=t.lines.show,y=t.bars.horizontal,w=b&&t.lines.steps,T=!0,k=y?1:0,M=y?0:1,S=0,C=0;!(S>=m.length);){if(p=x.length,null==m[S]){for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(C>=v.length){if(!b)for(f=0;f<d;++f)x.push(m[S+f]);S+=d}else if(null==v[C]){for(f=0;f<d;++f)x.push(null);T=!0,C+=g}else{if(r=m[S+k],s=m[S+M],c=v[C+k],u=v[C+M],h=0,r===c){for(f=0;f<d;++f)x.push(m[S+f]);x[p+M]+=u,h=u,S+=d,C+=g}else if(r>c){if(b&&S>0&&null!=m[S-d]){for(l=s+(m[S-d+M]-s)*(c-r)/(m[S-d+k]-r),x.push(c),x.push(l+u),f=2;f<d;++f)x.push(m[S+f]);h=u}C+=g}else{if(T&&b){S+=d;continue}for(f=0;f<d;++f)x.push(m[S+f]);b&&C>0&&null!=v[C-g]&&(h=u+(v[C-g+M]-u)*(r-c)/(v[C-g+k]-c)),x[p+M]+=h,S+=d}T=!1,p!==x.length&&i&&(x[p+2]+=h)}if(w&&p!==x.length&&p>0&&null!==x[p]&&x[p]!==x[p-d]&&x[p+1]!==x[p-d+1]){for(f=0;f<d;++f)x[p+d+f]=x[p+f];x[p+1]=x[p-d+1]}}n.points=x}}})},options:{series:{stack:null}},name:"stack",version:"1.2"});var de=M.ZOOM_DISTANCE_MARGIN;function me(e,t){var n,i,o,a,r={zoomEnable:!1,prevDistance:null,prevPanPosition:{x:0,y:0},prevTapPosition:{x:0,y:0}},s={prevTouchedAxis:"none",currentTouchedAxis:"none",touchedAxis:null,navigationConstraint:"unconstrained",initialState:null},l=t.pan.interactive&&"manual"===t.pan.touchMode,c="smartLock"===t.pan.touchMode,u=t.pan.interactive&&(c||"smart"===t.pan.touchMode);function h(t,n,i){s.touchedAxis=function(e,t,n,i){if("pinchstart"!==t.type)return"panstart"===t.type||"pinchend"===t.type?e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY):i.touchedAxis;var o=e.getTouchedAxis(t.detail.touches[0].pageX,t.detail.touches[0].pageY),a=e.getTouchedAxis(t.detail.touches[1].pageX,t.detail.touches[1].pageY);return o.length===a.length&&o.toString()===a.toString()?o:void 0}(e,t,0,s),ge(s)?s.navigationConstraint="unconstrained":s.navigationConstraint="axisConstrained"}n={start:function(t){if(h(t),ve(t,"pan",r,s),u){var n=we(t,"pan");s.initialState=e.navigationState(n.x,n.y)}},drag:function(t){if(h(t),u&&s.initialState){var n=we(t,"pan");e.smartPan({x:s.initialState.startPageX-n.x,y:s.initialState.startPageY-n.y},s.initialState,s.touchedAxis,!1,c)}else l&&(e.pan({left:-ye(t,"pan",r).x,top:-ye(t,"pan",r).y,axes:s.touchedAxis}),be(t,"pan",r,s))},end:function(t){h(t),u&&e.smartPan.end(),function(e,t){return t.zoomEnable&&1===e.detail.touches.length}(t,r)&&be(t,"pan",r,s)}},i={start:function(e){a&&(clearTimeout(a),a=null),h(e),function(e,t){t.prevDistance=xe(e)}(e,r),ve(e,"pinch",r,s)},drag:function(t){a||(a=setTimeout(function(){h(t),e.pan({left:-ye(t,"pinch",r).x,top:-ye(t,"pinch",r).y,axes:s.touchedAxis}),be(t,"pinch",r,s);var n=xe(t);(r.zoomEnable||null!=r.prevDistance&&Math.abs(n-r.prevDistance)>de)&&(function(e,t,n,i){var o=e.offset(),a={left:0,top:0},r=xe(t)/n.prevDistance,s=xe(t);a.left=we(t,"pinch").x-o.left,a.top=we(t,"pinch").y-o.top,e.zoom({center:a,amount:r,axes:i.touchedAxis}),n.prevDistance=s}(e,t,r,s),r.zoomEnable=!0),a=null},1e3/60))},end:function(e){a&&(clearTimeout(a),a=null),h(e),r.prevDistance=null}},o={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(e,t,n,i){(function(e,t,n){var i=e.getTouchedAxis(t.detail.firstTouch.x,t.detail.firstTouch.y);void 0!==i[0]&&(n.prevTouchedAxis=i[0].direction),void 0!==(i=e.getTouchedAxis(t.detail.secondTouch.x,t.detail.secondTouch.y))[0]&&(n.touchedAxis=i,n.currentTouchedAxis=i[0].direction),ge(n)&&(n.touchedAxis=null,n.prevTouchedAxis="none",n.currentTouchedAxis="none")})(e,t,i),("x"===i.currentTouchedAxis&&"x"===i.prevTouchedAxis||"y"===i.currentTouchedAxis&&"y"===i.prevTouchedAxis||"none"===i.currentTouchedAxis&&"none"===i.prevTouchedAxis)&&(e.recenter({axes:i.touchedAxis}),i.touchedAxis?p(e.getPlaceholder(),"re-center",{axisTouched:i.touchedAxis}):p(e.getPlaceholder(),"re-center",t))}(e,t,0,s)}},!0!==t.pan.enableTouch&&!0!==t.zoom.enableTouch||(e.hooks.bindEvents.push(function(e,t){var a=e.getOptions();a.zoom.interactive&&a.zoom.enableTouch&&(t.addEventListener("pinchstart",i.start,!1),t.addEventListener("pinchdrag",i.drag,!1),t.addEventListener("pinchend",i.end,!1)),a.pan.interactive&&a.pan.enableTouch&&(t.addEventListener("panstart",n.start,!1),t.addEventListener("pandrag",n.drag,!1),t.addEventListener("panend",n.end,!1)),a.recenter.interactive&&a.recenter.enableTouch&&t.addEventListener("doubletap",o.recenterPlot,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("panstart",n.start),t.removeEventListener("pandrag",n.drag),t.removeEventListener("panend",n.end),t.removeEventListener("pinchstart",i.start),t.removeEventListener("pinchdrag",i.drag),t.removeEventListener("pinchend",i.end),t.removeEventListener("doubletap",o.recenterPlot)}))}function ge(e){return!e.touchedAxis||0===e.touchedAxis.length}function ve(e,t,n,i){var o,a=we(e,t);switch(i.navigationConstraint){case"unconstrained":i.touchedAxis=null,n.prevTapPosition={x:n.prevPanPosition.x,y:n.prevPanPosition.y},n.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":o=i.touchedAxis[0].direction,i.currentTouchedAxis=o,n.prevTapPosition[o]=n.prevPanPosition[o],n.prevPanPosition[o]=a[o]}}function xe(e){var t,n,i,o,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,n=a.pageY,i=r.pageX,o=r.pageY,Math.sqrt((t-i)*(t-i)+(n-o)*(n-o))}function be(e,t,n,i){var o=we(e,t);switch(i.navigationConstraint){case"unconstrained":n.prevPanPosition.x=o.x,n.prevPanPosition.y=o.y;break;case"axisConstrained":n.prevPanPosition[i.currentTouchedAxis]=o[i.currentTouchedAxis]}}function ye(e,t,n){var i=we(e,t);return{x:i.x-n.prevPanPosition.x,y:i.y-n.prevPanPosition.y}}function we(e,t){return"pinch"===t?{x:(e.detail.touches[0].pageX+e.detail.touches[1].pageX)/2,y:(e.detail.touches[0].pageY+e.detail.touches[1].pageY)/2}:{x:e.detail.touches[0].pageX,y:e.detail.touches[0].pageY}}z.push({init:function(e){e.hooks.processOptions.push(me)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"});var Te="hover";function ke(e,t){var n,i={twoTouches:!1,currentTapStart:{x:0,y:0},currentTapEnd:{x:0,y:0},prevTap:{x:0,y:0},currentTap:{x:0,y:0},interceptedLongTap:!1,isUnsupportedGesture:!1,prevTapTime:null,tapStartTime:null,longTapTriggerId:null};function o(t){var o=e.getOptions();(o.pan.active||o.zoom.active)&&(function(e){e.touches.length>=3?i.isUnsupportedGesture=!0:i.isUnsupportedGesture=!1}(t),n.dispatchEvent(new CustomEvent("touchevent",{detail:t})),m(t)?a(t,"pinch"):(a(t,"pan"),d(t)||(function(e){var t=(new Date).getTime(),n=null!=i.prevTapTime?t-i.prevTapTime:1/0;return n>=0&&n<500&&f(i.prevTap.x,i.prevTap.y,i.currentTap.x,i.currentTap.y)<20?(e.firstTouch=i.prevTap,e.secondTouch=i.currentTap,!0):(i.prevTapTime=t,!1)}(t)&&a(t,"doubleTap"),a(t,"tap"),a(t,"longTap"))))}function a(e,t){switch(t){case"pan":r[e.type](e);break;case"pinch":s[e.type](e);break;case"doubleTap":l.onDoubleTap(e);break;case"longTap":c[e.type](e);break;case"tap":u[e.type](e)}}var r={touchstart:function(e){i.prevTap={x:i.currentTap.x,y:i.currentTap.y},h(e),function(e){i.tapStartTime=(new Date).getTime(),i.interceptedLongTap=!1,i.currentTapStart={x:e.touches[0].pageX,y:e.touches[0].pageY},i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){p(e),h(e),function(e){i.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){p(e),d(e)?(n.dispatchEvent(new CustomEvent("pinchend",{detail:e})),n.dispatchEvent(new CustomEvent("panstart",{detail:e}))):function(e){return e.touches&&0===e.touches.length}(e)&&n.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){n.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){p(e),i.twoTouches=m(e),i.isUnsupportedGesture||n.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){p(e)}},l={onDoubleTap:function(e){p(e),n.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)},isLongTap:function(e){return null!=i.tapStartTime&&(new Date).getTime()-i.tapStartTime>=1500&&!i.interceptedLongTap&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20&&(i.interceptedLongTap=!0,!0)},waitForLongTap:function(e){i.longTapTriggerId||(i.longTapTriggerId=setTimeout(function(){c.isLongTap(e)&&n.dispatchEvent(new CustomEvent("longtap",{detail:e})),i.longTapTriggerId=null},1500))}},u={touchstart:function(e){i.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(n.dispatchEvent(new CustomEvent("tap",{detail:e})),p(e))},isTap:function(e){return null!=i.tapStartTime&&(new Date).getTime()-i.tapStartTime<=125&&f(i.currentTapStart.x,i.currentTapStart.y,i.currentTapEnd.x,i.currentTapEnd.y)<20}};function h(e){i.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function p(t){i.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function f(e,t,n,i){return Math.sqrt((e-n)*(e-n)+(t-i)*(t-i))}function d(e){return i.twoTouches&&1===e.touches.length}function m(t){return!!(t.touches&&t.touches.length>=2&&t.touches[0].target===e.getEventHolder()&&t.touches[1].target===e.getEventHolder())}(!0===t.pan.enableTouch||t.zoom.enableTouch)&&(e.hooks.bindEvents.push(function(e,t){n=t,t.addEventListener("touchstart",o,!1),t.addEventListener("touchmove",o,!1),t.addEventListener("touchend",o,!1)}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("touchstart",o),t.removeEventListener("touchmove",o),t.removeEventListener("touchend",o),i.longTapTriggerId&&(clearTimeout(i.longTapTriggerId),i.longTapTriggerId=null)}))}z.push({init:function(e){var n,i=[];function o(t){var n=e.getOptions(),i=new CustomEvent("mouseevent");return i.pageX=t.detail.changedTouches[0].pageX,i.pageY=t.detail.changedTouches[0].pageY,i.clientX=t.detail.changedTouches[0].clientX,i.clientY=t.detail.changedTouches[0].clientY,n.grid.hoverable&&a(i,Te,30),!1}function a(t,n,i){var o=e.getData();if(void 0!==t&&o.length>0&&void 0!==o[0].xaxis.c2p&&void 0!==o[0].yaxis.c2p){var a=n+"able";u("plot"+n,t,function(e){return!1!==o[e][a]},i)}}function r(t){n=t,e.getPlaceholder().lastMouseMoveEvent=t,a(t,Te)}function s(t){n=void 0,e.getPlaceholder().lastMouseMoveEvent=void 0,u("plothover",t,function(e){return!1})}function l(e){a(e,"click")}function c(){e.unhighlight(),p(e.getPlaceholder(),"plothovercleanup")}function u(n,o,a,r){var s=e.getOptions(),l=e.offset(),c=t.getPageXY(o),u=c.X-l.left,d=c.Y-l.top,m=e.c2p({left:u,top:d}),g=void 0!==r?r:s.grid.mouseActiveRadius;m.pageX=c.X,m.pageY=c.Y;var v=e.findNearbyItems(u,d,a,g),x=v[0];for(let e=1;e<v.length;++e)(void 0===x.distance||v[e].distance<x.distance)&&(x=v[e]);if(x?(x.pageX=parseInt(x.series.xaxis.p2c(x.datapoint[0])+l.left,10),x.pageY=parseInt(x.series.yaxis.p2c(x.datapoint[1])+l.top,10)):x=null,s.grid.autoHighlight){for(let e=0;e<i.length;++e){var b=i[e];(b.auto!==n||x&&b.series===x.series&&b.point[0]===x.datapoint[0]&&b.point[1]===x.datapoint[1])&&x||f(b.series,b.point)}x&&h(x.series,x.datapoint,n)}p(e.getPlaceholder(),n,[m,x,v])}function h(t,n,o){if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var a=t.datapoints.pointsize;n=t.datapoints.points.slice(a*n,a*(n+1))}var r=d(t,n);-1===r?(i.push({series:t,point:n,auto:o}),e.triggerRedrawOverlay()):o||(i[r].auto=!1)}function f(t,n){if(null==t&&null==n)return i=[],void e.triggerRedrawOverlay();if("number"==typeof t&&(t=e.getData()[t]),"number"==typeof n){var o=t.datapoints.pointsize;n=t.datapoints.points.slice(o*n,o*(n+1))}var a=d(t,n);-1!==a&&(i.splice(a,1),e.triggerRedrawOverlay())}function d(e,t){for(var n=0;n<i.length;++n){var o=i[n];if(o.series===e&&o.point[0]===t[0]&&o.point[1]===t[1])return n}return-1}function v(){c(),a(n,Te)}function x(){a(n,Te)}function b(e,t,n){var o,a,r=e.getPlotOffset();for(t.save(),t.translate(r.left,r.top),o=0;o<i.length;++o)(a=i[o]).series.bars.show?T(a.series,a.point,t):y(a.series,a.point,t,e);t.restore()}function y(e,t,n,i){var o=t[0],a=t[1],r=e.xaxis,s=e.yaxis,l="string"==typeof e.highlightColor?e.highlightColor:w.parse(e.color).scale("a",.5).toString();if(!(o<r.min||o>r.max||a<s.min||a>s.max)){var c=e.points.radius+e.points.lineWidth/2;n.lineWidth=c,n.strokeStyle=l;var u=1.5*c;o=r.p2c(o),a=s.p2c(a),n.beginPath();var h=e.points.symbol;"circle"===h?n.arc(o,a,u,0,2*Math.PI,!1):"string"==typeof h&&i.drawSymbol&&i.drawSymbol[h]&&i.drawSymbol[h](n,o,a,u,!1),n.closePath(),n.stroke()}}function T(e,t,n){var i,o="string"==typeof e.highlightColor?e.highlightColor:w.parse(e.color).scale("a",.5).toString(),a=o,r=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":i=0;break;case"right":i=-r;break;default:i=-r/2}n.lineWidth=e.bars.lineWidth,n.strokeStyle=o;var s=e.bars.fillTowards||0,l=s>e.yaxis.min?Math.min(e.yaxis.max,s):e.yaxis.min;S.drawBar(t[0],t[1],t[2]||l,i,i+r,function(){return a},e.xaxis,e.yaxis,n,e.bars.horizontal,e.bars.lineWidth)}e.hooks.bindEvents.push(function(e,t){var n=e.getOptions();(n.grid.hoverable||n.grid.clickable)&&(t.addEventListener("touchevent",c,!1),t.addEventListener("tap",o,!1)),n.grid.clickable&&m(t,"click",l),n.grid.hoverable&&(m(t,"mousemove",r),m(t,"mouseleave",s))}),e.hooks.shutdown.push(function(e,t){t.removeEventListener("tap",o),t.removeEventListener("touchevent",c),g(t,"mousemove",r),g(t,"mouseleave",s),g(t,"click",l),i=[]}),e.hooks.processOptions.push(function(e,t){e.highlight=h,e.unhighlight=f,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(b),e.hooks.processDatapoints.push(v),e.hooks.setupGrid.push(x)),n=e.getPlaceholder().lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"}),z.push({init:function(e){e.hooks.processOptions.push(ke)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"});var Me=k.floorInBase,Se=function(e,t){var n=new e(t),i=n.setTime.bind(n);n.update=function(e){e=Math.round(1e3*e)/1e3,i(e),this.microseconds=1e3*(e-Math.floor(e))};var o=n.getTime.bind(n);return n.getTime=function(){return o()+this.microseconds/1e3},n.setTime=function(e){this.update(e)},n.getMicroseconds=function(){return this.microseconds},n.setMicroseconds=function(e){var t=o()+e/1e3;this.update(t)},n.setUTCMicroseconds=function(e){this.setMicroseconds(e)},n.getUTCMicroseconds=function(){return this.getMicroseconds()},n.microseconds=null,n.microEpoch=null,n.update(t),n};function Ce(e,t,n,i){if("function"==typeof e.strftime)return e.strftime(t);var o,a=function(e,t){return t=""+(null==t?"0":t),1===(e=""+e).length?t+e:e},r=function(e,t,n){var i,o=1e3*e+t;if(n<6&&n>0){var a=parseFloat("1e"+(n-6));i=("00000"+(o=Math.round(Math.round(o*a)/a))).slice(-6,-(6-n))}else i=("00000"+(o=Math.round(o))).slice(-6);return i},s=[],l=!1,c=e.getHours(),u=c<12;n||(n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),i||(i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),o=c>12?c-12:0===c?12:c;for(var h=-1,p=0;p<t.length;++p){var f=t.charAt(p);if(!isNaN(Number(f))&&Number(f)>0)h=Number(f);else if(l){switch(f){case"a":f=""+i[e.getDay()];break;case"b":f=""+n[e.getMonth()];break;case"d":f=a(e.getDate());break;case"e":f=a(e.getDate()," ");break;case"h":case"H":f=a(c);break;case"I":f=a(o);break;case"l":f=a(o," ");break;case"m":f=a(e.getMonth()+1);break;case"M":f=a(e.getMinutes());break;case"q":f=""+(Math.floor(e.getMonth()/3)+1);break;case"S":f=a(e.getSeconds());break;case"s":f=""+r(e.getMilliseconds(),e.getMicroseconds(),h);break;case"y":f=a(e.getFullYear()%100);break;case"Y":f=""+e.getFullYear();break;case"p":f=u?"am":"pm";break;case"P":f=u?"AM":"PM";break;case"w":f=""+e.getDay()}s.push(f),l=!1}else"%"===f?l=!0:s.push(f)}return s.join("")}function Pe(e){function t(e,t,n,i){e[t]=function(){return n[i].apply(n,arguments)}}var n={date:e};void 0!==e.strftime&&t(n,"strftime",e,"strftime"),t(n,"getTime",e,"getTime"),t(n,"setTime",e,"setTime");for(var i=["Date","Day","FullYear","Hours","Minutes","Month","Seconds","Milliseconds","Microseconds"],o=0;o<i.length;o++)t(n,"get"+i[o],e,"getUTC"+i[o]),t(n,"set"+i[o],e,"setUTC"+i[o]);return n}function Le(e,t){var n=864e13;if(t&&"seconds"===t.timeBase?e*=1e3:"microseconds"===t.timeBase&&(e/=1e3),e>n?e=n:e<-n&&(e=-n),"browser"===t.timezone)return Se(Date,e);if(t.timezone&&"utc"!==t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=Se(timezoneJS.Date,e);return i.setTimezone(t.timezone),i.setTime(e),i}return Pe(Se(Date,e))}return Pe(Se(Date,e))}var Ne={microsecond:1e-6,millisecond:.001,second:1,minute:60,hour:3600,day:86400,month:2592e3,quarter:7776e3,year:525949.2*60},Ee={microsecond:.001,millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},ze={microsecond:1,millisecond:1e3,second:1e6,minute:6e7,hour:36e8,day:864e8,month:2592e9,quarter:7776e9,year:31556951999999.996},Ae=[[1,"microsecond"],[2,"microsecond"],[5,"microsecond"],[10,"microsecond"],[25,"microsecond"],[50,"microsecond"],[100,"microsecond"],[250,"microsecond"],[500,"microsecond"],[1,"millisecond"],[2,"millisecond"],[5,"millisecond"],[10,"millisecond"],[25,"millisecond"],[50,"millisecond"],[100,"millisecond"],[250,"millisecond"],[500,"millisecond"],[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],Oe=Ae.concat([[3,"month"],[6,"month"],[1,"year"]]),Ie=Ae.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function Re(e){var t,n=e.options,i=[],o=Le(e.min,n),a=0,r=n.tickSize&&"quarter"===n.tickSize[1]||n.minTickSize&&"quarter"===n.minTickSize[1]?Ie:Oe;t="seconds"===n.timeBase?Ne:"microseconds"===n.timeBase?ze:Ee,null!==n.minTickSize&&void 0!==n.minTickSize&&(a="number"==typeof n.tickSize?n.tickSize:n.minTickSize[0]*t[n.minTickSize[1]]);for(var s=0;s<r.length-1&&!(e.delta<(Number(r[s][0])*t[r[s][1]]+Number(r[s+1][0])*t[r[s+1][1]])/2&&Number(r[s][0])*t[r[s][1]]>=a);++s);var l=r[s][0],c=r[s][1];if("year"===c){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])l=Math.floor(n.minTickSize[0]);else{var u=parseFloat("1e"+Math.floor(Math.log(e.delta/t.year)/Math.LN10)),h=e.delta/t.year/u;l=h<1.5?1:h<3?2:h<7.5?5:10,l*=u}l<1&&(l=1)}e.tickSize=n.tickSize||[l,c];var p=e.tickSize[0],f=p*t[c=e.tickSize[1]];"microsecond"===c?o.setMicroseconds(Me(o.getMicroseconds(),p)):"millisecond"===c?o.setMilliseconds(Me(o.getMilliseconds(),p)):"second"===c?o.setSeconds(Me(o.getSeconds(),p)):"minute"===c?o.setMinutes(Me(o.getMinutes(),p)):"hour"===c?o.setHours(Me(o.getHours(),p)):"month"===c?o.setMonth(Me(o.getMonth(),p)):"quarter"===c?o.setMonth(3*Me(o.getMonth()/3,p)):"year"===c&&o.setFullYear(Me(o.getFullYear(),p)),f>=t.millisecond&&o.setMicroseconds(0),f>=t.second&&o.setMilliseconds(0),f>=t.minute&&o.setSeconds(0),f>=t.hour&&o.setMinutes(0),f>=t.day&&o.setHours(0),f>=4*t.day&&o.setDate(1),f>=2*t.month&&o.setMonth(Me(o.getMonth(),3)),f>=2*t.quarter&&o.setMonth(Me(o.getMonth(),6)),f>=t.year&&o.setMonth(0);var d,m,g=0,v=Number.NaN;do{if(m=v,d=o.getTime(),v=n&&"seconds"===n.timeBase?d/1e3:n&&"microseconds"===n.timeBase?1e3*d:d,i.push(v),"month"===c||"quarter"===c)if(p<1){o.setDate(1);var x=o.getTime();o.setMonth(o.getMonth()+("quarter"===c?3:1));var b=o.getTime();o.setTime(v+g*t.hour+(b-x)*p),g=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+p*("quarter"===c?3:1));else"year"===c?o.setFullYear(o.getFullYear()+p):"seconds"===n.timeBase?o.setTime(1e3*(v+f)):"microseconds"===n.timeBase?o.setTime((v+f)/1e3):o.setTime(v+f)}while(v<e.max&&v!==m);return i}function De(e,t,n,i,o,a){this.axisName=e,this.position=t,this.padding=n,this.placeholder=i,this.axisLabel=o,this.surface=a,this.width=0,this.height=0,this.elem=null}z.push({init:function(e){e.hooks.processOptions.push(function(e){var t=e.getAxes();Object.keys(t).forEach(function(e){var n=t[e],i=n.options;if("time"===i.mode){if(n.tickGenerator=Re,"tickFormatter"in i&&"function"==typeof i.tickFormatter)return;n.tickFormatter=function(e,t){var n=Le(e,t.options);if(null!=i.timeformat)return Ce(n,i.timeformat,i.monthNames,i.dayNames);var o,a=t.options.tickSize&&"quarter"===t.options.tickSize[1]||t.options.minTickSize&&"quarter"===t.options.minTickSize[1];o="seconds"===i.timeBase?Ne:"microseconds"===i.timeBase?ze:Ee;var r,s,l=t.tickSize[0]*o[t.tickSize[1]],c=t.max-t.min,u=i.twelveHourClock?" %p":"",h=i.twelveHourClock?"%I":"%H";if(r="seconds"===i.timeBase?1:"microseconds"===i.timeBase?1e6:1e3,l<o.second){var p=-Math.floor(Math.log10(l/r));String(l).indexOf("25")>-1&&p++,s="%S.%"+p+"s"}else s=l<o.minute?h+":%M:%S"+u:l<o.day?c<2*o.day?h+":%M"+u:"%b %d "+h+":%M"+u:l<o.month?"%b %d":a&&l<o.quarter||!a&&l<o.year?c<o.year?"%b":"%b %Y":a&&l<o.year?c<o.year?"Q%q":"Q%q %Y":"%Y";return Ce(n,s,i.monthNames,i.dayNames)}}})})},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null,timeBase:"seconds"},yaxis:{timeBase:"seconds"}},name:"time",version:"1.0"}),De.prototype.calculateSize=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels",i=this.surface.getTextInfo(t,this.axisLabel,n);this.labelWidth=i.width,this.labelHeight=i.height,"left"===this.position||"right"===this.position?(this.width=this.labelHeight+this.padding,this.height=0):(this.width=0,this.height=this.labelHeight+this.padding)},De.prototype.transforms=function(e,t,n,i){var o,a,r=[];if(0===t&&0===n||((o=i.createSVGTransform()).setTranslate(t,n),r.push(o)),0!==e){a=i.createSVGTransform();var s=Math.round(this.labelWidth/2);a.setRotate(e,s,0),r.push(a)}return r},De.prototype.calculateOffsets=function(e){var t={x:0,y:0,degrees:0};return"bottom"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top+e.height-this.labelHeight):"top"===this.position?(t.x=e.left+e.width/2-this.labelWidth/2,t.y=e.top):"left"===this.position?(t.degrees=-90,t.x=e.left-this.labelWidth/2,t.y=e.height/2+e.top):"right"===this.position&&(t.degrees=90,t.x=e.left+e.width-this.labelWidth/2,t.y=e.height/2+e.top),t.x=Math.round(t.x),t.y=Math.round(t.y),t},De.prototype.cleanup=function(){var e=this.axisName+"Label",t=e+"Layer",n=e+" axisLabels";this.surface.removeText(t,0,0,this.axisLabel,n)},De.prototype.draw=function(e){var t=this.axisName+"Label",n=t+"Layer",i=t+" axisLabels",o=this.calculateOffsets(e),a={position:"absolute",bottom:"",right:"",display:"inline-block","white-space":"nowrap"},r=this.surface.getSVGLayer(n),s=this.transforms(o.degrees,o.x,o.y,r.parentNode);this.surface.addText(n,0,0,this.axisLabel,i,void 0,void 0,void 0,void 0,s),this.surface.render(),Object.keys(a).forEach(function(e){r.style[e]=a[e]})},z.push({init:function(e){e.hooks.processOptions.push(function(e,t){if(t.axisLabels.show){var n={};e.hooks.axisReserveSpace.push(function(e,t){var i=t.options,o=t.direction+t.n;if(t.labelHeight+=t.boxPosition.centerY,t.labelWidth+=t.boxPosition.centerX,i&&i.axisLabel&&t.show){var a=void 0===i.axisLabelPadding?2:i.axisLabelPadding,r=n[o];r||(r=new De(o,i.position,a,e.getPlaceholder(),i.axisLabel,e.getSurface()),n[o]=r),r.calculateSize(),t.labelHeight+=r.height,t.labelWidth+=r.width}}),e.hooks.draw.push(function(e,t){var i=e.getAxes();Object.keys(i).forEach(function(e){var t=i[e],o=t.options;if(o&&o.axisLabel&&t.show){var a=t.direction+t.n;n[a].draw(t.box)}})}),e.hooks.shutdown.push(function(e,t){for(var i in n)n[i].cleanup()})}})},options:{axisLabels:{show:!0}},name:"axisLabels",version:"3.0"}),z.push({init:function(e){var t={first:{x:-1,y:-1},second:{x:-1,y:-1},show:!1,currentMode:"xy",active:!1},n=M.SNAPPING_CONSTANT,i={};function o(){if(!f())return null;if(!t.show)return null;var n={},i={x:t.first.x,y:t.first.y},o={x:t.second.x,y:t.second.y};"x"===s(e)&&(i.y=0,o.y=e.height()),"y"===s(e)&&(i.x=0,o.x=e.width());var a=e.getAxes();return Object.keys(a).forEach(function(e){var t=a[e];if(t.used){var r=t.c2p(i[t.direction]),s=t.c2p(o[t.direction]);n[e]={from:Math.min(r,s),to:Math.max(r,s)}}}),n}function a(){var t=o();p(e.getPlaceholder(),"plotselected",[t]),t.xaxis&&t.yaxis&&p(e.getPlaceholder(),"selected",[{x1:t.xaxis.from,y1:t.yaxis.from,x2:t.xaxis.to,y2:t.yaxis.to}])}function r(e,t,n){return t<e?e:t>n?n:t}function s(e){var n=e.getOptions();return"smart"===n.selection.mode?t.currentMode:n.selection.mode}function l(i,o){var a=e.getPlaceholder().getBoundingClientRect(),l=a.left+window.scrollX,c=a.top+window.scrollY,u=e.getPlotOffset();i.x=r(0,o.pageX-l-u.left,e.width()),i.y=r(0,o.pageY-c-u.top,e.height()),i!==t.first&&function(e){if(t.first){var i={x:e.x-t.first.x,y:e.y-t.first.y};Math.abs(i.x)<n?t.currentMode="y":Math.abs(i.y)<n?t.currentMode="x":t.currentMode="xy"}}(i),"y"===s(e)&&(i.x=i===t.first?0:e.width()),"x"===s(e)&&(i.y=i===t.first?0:e.height())}function c(n){null!=n.pageX&&(l(t.second,n),f()?(t.show=!0,e.triggerRedrawOverlay()):u(!0))}function u(n){t.show&&(t.show=!1,t.currentMode="",e.triggerRedrawOverlay(),n||p(e.getPlaceholder(),"plotunselected",[]))}function h(t,n){var i,o,a,r,s=e.getAxes();for(var l in s)if((i=s[l]).direction===n&&(t[r=n+i.n+"axis"]||1!==i.n||(r=n+"axis"),t[r])){o=t[r].from,a=t[r].to;break}if(r&&!t[r]&&(i="x"===n?e.getXAxes()[0]:e.getYAxes()[0],o=t[n+"1"],a=t[n+"2"]),null!=o&&null!=a&&o>a){var c=o;o=a,a=c}return{from:o,to:a,axis:i}}function f(){var n=e.getOptions().selection.minSize;return Math.abs(t.second.x-t.first.x)>=n&&Math.abs(t.second.y-t.first.y)>=n}function d(n){if(0===n.button){var r=n.currentTarget;!function(n){var o=e.getOptions();0===n.button&&null!==o.selection.mode&&(t.currentMode="xy",document.body.focus(),void 0!==document.onselectstart&&null==i.onselectstart&&(i.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!==document.ondrag&&null==i.ondrag&&(i.ondrag=document.ondrag,document.ondrag=function(){return!1}),l(t.first,n),t.active=!0)}(n),r.setPointerCapture(n.pointerId),r.addEventListener("pointermove",s),r.addEventListener("pointerup",u),r.addEventListener("pointercancel",u)}function s(n){!function(n){t.active&&(c(n),p(e.getPlaceholder(),"plotselecting",[o()]))}(n)}function u(n){!function(n){void 0!==document.onselectstart&&(document.onselectstart=i.onselectstart),void 0!==document.ondrag&&(document.ondrag=i.ondrag),t.active=!1,c(n),f()?a():(p(e.getPlaceholder(),"plotunselected",[]),p(e.getPlaceholder(),"plotselecting",[null]))}(n),r.removeEventListener("pointermove",s),r.removeEventListener("pointerup",u),r.removeEventListener("pointercancel",u),r.releasePointerCapture(n.pointerId)}}e.clearSelection=u,e.setSelection=function(n,i){var o;"y"===s(e)?(t.first.x=0,t.second.x=e.width()):(o=h(n,"x"),t.first.x=o.axis.p2c(o.from),t.second.x=o.axis.p2c(o.to)),"x"===s(e)?(t.first.y=0,t.second.y=e.height()):(o=h(n,"y"),t.first.y=o.axis.p2c(o.from),t.second.y=o.axis.p2c(o.to)),t.show=!0,e.triggerRedrawOverlay(),!i&&f()&&a()},e.getSelection=o,e.hooks.bindEvents.push(function(e,t){null!=e.getOptions().selection.mode&&e.addEventHandler("pointerdown",d,t,0)}),e.hooks.drawOverlay.push(function(e,n){if(t.show&&f()){var i=e.getPlotOffset(),o=e.getOptions();n.save(),n.translate(i.left,i.top);var a=w.parse(o.selection.color),r=o.selection.visualization,l=o.selection.displaySelectionDecorations,c=1;"fill"===r&&(c=.8),n.strokeStyle=a.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=o.selection.shape,n.fillStyle=a.scale("a",.4).toString();var u=Math.min(t.first.x,t.second.x)+.5,h=u,p=Math.min(t.first.y,t.second.y)+.5,d=p,m=Math.abs(t.second.x-t.first.x)-1,g=Math.abs(t.second.y-t.first.y)-1;"x"===s(e)&&(g+=p,p=0),"y"===s(e)&&(m+=u,u=0),"fill"===r?(n.fillRect(u,p,m,g),n.strokeRect(u,p,m,g)):(n.fillRect(0,0,e.width(),e.height()),n.clearRect(u,p,m,g),l&&function(e,t,n,i,o,a,r,s){var l=15,c=Math.max(0,Math.min(l,i/2-2,o/2-2));e.fillStyle="#ffffff","xy"===s&&(e.beginPath(),e.moveTo(t,n+c),e.lineTo(t-3,n+c),e.lineTo(t-3,n-3),e.lineTo(t+c,n-3),e.lineTo(t+c,n),e.lineTo(t,n),e.closePath(),e.moveTo(t,n+o-c),e.lineTo(t-3,n+o-c),e.lineTo(t-3,n+o+3),e.lineTo(t+c,n+o+3),e.lineTo(t+c,n+o),e.lineTo(t,n+o),e.closePath(),e.moveTo(t+i,n+c),e.lineTo(t+i+3,n+c),e.lineTo(t+i+3,n-3),e.lineTo(t+i-c,n-3),e.lineTo(t+i-c,n),e.lineTo(t+i,n),e.closePath(),e.moveTo(t+i,n+o-c),e.lineTo(t+i+3,n+o-c),e.lineTo(t+i+3,n+o+3),e.lineTo(t+i-c,n+o+3),e.lineTo(t+i-c,n+o),e.lineTo(t+i,n+o),e.closePath(),e.stroke(),e.fill()),t=a,n=r,"x"===s&&(e.beginPath(),e.moveTo(t,n+l),e.lineTo(t,n-l),e.lineTo(t-3,n-l),e.lineTo(t-3,n+l),e.closePath(),e.moveTo(t+i,n+l),e.lineTo(t+i,n-l),e.lineTo(t+i+3,n-l),e.lineTo(t+i+3,n+l),e.closePath(),e.stroke(),e.fill()),"y"===s&&(e.beginPath(),e.moveTo(t-l,n),e.lineTo(t+l,n),e.lineTo(t+l,n-3),e.lineTo(t-l,n-3),e.closePath(),e.moveTo(t-l,n+o),e.lineTo(t+l,n+o),e.lineTo(t+l,n+o+3),e.lineTo(t-l,n+o+3),e.closePath(),e.stroke(),e.fill())}(n,u,p,m,g,h,d,s(e))),n.restore()}}),e.hooks.shutdown.push(function(e,t){g(t,"pointerdown",d)})},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"});var We=1,Fe=t.getPixelRatio;function Ye(e,n){var i=e.filter(Xe);We=Fe(n.getContext("2d"));var o=i.map(function(e){var n=new Image,i=new Promise(function(e,n){return e.sourceDescription='<info className="'+n.className+'" tagName="'+n.tagName+'" id="'+n.id+'">',e.sourceComponent=n,function(i,o){var a,r,s,l,c;e.onload=function(t){e.successfullyLoaded=!0,i(e)},e.onabort=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},e.onerror=function(t){e.successfullyLoaded=!1,console.log("Can't generate temp image from "+e.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",e.sourceComponent),i(e)},r=e,"CANVAS"===(a=n).tagName&&(s=a,r.src=s.toDataURL("image/png")),"svg"===a.tagName&&(l=a,c=r,t.isSafari()||t.isMobileSafari()?function(e,t){var n,i,o=Ge(Be(document),e);o=je(o),i=function(e){var t="";const n=new Uint8Array(e);for(var i=0;i<n.length;i+=16384)t+=String.fromCharCode.apply(null,n.subarray(i,i+16384));return t}((new(TextEncoder||TextEncoderLite)).encode(o)),n="data:image/svg+xml;base64,"+btoa(i),t.src=n}(l,c):function(e,t){var n=Ge(Be(document),e);n=je(n);var i=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),o=(self.URL||self.webkitURL||self).createObjectURL(i);t.src=o}(l,c)),r.srcImgTagName=a.tagName,function(e,t){t.genLeft=e.getBoundingClientRect().left,t.genTop=e.getBoundingClientRect().top,"CANVAS"===e.tagName&&(t.genRight=t.genLeft+e.width,t.genBottom=t.genTop+e.height),"svg"===e.tagName&&(t.genRight=e.getBoundingClientRect().right,t.genBottom=e.getBoundingClientRect().bottom)}(a,r)}}(n,e));return i}),a=Promise.all(o).then(function(e){return function(t){var n=function(e,t){var n=function(e,t){var n=0;if(0===e.length)n=-1;else{var i=e[0].genLeft,o=e[0].genTop,a=e[0].genRight,r=e[0].genBottom,s=0;for(s=1;s<e.length;s++)i>e[s].genLeft&&(i=e[s].genLeft),o>e[s].genTop&&(o=e[s].genTop);for(s=1;s<e.length;s++)a<e[s].genRight&&(a=e[s].genRight),r<e[s].genBottom&&(r=e[s].genBottom);if(a-i<=0||r-o<=0)n=-2;else{for(t.width=Math.round(a-i),t.height=Math.round(r-o),s=0;s<e.length;s++)e[s].xCompOffset=e[s].genLeft-i,e[s].yCompOffset=e[s].genTop-o;!function(e,t){void 0!==t.find(function(e){return"svg"===e.srcImgTagName})&&We<1&&(e.width=e.width*We,e.height=e.height*We)}(t,e)}}return n}(e,t);if(0===n)for(var i=t.getContext("2d"),o=0;o<e.length;o++)!0===e[o].successfullyLoaded&&i.drawImage(e[o],e[o].xCompOffset*We,e[o].yCompOffset*We);return n}(t,e);return n}}(n),He);return a}function Xe(e){var t=!0,n=!0;return null==e?n=!1:"CANVAS"===e.tagName&&(e.getBoundingClientRect().right!==e.getBoundingClientRect().left&&e.getBoundingClientRect().bottom!==e.getBoundingClientRect().top||(t=!1)),n&&t&&"visible"===window.getComputedStyle(e).visibility}function Be(e){for(var t=e.styleSheets,n=[],i=0;i<t.length;i++)try{for(var o=t[i].cssRules||[],a=0;a<o.length;a++){var r=o[a];n.push(r.cssText)}}catch(e){console.log("Failed to get some css rules")}return n}function Ge(e,t){return['<svg class="snapshot '+t.classList+'" width="'+t.width.baseVal.value*We+'" height="'+t.height.baseVal.value*We+'" viewBox="0 0 '+t.width.baseVal.value+" "+t.height.baseVal.value+'" xmlns="http://www.w3.org/2000/svg">',"<style>","/* <![CDATA[ */",e.join("\n"),"/* ]]> */","</style>",t.innerHTML,"</svg>"].join("\n")}function je(e){var t="";return e.match(/^<svg[^>]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^<svg/,'<svg xmlns="http://www.w3.org/2000/svg"')),e.match(/^<svg[^>]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^<svg/,'<svg xmlns:xlink="http://www.w3.org/1999/xlink"')),'<?xml version="1.0" standalone="no"?>\r\n'+t}function He(){return-100}function Ve(e){var t="",n=e.name,i=e.xPos,o=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(n){case"circle":default:t='<use xlink:href="#circle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"diamond":t='<use xlink:href="#diamond" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"cross":t='<use xlink:href="#cross" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"rectangle":t='<use xlink:href="#rectangle" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"plus":t='<use xlink:href="#plus" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"bar":t='<use xlink:href="#bars" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"area":t='<use xlink:href="#area" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>';break;case"line":t='<use xlink:href="#line" class="legendIcon" x="'+i+'" y="'+o+'" stroke="'+r+'" stroke-width="'+s+'" width="1.5em" height="1.5em"/>';break;case"box":t='<use xlink:href="#box" class="legendIcon" x="'+i+'" y="'+o+'" fill="'+a+'" width="1.5em" height="1.5em"/>'}return t}z.push({init:function(e){e.composeImages=Ye},name:"composeImages",version:"1.0"});function qe(e,t){for(var n in e)if(e.hasOwnProperty(n)&&e[n]!==t[n])return!0;return!1}z.push({init:function(e){e.hooks.setupGrid.push(function(e){var t=e.getOptions(),n=e.getData(),i=t.legend.labelFormatter,o=t.legend.legendEntries,a=t.legend.plotOffset,r=function(e,t,n){var i=t,o=e.reduce(function(e,t,n){var o=i?i(t.label,t):t.label;if(!t.hasOwnProperty("label")||o){var a={label:o||"Plot "+(n+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e},[]);if(n)if("function"==typeof n)o.sort(n);else if("reverse"===n)o.reverse();else{var a="descending"!==n;o.sort(function(e,t){return e.label===t.label?0:e.label<t.label!==a?1:-1})}return o}(n,i,t.legend.sorted),s=e.getPlotOffset();(function(e,t){if(!e||!t)return!0;if(e.length!==t.length)return!0;var n,i,o;for(n=0;n<t.length;n++){if(i=t[n],o=e[n],i.label!==o.label)return!0;if(i.color!==o.color)return!0;if(qe(i.options.lines,o.options.lines))return!0;if(qe(i.options.points,o.options.points))return!0;if(qe(i.options.bars,o.options.bars))return!0}return!1}(o,r)||qe(a,s))&&function(e,t,n,i){if(null!=t.legend.container)t.legend.container.innerHTML="";else for(var o=n.querySelectorAll(".legend"),a=0;a<o.length;a++)o[a].remove();if(t.legend.show){var r,s,l,c,u=t.legend.legendEntries=i,h=t.legend.plotOffset=e.getPlotOffset(),p=[],f=0,d="",m=t.legend.position,g=t.legend.margin,v={name:"",label:"",xPos:"",yPos:""};p[f++]='<svg class="legendLayer" style="width:inherit;height:inherit;">',p[f++]='<rect class="background" width="100%" height="100%"/>',p[f++]='<defs><symbol id="line" fill="none" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0"/></symbol><symbol id="box" stroke-width="1" viewBox="-5 -5 25 25"><rect x="0" y="0" width="15" height="15"/></symbol><symbol id="area" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="0,15 5,5 10,10 15,0, 15,15, 0,15"/></symbol><symbol id="bars" stroke-width="1" viewBox="-5 -5 25 25"><polyline points="1.5,15.5 1.5,12.5, 4.5,12.5 4.5,15.5 6.5,15.5 6.5,3.5, 9.5,3.5 9.5,15.5 11.5,15.5 11.5,7.5 14.5,7.5 14.5,15.5 1.5,15.5"/></symbol><symbol id="circle" viewBox="-5 -5 25 25"><circle cx="0" cy="15" r="2.5"/><circle cx="5" cy="5" r="2.5"/><circle cx="10" cy="10" r="2.5"/><circle cx="15" cy="0" r="2.5"/></symbol><symbol id="rectangle" viewBox="-5 -5 25 25"><rect x="-2.1" y="12.9" width="4.2" height="4.2"/><rect x="2.9" y="2.9" width="4.2" height="4.2"/><rect x="7.9" y="7.9" width="4.2" height="4.2"/><rect x="12.9" y="-2.1" width="4.2" height="4.2"/></symbol><symbol id="diamond" viewBox="-5 -5 25 25"><path d="M-3,15 L0,12 L3,15, L0,18 Z"/><path d="M2,5 L5,2 L8,5, L5,8 Z"/><path d="M7,10 L10,7 L13,10, L10,13 Z"/><path d="M12,0 L15,-3 L18,0, L15,3 Z"/></symbol><symbol id="cross" fill="none" viewBox="-5 -5 25 25"><path d="M-2.1,12.9 L2.1,17.1, M2.1,12.9 L-2.1,17.1 Z"/><path d="M2.9,2.9 L7.1,7.1 M7.1,2.9 L2.9,7.1 Z"/><path d="M7.9,7.9 L12.1,12.1 M12.1,7.9 L7.9,12.1 Z"/><path d="M12.9,-2.1 L17.1,2.1 M17.1,-2.1 L12.9,2.1 Z"/></symbol><symbol id="plus" fill="none" viewBox="-5 -5 25 25"><path d="M0,12 L0,18, M-3,15 L3,15 Z"/><path d="M5,2 L5,8 M2,5 L8,5 Z"/><path d="M10,7 L10,13 M7,10 L13,10 Z"/><path d="M15,-3 L15,3 M12,0 L18,0 Z"/></symbol></defs>';var x=0,b=[],y=window.getComputedStyle(document.body);for(c=0;c<u.length;++c){let n=c%t.legend.noColumns;r=u[c],v.label=r.label;var w=e.getSurface().getTextInfo("",v.label,{style:y.fontStyle,variant:y.fontVariant,weight:y.fontWeight,size:parseInt(y.fontSize),lineHeight:parseInt(y.lineHeight),family:y.fontFamily}).width;b[n]?w>b[n]&&(b[n]=w+48):b[n]=w+48}for(c=0;c<u.length;++c){let e=c%t.legend.noColumns;r=u[c],l="",v.label=r.label,v.xPos=x+3+"px",x+=b[e],(c+1)%t.legend.noColumns===0&&(x=0),v.yPos=1.5*Math.floor(c/t.legend.noColumns)+"em",r.options.lines.show&&r.options.lines.fill&&(v.name="area",v.fillColor=r.color,l+=Ve(v)),r.options.bars.show&&(v.name="bar",v.fillColor=r.color,l+=Ve(v)),r.options.lines.show&&!r.options.lines.fill&&(v.name="line",v.strokeColor=r.color,v.strokeWidth=r.options.lines.lineWidth,l+=Ve(v)),r.options.points.show&&(v.name=r.options.points.symbol,v.strokeColor=r.color,v.fillColor=r.options.points.fillColor,v.strokeWidth=r.options.points.lineWidth,l+=Ve(v)),""===l&&(v.name="box",v.fillColor=r.color,l+=Ve(v)),s='<text x="'+v.xPos+'" y="'+v.yPos+'" text-anchor="start"><tspan dx="2em" dy="1.2em">'+v.label+"</tspan></text>",p[f++]="<g>"+l+s+"</g>"}p[f++]="</svg>",null==g[0]&&(g=[g,g]),"n"===m.charAt(0)?d+="top:"+(g[1]+h.top)+"px;":"s"===m.charAt(0)&&(d+="bottom:"+(g[1]+h.bottom)+"px;"),"e"===m.charAt(1)?d+="right:"+(g[0]+h.right)+"px;":"w"===m.charAt(1)&&(d+="left:"+(g[0]+h.left)+"px;");var T=6;for(c=0;c<b.length;++c)T+=b[c];var k,M=1.6*Math.ceil(u.length/t.legend.noColumns);if(t.legend.container){var S=t.legend.container;S&&"function"==typeof S.get&&S[0]&&(S=S[0]),S.innerHTML=p.join(""),S.style.width=T+"px",S.style.height=M+"em"}else(k=document.createElement("div")).className="legend",k.style.cssText="position:absolute;"+d,k.innerHTML=p.join(""),k.style.width=T+"px",k.style.height=M+"em",k.style.pointerEvents="none",n.appendChild(k)}}(e,t,e.getPlaceholder(),r)})},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"}),f(function(t,n,i){if(void 0===i||Array.isArray(i))e(t).trigger(n,i||[]);else{var o=e.Event(n,{detail:i});e(t).trigger(o)}}),e.plot=function(t,n,i){return A("string"==typeof t?document.querySelector(t):t instanceof e?t[0]:t,n,i)},e.plot.plugins=z,e.plot.version="5.1.3",e.plot.saturated=k,e.plot.browser=t,e.plot.uiConstants=M,e.plot.drawSeries=S,e.plot.linearTickGenerator=O,e.plot.defaultTickFormatter=P,e.plot.expRepTickFormatter=L,e.plot.logTicksGenerator=$,e.plot.logTickFormatter=H,e.plot.formatDate=Ce,e.plot.makeUtcWrapper=Pe,e.plot.dateGenerator=Le,e.plot.dateTickGenerator=Re,e.plot.composeImages=Ye;var _e=w.extract;e.color=Object.create(w),e.color.extract=function(t,n){return t instanceof e&&t.length&&(t=t[0]),_e(t,n)},e.fn.plot=function(e,t){return this.each(function(){A(this,e,t)})},"undefined"!=typeof window&&(window.Flot||(window.Flot={}),window.Flot.Canvas=x,window.Flot.plugins=z,window.Flot.helpers=v)}(jQuery);
|
|
2
2
|
//# sourceMappingURL=jquery.flot.min.js.map
|