"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(r){var t=function(t,e){var n=e.getElementsByClassName(t)[0];if(!n&&((n=document.createElement("canvas")).className=t,n.style.direction="ltr",n.style.position="absolute",n.style.left="0px",n.style.top="0px",e.appendChild(n),!n.getContext))throw new Error("Canvas is not available.");this.element=n;var i=this.context=n.getContext("2d");this.pixelRatio=r.plot.browser.getPixelRatio(i);var o=r(e).width(),a=r(e).height();this.resize(o,a),this.SVGContainer=null,this.SVG={},this._textCache={}};function f(e,t){e.transform.baseVal.clear(),t&&t.forEach(function(t){e.transform.baseVal.appendItem(t)})}t.prototype.resize=function(t,e){t=t<10?10:t,e=e<10?10:e;var n=this.element,i=this.context,o=this.pixelRatio;this.width!==t&&(n.width=t*o,n.style.width=t+"px",this.width=t),this.height!==e&&(n.height=e*o,n.style.height=e+"px",this.height=e),i.restore(),i.save(),i.scale(o,o)},t.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},t.prototype.render=function(){var t=this._textCache;for(var e in t)if(hasOwnProperty.call(t,e)){var n=this.getSVGLayer(e),i=t[e],o=n.style.display;for(var a in n.style.display="none",i)if(hasOwnProperty.call(i,a)){var r=i[a];for(var s in r)if(hasOwnProperty.call(r,s)){for(var l,c=r[s],u=c.positions,p=0;u[p];p++)if((l=u[p]).active)l.rendered||(n.appendChild(l.element),l.rendered=!0);else if(u.splice(p--,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}},t.prototype.getSVGLayer=function(t){var e,n=this.SVG[t];n||(this.SVGContainer?e=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),(e=document.createElementNS("http://www.w3.org/2000/svg","svg")).style.width="100%",e.style.height="100%",this.SVGContainer.appendChild(e)),(n=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",t),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.bottom="0px",n.style.right="0px",e.appendChild(n),this.SVG[t]=n);return n},t.prototype.getTextInfo=function(t,e,n,i,o){var a,r,s,l;e=""+e,a="object"===_typeof(n)?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(r=this._textCache[t])&&(r=this._textCache[t]={}),null==(s=r[a])&&(s=r[a]={});var c=e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0");if(!(l=s[c])){var u=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==e.indexOf("
"))m(e,u,-9999);else{var p=document.createTextNode(e);u.appendChild(p)}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(t).appendChild(u);var h=u.getBBox();for(l=s[c]={width:h.width,height:h.height,measured:!0,element:u,positions:[]};u.firstChild;)u.removeChild(u.firstChild);u.parentNode.removeChild(u)}return l.measured=!0,l},t.prototype.addText=function(t,e,n,i,o,a,r,s,l,c){var u=this.getTextInfo(t,i,o,a,r),p=u.positions;"center"===s?e-=u.width/2:"right"===s&&(e-=u.width),"middle"===l?n-=u.height/2:"bottom"===l&&(n-=u.height),n+=.75*u.height;for(var h,d=0;p[d];d++){if((h=p[d]).x===e&&h.y===n&&h.text===i)return h.active=!0,void f(h.element,c);if(!1===h.active)return h.active=!0,-1!==(h.text=i).indexOf("
")?(n-=.25*u.height,m(i,h.element,e)):h.element.textContent=i,h.element.setAttributeNS(null,"x",e),h.element.setAttributeNS(null,"y",n),h.x=e,h.y=n,void f(h.element,c)}h={active:!0,rendered:!1,element:p.length?u.element.cloneNode():u.element,text:i,x:e,y:n},p.push(h),-1!==i.indexOf("
")?(n-=.25*u.height,m(i,h.element,e)):h.element.textContent=i,h.element.setAttributeNS(null,"x",e),h.element.setAttributeNS(null,"y",n),h.element.style.textAlign=s,f(h.element,c)};var m=function(t,e,n){var i,o,a,r=t.split("
");for(o=0;ol.xmax&&(l.xmax=p)),!0===h.y&&(pl.ymax&&(l.ymax=p))))}return l},M.adjustSeriesDataRange=function(t,e){if(t.bars.show){var n,i=t.bars.barWidth[1];t.datapoints&&t.datapoints.points&&!i&&function(t){var e=[],n=t.datapoints.pointsize,i=Number.MAX_VALUE;t.datapoints.points.length<=n&&(i=1);for(var o=t.bars.horizontal?1:0;ot.datamax&&n!==1/0&&(t.datamax=n)}function g(t,e){return t&&t[e]&&t[e].datapoints&&t[e].datapoints.points?t[e].datapoints.points:[]}for(K.each(L(),function(t,e){!0!==e.options.growOnly?(e.datamin=d,e.datamax=f):(void 0===e.datamin&&(e.datamin=d),void 0===e.datamax&&(e.datamax=f)),e.used=!1}),e=0;ei.max?d:(l=x.getTextInfo(p,t.label,h),"x"===i.direction?(r="center",o=b.left+i.p2c(t.v),"bottom"===i.position?a=u.top+u.padding-i.boxPosition.centerY:(a=u.top+u.height-u.padding+i.boxPosition.centerY,s="bottom")):(s="middle",a=b.top+i.p2c(t.v),"left"===i.position?(o=u.left+u.width-u.padding-i.boxPosition.centerX,r="right"):o=u.left+u.padding+i.boxPosition.centerX),c={x:o-l.width/2-3,y:a-3,width:l.width+6,height:l.height+6},n=c,e.some(function(t){return m(n.x,n.y,n.x+n.width,n.y+n.height,t.x,t.y,t.x+t.width,t.y+t.height)})?d:(x.addText(p,o,a,t.label,h,null,null,r,s),c));var n};if(x.removeText(p),C(k.drawAxis,[i,x]),i.show)switch(i.options.showTickLabels){case"none":break;case"endpoints":f.push(g(i.ticks[0],f)),f.push(g(i.ticks[i.ticks.length-1],f));break;case"major":for(f.push(g(i.ticks[0],f)),f.push(g(i.ticks[i.ticks.length-1],f)),e=1;e=t.min&&c<=t.max&&("x"===t.direction?(a=t.p2c(c),p=e,"top"===t.position&&(p=-p)):(r=t.p2c(c),u=e,"left"===t.position&&(u=-u)),"x"===t.direction?a=X(g.lineWidth,a):r=X(g.lineWidth,r),g.moveTo(a,r),g.lineTo(a+u,r+p)),!0===n&&st.max||(n=o,void 0,i=f.grid.borderWidth,(!("object"===_typeof(i)&&0o.axis.max||a.toa.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||f.grid.markingsLineWidth,c=l%2?.5:0;g.beginPath(),g.strokeStyle=i.color||f.grid.markingsColor,g.lineWidth=l,r?(g.moveTo(o.to+c,a.from),g.lineTo(o.to+c,a.to)):(g.moveTo(o.from,a.to+c),g.lineTo(o.to,a.to+c)),g.stroke()}else g.fillStyle=i.color||f.grid.markingsColor,g.fillRect(o.from,a.to,o.to-o.from,a.from-a.to)}}}(),t=L(),e=f.grid.borderWidth;for(var o=0;ot.yaxis.min?Math.min(t.yaxis.max,u):t.yaxis.min,h=-1,d=0;d=Math.min(g,f)&&m+i<=s&&s<=m+o:f+i<=r&&r<=f+o&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(h=d/c)}}return h}function Q(){var t=f.interaction.redrawOverlayInterval;-1!==t?s||(s=setTimeout(function(){Z(M)},t)):Z()}function Z(t){if(s=null,a){n.clear(),C(k.drawOverlay,[a,n]);var e=new CustomEvent("onDrawingDone");t.getEventHolder().dispatchEvent(e),t.getPlaceholder().trigger("drawingdone")}}function J(t,e,n,i){if("string"==typeof t)return t;for(var o=g.createLinearGradient(0,n,0,e),a=0,r=t.colors.length;ar.max||vs.max||(mr.max&&(g=r.max,h=!1),xs.max&&(v=s.max,d=!1),m=r.p2c(m),x=s.p2c(x),g=r.p2c(g),v=s.p2c(v),a&&(l.fillStyle=a(x,v),l.fillRect(m,v,g-m,x-v)),0n.min?Math.min(n.max,i):n.min,c=0,u=1,p=!1,h=0,d=0,f=null,m=null;!(0r.length+s);){var g=r[(c+=s)-s],x=r[c-s+u],v=r[c],b=r[c+u];if(-2===s&&(x=b=l),p){if(0e.max){if(v>e.max)continue;x=(e.max-g)/(v-g)*(b-x)+x,g=e.max}else if(g<=v&&v>e.max){if(g>e.max)continue;b=(e.max-g)/(v-g)*(b-x)+x,v=e.max}if(p||(o.beginPath(),o.moveTo(e.p2c(g),n.p2c(l)),p=!0),x>=n.max&&b>=n.max)o.lineTo(e.p2c(g),n.p2c(n.max)),o.lineTo(e.p2c(v),n.p2c(n.max));else if(x<=n.min&&b<=n.min)o.lineTo(e.p2c(g),n.p2c(n.min)),o.lineTo(e.p2c(v),n.p2c(n.min));else{var y=g,w=v;x<=b&&x=n.min?(g=(n.min-x)/(b-x)*(v-g)+g,x=n.min):b<=x&&b=n.min&&(v=(n.min-x)/(b-x)*(v-g)+g,b=n.min),b<=x&&x>n.max&&b<=n.max?(g=(n.max-x)/(b-x)*(v-g)+g,x=n.max):x<=b&&b>n.max&&x<=n.max&&(v=(n.max-x)/(b-x)*(v-g)+g,b=n.max),g!==y&&o.lineTo(e.p2c(y),n.p2c(x)),o.lineTo(e.p2c(g),n.p2c(x)),o.lineTo(e.p2c(v),n.p2c(b)),v!==w&&(o.lineTo(e.p2c(v),n.p2c(b)),o.lineTo(e.p2c(w),n.p2c(b)))}}else m=f=null}}(s,t.xaxis,t.yaxis,t.lines.fillTowards||0,e,t.lines.steps)),0o.max){if(f>o.max)continue;p=(o.max-h)/(f-h)*(d-p)+p,h=o.max}else if(h<=f&&f>o.max){if(h>o.max)continue;d=(o.max-h)/(f-h)*(d-p)+p,f=o.max}if(p<=d&&pi.max){if(d>i.max)continue;h=(i.max-p)/(d-p)*(f-h)+h,p=i.max}else if(p<=d&&d>i.max){if(p>i.max)continue;f=(i.max-p)/(d-p)*(f-h)+h,d=i.max}p===c&&h===u||a.moveTo(i.p2c(p)+e,o.p2c(h)+n),c=d,u=f,a.lineTo(i.p2c(d)+e,o.p2c(f)+n)}else g=m=null;a.stroke()}(s,0,0,t.xaxis,t.yaxis,e,t.lines.steps),e.restore()},this.drawSeriesPoints=function(t,d,e,n,i,o,a){function r(t,e,n,i,o,a){t.moveTo(e+i,n),t.arc(e,n,i,0,o?Math.PI:2*Math.PI,!1)}r.fill=!0,d.save(),d.translate(e.left,e.top);var s={format:t.datapoints.format,points:t.datapoints.points,pointsize:t.datapoints.pointsize};t.decimatePoints&&(s.points=t.decimatePoints(t,t.xaxis.min,t.xaxis.max,n,t.yaxis.min,t.yaxis.max,i));var l,c=t.points.lineWidth,u=t.points.radius,p=t.points.symbol;"circle"===p?l=r:"string"==typeof p&&o&&o[p]?l=o[p]:"function"==typeof o&&(l=o),0===c&&(c=1e-4),d.lineWidth=c,d.fillStyle=m(t.points,t.color,null,null,a),d.strokeStyle=t.color,function(t,e,n,i,o,a,r,s){var l=t.points,c=t.pointsize;d.beginPath();for(var u=0;ua.max||hr.max||(p=a.p2c(p),h=r.p2c(h)+i,s(d,p,h,e,o,n))}s.fill&&!o&&d.fill(),d.stroke()}(s,u,!0,0,!1,t.xaxis,t.yaxis,l),d.restore()},this.drawSeriesBars=function(h,d,t,e,n,i,o){d.save(),d.translate(t.left,t.top);var a,r={format:h.datapoints.format,points:h.datapoints.points,pointsize:h.datapoints.pointsize};h.decimate&&(r.points=h.decimate(h,h.xaxis.min,h.xaxis.max,e)),d.lineWidth=h.bars.lineWidth,d.strokeStyle=h.color;var s=h.bars.barWidth[0]||h.bars.barWidth;switch(h.bars.align){case"left":a=0;break;case"right":a=-s;break;default:a=-s/2}!function(t,e,n,i,o,a){for(var r=t.points,s=t.pointsize,l=h.bars.fillTowards||0,c=l>a.min?Math.min(a.max,l):a.min,u=0;ur[1].max||gr[0].max))continue;if("y"===l[d].err&&(m>r[0].max||mr[1].max))continue;var b=!0,y=!0;x>f[1]&&(b=!1,x=f[1]),v=f?d={pixelCoord:p,idealPixelCoord:d.idealPixelCoord-f}:h=null,h&&i.push(h);i.reverse()}else{var g=t.computeTickSize(l,c,n),x={min:l,max:c,tickSize:g};i=v.plot.linearTickGenerator(x)}return i},w=function(t,e){var n=t.min,i=t.max;return n<=0&&i<(n=null===t.datamin?t.min=.1:h(e,t))&&(t.max=null!==t.datamax?t.datamax:t.options.max,t.options.offset.below=0,t.options.offset.above=0),n},a=function(t,e,n){var i=0e.left&&a.lefte.top&&a.tope.left&&n.lefte.top&&n.topp.zoomRange[1])continue}var g=S.plot.saturated.saturate(f.below-(u.min-h)),x=S.plot.saturated.saturate(f.above-(u.max-d));p.offset={below:g,above:x}}}y.setupGrid(!0),y.draw(),t.preventEvent||y.getPlaceholder().trigger("plotzoom",[y,t])},y.pan=function(l){var c={x:+l.left,y:+l.top};isNaN(c.x)&&(c.x=0),isNaN(c.y)&&(c.y=0),S.each(l.axes||y.getAxes(),function(t,e){var n=e.options,i=c[e.direction];if((n.axisPan||!l.axes)&&(n.plotPan||l.axes)){var o=e.p2c(n.panRange[0])-e.p2c(e.min),a=e.p2c(n.panRange[1])-e.p2c(e.max);if(void 0!==n.panRange[0]&&a<=i&&(i=a),void 0!==n.panRange[1]&&i<=o&&(i=o),0!==i){var r=P.saturate(e.c2p(e.p2c(e.min)+i)-e.c2p(e.p2c(e.min))),s=P.saturate(e.c2p(e.p2c(e.max)+i)-e.c2p(e.p2c(e.max)));isFinite(r)||(r=0),isFinite(s)||(s=0),n.offset={below:P.saturate(r+(n.offset.below||0)),above:P.saturate(s+(n.offset.above||0))}}}}),y.setupGrid(!0),y.draw(),l.preventEvent||y.getPlaceholder().trigger("plotpan",[y,l])},y.recenter=function(n){S.each(n.axes||y.getAxes(),function(t,e){n.axes?"x"===this.direction?e.options.offset={below:0}:"y"===this.direction&&(e.options.offset={above:0}):e.options.offset={below:0,above:0}}),y.setupGrid(!0),y.draw()};var k=null,M={x:0,y:0};y.smartPan=function(a,t,r,e,n){var s,i,o,l,c,u,p,h,d,f,m,g,x,v=!!n||(i=a,Math.abs(i.y)=N||Math.abs(i.x)=N),b=y.getAxes();a=n?function(t){switch(!k&&Math.max(Math.abs(t.x),Math.abs(t.y))>=N&&(k=Math.abs(t.x)=N?{x:0,y:o.y}:Math.abs(o.y)=N?{x:o.x,y:0}:o),l=a,0e.left&&n.lefte.top&&n.top=e.length?null:e[t.fillBetween]:null}(e,t.getData());if(i){for(var o,a,r,s,l,c,u,p,h=n.pointsize,d=n.points,f=i.datapoints.pointsize,m=i.datapoints.points,g=[],x=e.lines.show,v=2=d.length);){if(u=g.length,null==d[w]){for(p=0;p=m.length){if(!x)for(p=0;p=t.min&&i<=t.max&&e.push([i,n])}return e.sort(function(t,e){return t[0]-e[0]}),e}function i(t,e,n){if("categories"===t[e].options.mode){if(!t[e].categories){var i={},o=t[e].options.categories||{};if(s.isArray(o))for(var a=0;ae&&(e=t[n]);return e+1}(n),l=0;l=m.length);){if(h=v.length,null==m[S]){for(d=0;d=x.length){if(!b)for(d=0;dm)&&(e=c,n=h,i=d,o=(t=u).offset(),a={left:0,top:0},r=x(e)/n.prevDistance,s=x(e),a.left=y(e,"pinch").x-o.left,a.top=y(e,"pinch").y-o.top,t.zoom({center:a,amount:r,axes:i.touchedAxis}),n.prevDistance=s,h.zoomEnable=!0),p=null},1e3/60))},end:function(t){p&&(clearTimeout(p),p=null),f(t,"pinch",h),h.prevDistance=null}},a={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(t,e,n,i){if(a=t,r=e,s=i,l=a.getTouchedAxis(r.detail.firstTouch.x,r.detail.firstTouch.y),void 0!==l[0]&&(s.prevTouchedAxis=l[0].direction),void 0!==(l=a.getTouchedAxis(r.detail.secondTouch.x,r.detail.secondTouch.y))[0]&&(s.touchedAxis=l,s.currentTouchedAxis=l[0].direction),g(s)&&(s.touchedAxis=null,s.prevTouchedAxis="none",s.currentTouchedAxis="none"),"x"===i.currentTouchedAxis&&"x"===i.prevTouchedAxis||"y"===i.currentTouchedAxis&&"y"===i.prevTouchedAxis||"none"===i.currentTouchedAxis&&"none"===i.prevTouchedAxis){var o;t.recenter({axes:i.touchedAxis}),o=i.touchedAxis?new c.Event("re-center",{detail:{axisTouched:i.touchedAxis}}):new c.Event("re-center",{detail:e}),t.getPlaceholder().trigger(o)}var a,r,s,l}(u,t,0,d)}},!0!==t.pan.enableTouch&&!0!==t.zoom.enableTouch||(u.hooks.bindEvents.push(function(t,e){var n=t.getOptions();n.zoom.interactive&&n.zoom.enableTouch&&(e[0].addEventListener("pinchstart",o.start,!1),e[0].addEventListener("pinchdrag",o.drag,!1),e[0].addEventListener("pinchend",o.end,!1)),n.pan.interactive&&n.pan.enableTouch&&(e[0].addEventListener("panstart",i.start,!1),e[0].addEventListener("pandrag",i.drag,!1),e[0].addEventListener("panend",i.end,!1)),n.recenter.interactive&&n.recenter.enableTouch&&e[0].addEventListener("doubletap",a.recenterPlot,!1)}),u.hooks.shutdown.push(function(t,e){e[0].removeEventListener("panstart",i.start),e[0].removeEventListener("pandrag",i.drag),e[0].removeEventListener("panend",i.end),e[0].removeEventListener("pinchstart",o.start),e[0].removeEventListener("pinchdrag",o.drag),e[0].removeEventListener("pinchend",o.end),e[0].removeEventListener("doubletap",a.recenterPlot)}))}function g(t){return!t.touchedAxis||0===t.touchedAxis.length}function l(t,e,n,i){var o,a=y(t,e);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 x(t){var e,n,i,o,a=t.detail.touches[0],r=t.detail.touches[1];return e=a.pageX,n=a.pageY,i=r.pageX,o=r.pageY,Math.sqrt((e-i)*(e-i)+(n-o)*(n-o))}function v(t,e,n,i){var o=y(t,e);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 b(t,e,n){var i=y(t,e);return{x:i.x-n.prevPanPosition.x,y:i.y-n.prevPanPosition.y}}function y(t,e){return"pinch"===e?{x:(t.detail.touches[0].pageX+t.detail.touches[1].pageX)/2,y:(t.detail.touches[0].pageY+t.detail.touches[1].pageY)/2}:{x:t.detail.touches[0].pageX,y:t.detail.touches[0].pageY}}c.plot.plugins.push({init:function(t){t.hooks.processOptions.push(e)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"})}(jQuery),function(y){var w=y.plot.browser,e="click",T="hover";y.plot.plugins.push({init:function(g){var n,x=[];function i(t){var e=g.getOptions(),n=new CustomEvent("mouseevent");return n.pageX=t.detail.changedTouches[0].pageX,n.pageY=t.detail.changedTouches[0].pageY,n.clientX=t.detail.changedTouches[0].clientX,n.clientY=t.detail.changedTouches[0].clientY,e.grid.hoverable&&o(n,T,30),!1}function o(t,e,n){var i=g.getData();if(void 0!==t&&0r.max||as.max)){var c=t.points.radius+t.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 p=t.points.symbol;"circle"===p?n.arc(o,a,u,0,2*Math.PI,!1):"string"==typeof p&&i.drawSymbol&&i.drawSymbol[p]&&i.drawSymbol[p](n,o,a,u,!1),n.closePath(),n.stroke()}}function m(t,e,n){var i,o="string"==typeof t.highlightColor?t.highlightColor:y.color.parse(t.color).scale("a",.5).toString(),a=o,r=t.bars.barWidth[0]||t.bars.barWidth;switch(t.bars.align){case"left":i=0;break;case"right":i=-r;break;default:i=-r/2}n.lineWidth=t.bars.lineWidth,n.strokeStyle=o;var s=t.bars.fillTowards||0,l=s>t.yaxis.min?Math.min(t.yaxis.max,s):t.yaxis.min;y.plot.drawSeries.drawBar(e[0],e[1],e[2]||l,i,i+r,function(){return a},t.xaxis,t.yaxis,n,t.bars.horizontal,t.bars.lineWidth)}g.hooks.bindEvents.push(function(t,e){var n=t.getOptions();(n.grid.hoverable||n.grid.clickable)&&(e[0].addEventListener("touchevent",l,!1),e[0].addEventListener("tap",i,!1)),n.grid.clickable&&e.bind("click",s),n.grid.hoverable&&(e.bind("mousemove",a),e.bind("mouseleave",r))}),g.hooks.shutdown.push(function(t,e){e[0].removeEventListener("tap",i),e[0].removeEventListener("touchevent",l),e.unbind("mousemove",a),e.unbind("mouseleave",r),e.unbind("click",s),x=[]}),g.hooks.processOptions.push(function(t,e){t.highlight=v,t.unhighlight=b,(e.grid.hoverable||e.grid.clickable)&&(t.hooks.drawOverlay.push(d),t.hooks.processDatapoints.push(p),t.hooks.setupGrid.push(h)),n=t.getPlaceholder()[0].lastMouseMoveEvent})},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"})}(jQuery),function(t){function e(n,t){var i,o={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},a=20,r=500;function s(t){var e=n.getOptions();(e.pan.active||e.zoom.active)&&(3<=t.touches.length?o.isUnsupportedGesture=!0:o.isUnsupportedGesture=!1,i.dispatchEvent(new CustomEvent("touchevent",{detail:t})),v(t)?l(t,"pinch"):(l(t,"pan"),x(t)||(function(t){var e=(new Date).getTime(),n=e-o.prevTapTime;if(0<=n&&n=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(t.delta/e.year)/Math.LN10)),p=t.delta/e.year/u;l=p<1.5?1:p<3?2:p<7.5?5:10,l*=u}l<1&&(l=1)}t.tickSize=n.tickSize||[l,c];var h=t.tickSize[0],d=h*e[c=t.tickSize[1]];"microsecond"===c?o.setMicroseconds(y(o.getMicroseconds(),h)):"millisecond"===c?o.setMilliseconds(y(o.getMilliseconds(),h)):"second"===c?o.setSeconds(y(o.getSeconds(),h)):"minute"===c?o.setMinutes(y(o.getMinutes(),h)):"hour"===c?o.setHours(y(o.getHours(),h)):"month"===c?o.setMonth(y(o.getMonth(),h)):"quarter"===c?o.setMonth(3*y(o.getMonth()/3,h)):"year"===c&&o.setFullYear(y(o.getFullYear(),h)),d>=e.millisecond&&(d>=e.second?o.setMicroseconds(0):o.setMicroseconds(1e3*o.getMilliseconds())),d>=e.minute&&o.setSeconds(0),d>=e.hour&&o.setMinutes(0),d>=e.day&&o.setHours(0),d>=4*e.day&&o.setDate(1),d>=2*e.month&&o.setMonth(y(o.getMonth(),3)),d>=2*e.quarter&&o.setMonth(y(o.getMonth(),6)),d>=e.year&&o.setMonth(0);var f,m,g=0,x=Number.NaN;do{if(m=x,f=o.getTime(),x=n&&"seconds"===n.timeBase?f/1e3:n&&"microseconds"===n.timeBase?1e3*f:f,i.push(x),"month"===c||"quarter"===c)if(h<1){o.setDate(1);var v=o.getTime();o.setMonth(o.getMonth()+("quarter"===c?3:1));var b=o.getTime();o.setTime(x+g*e.hour+(b-v)*h),g=o.getHours(),o.setHours(0)}else o.setMonth(o.getMonth()+h*("quarter"===c?3:1));else"year"===c?o.setFullYear(o.getFullYear()+h):"seconds"===n.timeBase?o.setTime(1e3*(x+d)):"microseconds"===n.timeBase?o.setTime((x+d)/1e3):o.setTime(x+d)}while(x=t&&Math.abs(k.second.y-k.first.y)>=t}c.clearSelection=h,c.setSelection=function(t,e){var n;"y"===M(c)?(k.first.x=0,k.second.x=c.width()):(n=d(t,"x"),k.first.x=n.axis.p2c(n.from),k.second.x=n.axis.p2c(n.to)),"x"===M(c)?(k.first.y=0,k.second.y=c.height()):(n=d(t,"y"),k.first.y=n.axis.p2c(n.from),k.second.y=n.axis.p2c(n.to)),k.show=!0,c.triggerRedrawOverlay(),!e&&S()&&s()},c.getSelection=e,c.hooks.bindEvents.push(function(t,e){null!=t.getOptions().selection.mode&&(t.addEventHandler("dragstart",a,e,0),t.addEventHandler("drag",i,e,0),t.addEventHandler("dragend",r,e,0))}),c.hooks.drawOverlay.push(function(t,e){if(k.show&&S()){var n=t.getPlotOffset(),i=t.getOptions();e.save(),e.translate(n.left,n.top);var o=P.color.parse(i.selection.color),a=i.selection.visualization,r=i.selection.displaySelectionDecorations,s=1;"fill"===a&&(s=.8),e.strokeStyle=o.scale("a",s).toString(),e.lineWidth=1,e.lineJoin=i.selection.shape,e.fillStyle=o.scale("a",.4).toString();var l=Math.min(k.first.x,k.second.x)+.5,c=l,u=Math.min(k.first.y,k.second.y)+.5,p=u,h=Math.abs(k.second.x-k.first.x)-1,d=Math.abs(k.second.y-k.first.y)-1;"x"===M(t)&&(d+=u,u=0),"y"===M(t)&&(h+=l,l=0),"fill"===a?(e.fillRect(l,u,h,d),e.strokeRect(l,u,h,d)):(e.fillRect(0,0,t.width(),t.height()),e.clearRect(l,u,h,d),r&&(f=e,m=l,g=u,x=h,v=d,b=c,y=p,w=M(t),T=Math.max(0,Math.min(15,x/2-2,v/2-2)),f.fillStyle="#ffffff","xy"===w&&(f.beginPath(),f.moveTo(m,g+T),f.lineTo(m-3,g+T),f.lineTo(m-3,g-3),f.lineTo(m+T,g-3),f.lineTo(m+T,g),f.lineTo(m,g),f.closePath(),f.moveTo(m,g+v-T),f.lineTo(m-3,g+v-T),f.lineTo(m-3,g+v+3),f.lineTo(m+T,g+v+3),f.lineTo(m+T,g+v),f.lineTo(m,g+v),f.closePath(),f.moveTo(m+x,g+T),f.lineTo(m+x+3,g+T),f.lineTo(m+x+3,g-3),f.lineTo(m+x-T,g-3),f.lineTo(m+x-T,g),f.lineTo(m+x,g),f.closePath(),f.moveTo(m+x,g+v-T),f.lineTo(m+x+3,g+v-T),f.lineTo(m+x+3,g+v+3),f.lineTo(m+x-T,g+v+3),f.lineTo(m+x-T,g+v),f.lineTo(m+x,g+v),f.closePath(),f.stroke(),f.fill()),m=b,g=y,"x"===w&&(f.beginPath(),f.moveTo(m,g+15),f.lineTo(m,g-15),f.lineTo(m-3,g-15),f.lineTo(m-3,g+15),f.closePath(),f.moveTo(m+x,g+15),f.lineTo(m+x,g-15),f.lineTo(m+x+3,g-15),f.lineTo(m+x+3,g+15),f.closePath(),f.stroke(),f.fill()),"y"===w&&(f.beginPath(),f.moveTo(m-15,g),f.lineTo(m+15,g),f.lineTo(m+15,g-3),f.lineTo(m-15,g-3),f.closePath(),f.moveTo(m-15,g+v),f.lineTo(m+15,g+v),f.lineTo(m+15,g+v+3),f.lineTo(m-15,g+v+3),f.closePath(),f.stroke(),f.fill()))),e.restore()}var f,m,g,x,v,b,y,w,T}),c.hooks.shutdown.push(function(t,e){e.unbind("dragstart",a),e.unbind("drag",i),e.unbind("dragend",r)})},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"})}(jQuery),function(t){var e=-100,c=0,u=-1,p=-2,h=1,g=t.plot.browser,a=g.getPixelRatio;function n(t,e){var n=t.filter(r);h=a(e.getContext("2d"));var i,o=n.map(function(t){var f,m,e=new Image;return new Promise((m=t,(f=e).sourceDescription='',f.sourceComponent=m,function(e,t){var n,i,o,a,r,s,l,c,u,p,h,d;f.onload=function(t){f.successfullyLoaded=!0,e(f)},f.onabort=function(t){f.successfullyLoaded=!1,console.log("Can't generate temp image from "+f.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",f.sourceComponent),e(f)},f.onerror=function(t){f.successfullyLoaded=!1,console.log("Can't generate temp image from "+f.sourceDescription+". It is possible that it is missing some properties or its content is not supported by this browser. Source component:",f.sourceComponent),e(f)},i=f,"CANVAS"===(n=m).tagName&&(o=n,i.src=o.toDataURL("image/png")),"svg"===n.tagName&&(a=n,r=i,g.isSafari()||g.isMobileSafari()?(s=a,l=r,p=b(p=v(x(document),s)),u=function(t){for(var e="",n=new Uint8Array(t),i=0;it[l].genLeft&&(o=t[l].genLeft),a>t[l].genTop&&(a=t[l].genTop);for(l=1;l',"",e.innerHTML,""].join("\n")}function b(t){var e="";return t.match(/^