!function(e){var t=function(t,i){var n=i.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",i.appendChild(n),!n.getContext))throw new Error("Canvas is not available.");this.element=n;var o=this.context=n.getContext("2d");this.pixelRatio=e.plot.browser.getPixelRatio(o);var a=e(i).width(),r=e(i).height();this.resize(a,r),this.SVGContainer=null,this.SVG={},this._textCache={}};function i(e,t){e.transform.baseVal.clear(),t&&t.forEach((function(t){e.transform.baseVal.appendItem(t)}))}t.prototype.resize=function(e,t){e=e<10?10:e,t=t<10?10:t;var i=this.element,n=this.context,o=this.pixelRatio;this.width!==e&&(i.width=e*o,i.style.width=e+"px",this.width=e),this.height!==t&&(i.height=t*o,i.style.height=t+"px",this.height=t),n.restore(),n.save(),n.scale(o,o)},t.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},t.prototype.render=function(){var e=this._textCache;for(var t in e)if(hasOwnProperty.call(e,t)){var i=this.getSVGLayer(t),n=e[t],o=i.style.display;for(var a in i.style.display="none",n)if(hasOwnProperty.call(n,a)){var r=n[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||(i.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])}}i.style.display=o}},t.prototype.getSVGLayer=function(e){var t,i=this.SVG[e];i||(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)),(i=document.createElementNS("http://www.w3.org/2000/svg","g")).setAttribute("class",e),i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.bottom="0px",i.style.right="0px",t.appendChild(i),this.SVG[e]=i);return i},t.prototype.getTextInfo=function(e,t,i,o,a){var r,s,l,c;t=""+t,r="object"==typeof i?i.style+" "+i.variant+" "+i.weight+" "+i.size+"px/"+i.lineHeight+"px "+i.family:i,null==(s=this._textCache[e])&&(s=this._textCache[e]={}),null==(l=s[r])&&(l=s[r]={});var u=function(e){return e.replace(/0|1|2|3|4|5|6|7|8|9/g,"0")}(t);if(!(c=l[u])){var p=document.createElementNS("http://www.w3.org/2000/svg","text");if(-1!==t.indexOf("
"))n(t,p,-9999);else{var h=document.createTextNode(t);p.appendChild(h)}p.style.position="absolute",p.style.maxWidth=a,p.setAttributeNS(null,"x",-9999),p.setAttributeNS(null,"y",-9999),"object"==typeof i?(p.style.font=r,p.style.fill=i.fill):"string"==typeof i&&p.setAttribute("class",i),this.getSVGLayer(e).appendChild(p);var d=p.getBBox();for(c=l[u]={width:d.width,height:d.height,measured:!0,element:p,positions:[]};p.firstChild;)p.removeChild(p.firstChild);p.parentNode.removeChild(p)}return c.measured=!0,c},t.prototype.addText=function(e,t,o,a,r,s,l,c,u,p){var h=this.getTextInfo(e,a,r,s,l),d=h.positions;"center"===c?t-=h.width/2:"right"===c&&(t-=h.width),"middle"===u?o-=h.height/2:"bottom"===u&&(o-=h.height),o+=.75*h.height;for(var f,m=0;d[m];m++){if((f=d[m]).x===t&&f.y===o&&f.text===a)return f.active=!0,void i(f.element,p);if(!1===f.active)return f.active=!0,f.text=a,-1!==a.indexOf("
")?(o-=.25*h.height,n(a,f.element,t)):f.element.textContent=a,f.element.setAttributeNS(null,"x",t),f.element.setAttributeNS(null,"y",o),f.x=t,f.y=o,void i(f.element,p)}f={active:!0,rendered:!1,element:d.length?h.element.cloneNode():h.element,text:a,x:t,y:o},d.push(f),-1!==a.indexOf("
")?(o-=.25*h.height,n(a,f.element,t)):f.element.textContent=a,f.element.setAttributeNS(null,"x",t),f.element.setAttributeNS(null,"y",o),f.element.style.textAlign=c,i(f.element,p)};var n=function(e,t,i){var n,o,a,r=e.split("
");for(o=0;o=1?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function e(e,t,i){return ti?i:t}return a.r=e(0,parseInt(a.r),255),a.g=e(0,parseInt(a.g),255),a.b=e(0,parseInt(a.b),255),a.a=e(0,a.a,1),a},a.clone=function(){return e.color.make(a.r,a.b,a.g,a.a)},a.normalize()},e.color.extract=function(t,i){var n;do{if(""!==(n=t.css(i).toLowerCase())&&"transparent"!==n)break;t=t.parent()}while(t.length&&!e.nodeName(t.get(0),"body"));return"rgba(0, 0, 0, 0)"===n&&(n="transparent"),e.color.parse(n)},e.color.parse=function(i){var n,o=e.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/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(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*,\s*([0-9]+(?:\.[0-9]+)?)%\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/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(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return o(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return o(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var a=e.trim(i).toLowerCase();return"transparent"===a?o(255,255,255,0):o((n=t[a]||[0,0,0])[0],n[1],n[2])};var 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]}}(jQuery),function(e){"use strict";var t=window.Flot.Canvas;function i(t){var i,n=[],o=e.plot.saturated.saturate(e.plot.saturated.floorInBase(t.min,t.tickSize)),a=0,r=Number.NaN;o===-Number.MAX_VALUE&&(n.push(o),o=e.plot.saturated.floorInBase(t.min+t.tickSize,t.tickSize));do{i=r,r=e.plot.saturated.multiplyAdd(t.tickSize,a,o),n.push(r),++a}while(r0&&(t.tickDecimals=i);var a=t.tickDecimals?parseFloat("1e"+t.tickDecimals):1,r=""+Math.round(e*a)/a;if(null!=t.tickDecimals){var s=r.indexOf("."),l=-1===s?0:r.length-s-1;if(l0?Math.floor(Math.log(e)/Math.LN10):0,s=parseFloat("1e"+r),l=e/s;if(i){var c=a(e,i);return(e/s).toFixed(c)+"e"+r}return t.tickDecimals>0?l.toFixed(a(e,t.tickDecimals))+"e"+r:l.toFixed()+"e"+r}function a(e,t){var i=Math.log(Math.abs(e))*Math.LOG10E,n=Math.abs(i+t);return n<=20?Math.floor(n):20}function r(o,a,r,s){var l=[],c={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:{}},u=null,p=null,h=null,d=null,f=null,m=[],g=[],x={left:0,right:0,top:0,bottom:0},v=0,b=0,y={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],setupGrid:[],adjustSeriesDataRange:[],setRange:[],drawBackground:[],drawSeries:[],drawAxis:[],draw:[],findNearbyItems:[],axisReserveSpace:[],bindEvents:[],drawOverlay:[],resize:[],shutdown:[]},w=this,k={},T=null;w.setData=C,w.setupGrid=R,w.draw=B,w.getPlaceholder=function(){return o},w.getCanvas=function(){return u.element},w.getSurface=function(){return u},w.getEventHolder=function(){return h[0]},w.getPlotOffset=function(){return x},w.width=function(){return v},w.height=function(){return b},w.offset=function(){var e=h.offset();return e.left+=x.left,e.top+=x.top,e},w.getData=function(){return l},w.getAxes=function(){var t={};return e.each(m.concat(g),(function(e,i){i&&(t[i.direction+(1!==i.n?i.n:"")+"axis"]=i)})),t},w.getXAxes=function(){return m},w.getYAxes=function(){return g},w.c2p=function(e){var t,i,n={};for(t=0;tl.xmax&&(l.xmax=p)),!0===h.y&&(pl.ymax&&(l.ymax=p))))}return l},w.adjustSeriesDataRange=function(e,t){if(e.bars.show){var i,n=e.bars.barWidth[1];e.datapoints&&e.datapoints.points&&!n&&function(e){var t=[],i=e.datapoints.pointsize,n=Number.MAX_VALUE;e.datapoints.points.length<=i&&(n=1);for(let n=e.bars.horizontal?1:0;nt}:function(e,t){return t>e};if(!x(e,h[0])){for(o=c;ot.priority-e.priority)),a.forEach((e=>{e.eventHolder.unbind(e.event,e.handler),e.eventHolder.bind(e.event,e.handler)})),k[o]=a},w.hooks=y;var M=e.plot.uiConstants.MINOR_TICKS_COUNT_CONSTANT,S=e.plot.uiConstants.TICK_LENGTH_CONSTANT;function P(e,t){t=[w].concat(t);for(var i=0;in&&(n=o))}i<=n&&(i=n+1);var a,r=[],s=c.colors,u=s.length,p=0,h=Math.max(0,l.length-i);for(t=0;t=0?p<.5?-p-.2:0:-p),r[t]=a.scale("rgb",1+p);var d,f=0;for(t=0;te.datamax&&i!==1/0&&(e.datamax=i)}function v(e,t){return e&&e[t]&&e[t].datapoints&&e[t].datapoints.points?e[t].datapoints.points:[]}for(e.each(O(),(function(e,t){!0!==t.options.growOnly?(t.datamin=m,t.datamax=g):(void 0===t.datamin&&(t.datamin=m),void 0===t.datamax&&(t.datamax=g)),t.used=!1})),i=0;i2&&f.push({x:r.bars.horizontal,y:!r.bars.horizontal,number:!0,required:!1,computeRange:"none"!==r.yaxis.options.autoScale,defaultValue:0});r.datapoints.format=f}if(r.xaxis.used=r.yaxis.used=!0,null==r.datapoints.pointsize){for(r.datapoints.pointsize=f.length,c=r.datapoints.pointsize,s=r.datapoints.points,n=o=0;no){var r=n;n=o,o=r,t.options.offset={above:0,below:0}}t.min=e.plot.saturated.saturate(n),t.max=e.plot.saturated.saturate(o)}(o,t)})),s){v=u.width-x.left-x.right,b=u.height-x.bottom-x.top;var p=e.grep(r,(function(e){return e.show||e.reserveSpace}));for(e.each(p,(function(t,n){!function(t){var n,o=t.options;n=Y(t.direction,u,o.ticks),t.delta=e.plot.saturated.delta(t.min,t.max,n);var a=w.computeValuePrecision(t.min,t.max,t.direction,n,o.tickDecimals);t.tickDecimals=Math.max(0,null!=o.tickDecimals?o.tickDecimals:a),t.tickSize=function(e,t,i,n,o){var a;a="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"===i?u.width:u.height);var r=W(e,t,a,o);null!=n.minTickSize&&r0&&(null==o.min&&(t.min=Math.min(t.min,s[0])),null==o.max&&s.length>1&&(t.max=Math.max(t.max,s[s.length-1]))),t.tickGenerator=function(e){var t,i,n=[];for(i=0;i1&&/\..*0$/.test((c[1]-c[0]).toFixed(l))||(t.tickDecimals=l)}}}}(n),function(t){var i,n,o=t.options.ticks,a=[];null==o||"number"==typeof o&&o>0?a=t.tickGenerator(t,w):o&&(a=e.isFunction(o)?o(t):o);for(t.ticks=[],i=0;i1&&(r=s[1])):n=+s,isNaN(n)||t.ticks.push(X(n,r,t,"major"))}}(n),function(e,t,i){var n=function(e){return e.some((e=>e.datapoints.points.length>0))};"loose"===e.options.autoScale&&t.length>0&&n(i)&&(e.min=Math.min(e.min,t[0].v),e.max=Math.max(e.max,t[t.length-1].v))}(n,n.ticks,l),L(n),function(e,t){(function(e,t){if("endpoints"===e.options.showTickLabels)return!0;if("all"===e.options.showTickLabels){var i=t.filter((function(t){return t.bars.horizontal?t.yaxis===e:t.xaxis===e})),n=i.some((function(e){return!e.bars.show}));return 0===i.length||n}if("major"===e.options.showTickLabels||"none"===e.options.showTickLabels)return!1})(e,t)&&(e.ticks.unshift(X(e.min,null,e,"min")),e.ticks.push(X(e.max,null,e,"max")))}(n,l),function(e){for(var t=e.options,i="none"!==t.showTickLabels&&e.ticks?e.ticks:[],n="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",p=0;p0&&p=0;--o)I(p[o]);!function(){var t,i=c.grid.minBorderMargin;if(null==i)for(i=0,t=0;t0}))})),x.left=Math.ceil(Math.max(a.left,x.left)),x.right=Math.ceil(Math.max(a.right,x.right)),x.top=Math.ceil(Math.max(a.top,x.top)),x.bottom=Math.ceil(Math.max(a.bottom,x.bottom))}(),e.each(p,(function(e,t){!function(e){"x"===e.direction?(e.box.left=x.left-e.labelWidth/2,e.box.width=u.width-x.left-x.right+e.labelWidth):(e.box.top=x.top-e.labelHeight/2,e.box.height=u.height-x.bottom-x.top+e.labelHeight)}(t)}))}if(c.grid.margin){for(a in x){var h=c.grid.margin||0;x[a]+="number"==typeof h?h:h[a]||0}e.each(m.concat(g),(function(e,t){E(t,c.grid.margin,(function(e){return null!=e}))}))}v=u.width-x.left-x.right,b=u.height-x.bottom-x.top,e.each(r,(function(e,t){L(t)})),s&&e.each(O(),(function(e,t){var i,n,o,a,r,s,l,c=t.box,p=t.direction+"Axis "+t.direction+t.n+"Axis",h="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+p,d=t.options.font||"flot-tick-label tickLabel",f=3,m={x:NaN,y:NaN,width:NaN,height:NaN},g=[],v=function(e,t,i,n,o,a,r,s){return(e<=o&&o<=i||o<=e&&e<=r)&&(t<=a&&a<=n||a<=t&&t<=s)},b=function(e,t){return t.some((function(t){return v(e.x,e.y,e.x+e.width,e.y+e.height,t.x,t.y,t.x+t.width,t.y+t.height)}))},w=function(e,i){return!e||!e.label||e.vt.max?m:(s=u.getTextInfo(h,e.label,d),"x"===t.direction?(a="center",n=x.left+t.p2c(e.v),"bottom"===t.position?o=c.top+c.padding-t.boxPosition.centerY:(o=c.top+c.height-c.padding+t.boxPosition.centerY,r="bottom"),l={x:n-s.width/2-f,y:o-f,width:s.width+2*f,height:s.height+2*f}):(r="middle",o=x.top+t.p2c(e.v),"left"===t.position?(n=c.left+c.width-c.padding-t.boxPosition.centerX,a="right"):n=c.left+c.padding+t.boxPosition.centerX,l={x:n-s.width/2-f,y:o-f,width:s.width+2*f,height:s.height+2*f}),b(l,i)?m:(u.addText(h,n,o,e.label,d,null,null,a,r),l))};if(u.removeText(h),P(y.drawAxis,[t,u]),t.show)switch(t.options.showTickLabels){case"none":break;case"endpoints":g.push(w(t.ticks[0],g)),g.push(w(t.ticks[t.ticks.length-1],g));break;case"major":for(g.push(w(t.ticks[0],g)),g.push(w(t.ticks[t.ticks.length-1],g)),i=1;i=0&&(o=0)}else o=n.min,a=n.max;break;case"exact":o=null!=r?r:n.min,a=null!=s?s:n.max;break;case"sliding-window":s>a&&(a=s,o=Math.max(s-(n.windowSize||100),o))}var c=function(e,t){var i=void 0===e?null:e,n=void 0===t?null:t;if(0==n-i){var o=0===n?1:.01,a=null;null==i&&(a-=o),null!=n&&null==i||(n+=o),null!=a&&(i=a)}return{min:i,max:n}}(o,a);o=c.min,a=c.max,!0===n.growOnly&&"none"!==n.autoScale&&"sliding-window"!==n.autoScale&&(o=os?a:null!==s?s:a),t.autoScaledMin=o,t.autoScaledMax=a}function F(t,i,n,o,a){var r=Y(n,u,o),s=e.plot.saturated.delta(t,i,r),l=-Math.floor(Math.log(s)/Math.LN10);a&&l>a&&(l=a);var c=s/parseFloat("1e"+-l);return c>2.25&&c<3&&l+1<=a&&++l,isFinite(l)?l:0}function W(t,i,n,o){var a=e.plot.saturated.delta(t,i,n),r=-Math.floor(Math.log(a)/Math.LN10);o&&r>o&&(r=o);var s,l=parseFloat("1e"+-r),c=a/l;return c<1.5?s=1:c<3?(s=2,c>2.25&&(null==o||r+1<=o)&&(s=2.5)):s=c<7.5?5:10,s*=l}function Y(e,t,i){return"number"==typeof i&&i>0?i:.3*Math.sqrt("x"===e?t.width:t.height)}function X(e,t,i,n){if(null===t)switch(n){case"min":case"max":var o=function(e,t){var i=Math.floor(t.p2c(e)),n="x"===t.direction?i+1:i-1,o=t.c2p(i),a=t.c2p(n);return F(o,a,t.direction,1)}(e,i);isFinite(o),t=i.tickFormatter(e,i,o,w);break;case"major":t=i.tickFormatter(e,i,void 0,w)}return{v:e,label:t}}function B(){u.clear(),P(y.drawBackground,[d]);var e=c.grid;e.show&&e.backgroundColor&&(d.save(),d.translate(x.left,x.top),d.fillStyle=te(c.grid.backgroundColor,b,0,"rgba(255, 255, 255, 0)"),d.fillRect(0,0,v,b),d.restore()),e.show&&!e.aboveData&&Q();for(var t=0;to){var l=n;n=o,o=l}return{from:n,to:o,axis:i}}function q(e){var t=e.box,i=0,n=0;return"x"===e.direction?(i=0,n=t.top-x.top+("top"===e.position?t.height:0)):(n=0,i=t.left-x.left+("left"===e.position?t.width:0)+e.boxPosition.centerX),{x:i,y:n}}function j(e,t){return e%2!=0?Math.floor(t)+.5:t}function H(e){d.lineWidth=1;var t=q(e),i=t.x,n=t.y;if(e.show){var o=0,a=0;d.strokeStyle=e.options.color,d.beginPath(),"x"===e.direction?o=v+1:a=b+1,"x"===e.direction?n=j(d.lineWidth,n):i=j(d.lineWidth,i),d.moveTo(i,n),d.lineTo(i+o,n+a),d.stroke()}}function V(e){var t=e.tickLength,i=e.showMinorTicks,n=M,o=q(e),a=o.x,r=o.y,s=0;for(d.strokeStyle=e.options.color,d.beginPath(),s=0;s=e.min&&c<=e.max&&("x"===e.direction?(a=e.p2c(c),p=t,"top"===e.position&&(p=-p)):(r=e.p2c(c),u=t,"left"===e.position&&(u=-u)),"x"===e.direction?a=j(d.lineWidth,a):r=j(d.lineWidth,r),d.moveTo(a,r),d.lineTo(a+u,r+p)),!0===i&&sv)continue}else if(h=t/2,r=j(d.lineWidth,e.p2c(m+l*g)),"left"===e.position&&(h=-h),r<0||r>b)continue;d.moveTo(a,r),d.lineTo(a+h,r+f)}}}d.stroke()}function _(e){var t,i,n;for(d.strokeStyle=c.grid.tickColor,d.beginPath(),t=0;te.max||(i=o,n=void 0,(!("object"==typeof(n=c.grid.borderWidth)&&n[e.position]>0||n>0)||i!==e.min&&i!==e.max)&&("x"===e.direction?(s=e.p2c(o),l=b,r=-b):(s=0,l=e.p2c(o),a=v),"x"===e.direction?s=j(d.lineWidth,s):l=j(d.lineWidth,l),d.moveTo(s,l),d.lineTo(s+a,l+r)))}d.stroke()}function Q(){var t,i;d.save(),d.translate(x.left,x.top),function(){var t,i,n=c.grid.markings;if(n)for(e.isFunction(n)&&((t=w.getAxes()).xmin=t.xaxis.min,t.xmax=t.xaxis.max,t.ymin=t.yaxis.min,t.ymax=t.yaxis.max,n=n(t)),i=0;ia.axis.max||r.tor.axis.max)){a.from=Math.max(a.from,a.axis.min),a.to=Math.min(a.to,a.axis.max),r.from=Math.max(r.from,r.axis.min),r.to=Math.min(r.to,r.axis.max);var s=a.from===a.to,l=r.from===r.to;if(!s||!l)if(a.from=Math.floor(a.axis.p2c(a.from)),a.to=Math.floor(a.axis.p2c(a.to)),r.from=Math.floor(r.axis.p2c(r.from)),r.to=Math.floor(r.axis.p2c(r.to)),s||l){var u=o.lineWidth||c.grid.markingsLineWidth,p=u%2?.5:0;d.beginPath(),d.strokeStyle=o.color||c.grid.markingsColor,d.lineWidth=u,s?(d.moveTo(a.to+p,r.from),d.lineTo(a.to+p,r.to)):(d.moveTo(a.from,r.to+p),d.lineTo(a.to,r.to+p)),d.stroke()}else d.fillStyle=o.color||c.grid.markingsColor,d.fillRect(a.from,r.to,a.to-a.from,r.from-r.to)}}}(),t=O(),i=c.grid.borderWidth;for(var n=0;n0&&(d.strokeStyle=t.top,d.lineWidth=e.top,d.beginPath(),d.moveTo(0-e.left,0-e.top/2),d.lineTo(v,0-e.top/2),d.stroke()),e.right>0&&(d.strokeStyle=t.right,d.lineWidth=e.right,d.beginPath(),d.moveTo(v+e.right/2,0-e.top),d.lineTo(v+e.right/2,b),d.stroke()),e.bottom>0&&(d.strokeStyle=t.bottom,d.lineWidth=e.bottom,d.beginPath(),d.moveTo(v+e.right,b+e.bottom/2),d.lineTo(0,b+e.bottom/2),d.stroke()),e.left>0&&(d.strokeStyle=t.left,d.lineWidth=e.left,d.beginPath(),d.moveTo(0-e.left/2,b+e.bottom),d.lineTo(0-e.left/2,0),d.stroke())):(d.lineWidth=e,d.strokeStyle=c.grid.borderColor,d.strokeRect(-e/2,-e/2,v+e,b+e))}(),d.restore()}function U(t){t.lines.show&&e.plot.drawSeries.drawSeriesLines(t,d,x,v,b,w.drawSymbol,te),t.bars.show&&e.plot.drawSeries.drawSeriesBars(t,d,x,v,b,w.drawSymbol,te),t.points.show&&e.plot.drawSeries.drawSeriesPoints(t,d,x,v,b,w.drawSymbol,te)}function $(e,t,i,n,o){for(var a=function(e,t,i,n,o){var a,r=[],s=[],c=n*n+1;for(a=l.length-1;a>=0;--a)if(i(a)){var u=l[a];if(!u.datapoints)return;var p=!1;if(u.lines.show||u.points.show){var h=Z(u,e,t,n,o);h&&(s.push({seriesIndex:a,dataIndex:h.dataIndex,distance:h.distance}),p=!0)}if(u.bars.show&&!p){var d=J(u,e,t);d>=0&&s.push({seriesIndex:a,dataIndex:d,distance:c})}}for(a=0;avoid 0===t.distance?-1:void 0===e.distance&&void 0!==t.distance?1:e.distance-t.distance))}function Z(e,t,i,n,o){var a=e.xaxis.c2p(t),r=e.yaxis.c2p(i),s=n/e.xaxis.scale,l=n/e.yaxis.scale,c=e.datapoints.points,u=e.datapoints.pointsize,p=Number.POSITIVE_INFINITY;e.xaxis.options.inverseTransform&&(s=Number.MAX_VALUE),e.yaxis.options.inverseTransform&&(l=Number.MAX_VALUE);for(var h=null,d=0;ds||f-a<-s||m-r>l||m-r<-l)){var g=Math.abs(e.xaxis.p2c(f)-t),x=Math.abs(e.yaxis.p2c(m)-i),v=o?o(g,x):g*g+x*x;ve.yaxis.min?Math.min(e.yaxis.max,u):e.yaxis.min,h=-1,d=0;d=Math.min(g,f)&&s>=m+n&&s<=m+o:r>=f+n&&r<=f+o&&s>=Math.min(g,m)&&s<=Math.max(g,m))&&(h=d/c)}}return h}function K(){var e=c.interaction.redrawOverlayInterval;-1!==e?T||(T=setTimeout((function(){ee(w)}),e)):ee()}function ee(e){if(T=null,f){p.clear(),P(y.drawOverlay,[f,p]);var t=new CustomEvent("onDrawingDone");e.getEventHolder().dispatchEvent(t),e.getPlaceholder().trigger("drawingdone")}}function te(t,i,n,o){if("string"==typeof t)return t;for(var a=d.createLinearGradient(0,n,0,i),r=0,s=t.colors.length;r=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}};e.plot.browser=t}(jQuery),function(e){"use strict";e.plot.drawSeries=new function(){function t(e,t,i,n,o,a,r,s,l,c,u){var p,h,d,f,m=e+n,g=e+o,x=i,v=t,b=!1;p=h=d=!0,c?(b=h=d=!0,p=!1,v=t+n,x=t+o,(g=e)<(m=i)&&(f=g,g=m,m=f,p=!0,h=!1)):(p=h=d=!0,b=!1,m=e+n,g=e+o,(v=t)<(x=i)&&(f=v,v=x,x=f,b=!0,d=!1)),gr.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)),u>0&&(p||h||d||b)&&(l.beginPath(),l.moveTo(m,x),p?l.lineTo(m,v):l.moveTo(m,v),d?l.lineTo(g,v):l.moveTo(g,v),h?l.lineTo(g,x):l.moveTo(g,x),b?l.lineTo(m,x):l.moveTo(m,x),l.stroke()))}function i(t,i,n,o,a){var r=t.fill;if(!r)return null;if(t.fillColor)return a(t.fillColor,n,o,i);var s=e.color.parse(i);return s.a="number"==typeof r?r:.4,s.normalize(),s.toString()}this.drawSeriesLines=function(e,t,n,o,a,r,s){t.save(),t.translate(n.left,n.top),t.lineJoin="round",e.lines.dashes&&t.setLineDash&&t.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;t.lineWidth=c,t.strokeStyle=e.color;var u=i(e.lines,e.color,0,a,s);u&&(t.fillStyle=u,function(e,t,i,n,o,a){for(var r=e.points,s=e.pointsize,l=n>i.min?Math.min(i.max,n):i.min,c=0,u=1,p=!1,h=0,d=0,f=null,m=null;!(s>0&&c>r.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(s>0&&null!=g&&null==v){d=c,s=-s,u=2;continue}if(s<0&&c===h+s){o.fill(),p=!1,u=1,c=h=d+(s=-s);continue}}if(null!=g&&null!=v){if(a&&(null!==f&&null!==m?(v=g,b=x,g=f,x=m,f=null,m=null,c-=s):x!==b&&g!==v&&(b=x,f=v,m=x)),g<=v&&g=v&&g>t.max){if(v>t.max)continue;x=(t.max-g)/(v-g)*(b-x)+x,g=t.max}else if(v>=g&&v>t.max){if(g>t.max)continue;b=(t.max-g)/(v-g)*(b-x)+x,v=t.max}if(p||(o.beginPath(),o.moveTo(t.p2c(g),i.p2c(l)),p=!0),x>=i.max&&b>=i.max)o.lineTo(t.p2c(g),i.p2c(i.max)),o.lineTo(t.p2c(v),i.p2c(i.max));else if(x<=i.min&&b<=i.min)o.lineTo(t.p2c(g),i.p2c(i.min)),o.lineTo(t.p2c(v),i.p2c(i.min));else{var y=g,w=v;x<=b&&x=i.min?(g=(i.min-x)/(b-x)*(v-g)+g,x=i.min):b<=x&&b=i.min&&(v=(i.min-x)/(b-x)*(v-g)+g,b=i.min),x>=b&&x>i.max&&b<=i.max?(g=(i.max-x)/(b-x)*(v-g)+g,x=i.max):b>=x&&b>i.max&&x<=i.max&&(v=(i.max-x)/(b-x)*(v-g)+g,b=i.max),g!==y&&o.lineTo(t.p2c(y),i.p2c(x)),o.lineTo(t.p2c(g),i.p2c(x)),o.lineTo(t.p2c(v),i.p2c(b)),v!==w&&(o.lineTo(t.p2c(v),i.p2c(b)),o.lineTo(t.p2c(w),i.p2c(b)))}}else f=null,m=null}}(l,e.xaxis,e.yaxis,e.lines.fillTowards||0,t,e.lines.steps)),c>0&&function(e,t,i,n,o,a,r){var s=e.points,l=e.pointsize,c=null,u=null,p=0,h=0,d=0,f=0,m=null,g=null,x=0;for(a.beginPath(),x=l;x=f&&h>o.max){if(f>o.max)continue;p=(o.max-h)/(f-h)*(d-p)+p,h=o.max}else if(f>=h&&f>o.max){if(h>o.max)continue;d=(o.max-h)/(f-h)*(d-p)+p,f=o.max}if(p<=d&&p=d&&p>n.max){if(d>n.max)continue;h=(n.max-p)/(d-p)*(f-h)+h,p=n.max}else if(d>=p&&d>n.max){if(p>n.max)continue;f=(n.max-p)/(d-p)*(f-h)+h,d=n.max}p===c&&h===u||a.moveTo(n.p2c(p)+t,o.p2c(h)+i),c=d,u=f,a.lineTo(n.p2c(d)+t,o.p2c(f)+i)}else m=null,g=null;a.stroke()}(l,0,0,e.xaxis,e.yaxis,t,e.lines.steps),t.restore()},this.drawSeriesPoints=function(e,t,n,o,a,r,s){function l(e,t,i,n,o,a){e.moveTo(t+n,i),e.arc(t,i,n,0,o?Math.PI:2*Math.PI,!1)}l.fill=!0,t.save(),t.translate(n.left,n.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,p=e.points.lineWidth,h=e.points.radius,d=e.points.symbol;"circle"===d?u=l:"string"==typeof d&&r&&r[d]?u=r[d]:"function"==typeof r&&(u=r),0===p&&(p=1e-4),t.lineWidth=p,t.fillStyle=i(e.points,e.color,null,null,s),t.strokeStyle=e.color,function(e,i,n,o,a,r,s,l){var c=e.points,u=e.pointsize;t.beginPath();for(var p=0;pr.max||ds.max||(h=r.p2c(h),d=s.p2c(d)+o,l(t,h,d,i,a,n))}l.fill&&!a&&t.fill(),t.stroke()}(c,h,!0,0,!1,e.xaxis,e.yaxis,u),t.restore()},this.drawSeriesBars=function(e,n,o,a,r,s,l){n.save(),n.translate(o.left,o.top);var c,u={format:e.datapoints.format,points:e.datapoints.points,pointsize:e.datapoints.pointsize};e.decimate&&(u.points=e.decimate(e,e.xaxis.min,e.xaxis.max,a)),n.lineWidth=e.bars.lineWidth,n.strokeStyle=e.color;var p=e.bars.barWidth[0]||e.bars.barWidth;switch(e.bars.align){case"left":c=0;break;case"right":c=-p;break;default:c=-p/2}!function(i,o,a,r,s,l){for(var c=i.points,u=i.pointsize,p=e.bars.fillTowards||0,h=p>l.min?Math.min(l.max,p):l.min,d=0;dn+u?o(t,[[r,a],[Math.max(n+u,h[0]),a]]):l=!1,sa+u?o(t,[[n,Math.max(a+u,h[1])],[n,s]]):c=!1),u=null!=i.radius?i.radius:u,l&&("-"===i.upperCap?"x"===i.err?o(t,[[r,a-u],[r,a+u]]):o(t,[[n-u,r],[n+u,r]]):e.isFunction(i.upperCap)&&("x"===i.err?i.upperCap(t,r,a,u):i.upperCap(t,n,r,u))),c&&("-"===i.lowerCap?"x"===i.err?o(t,[[s,a-u],[s,a+u]]):o(t,[[n-u,s],[n+u,s]]):e.isFunction(i.lowerCap)&&("x"===i.err?i.lowerCap(t,s,a,u):i.lowerCap(t,n,s,u)))}function o(e,t){e.beginPath(),e.moveTo(t[0][0],t[0][1]);for(var i=1;il[1].max||vl[0].max))continue;if("y"===u[m].err&&(x>l[0].max||xl[1].max))continue;var w=!0,k=!0;b>g[1]&&(w=!1,b=g[1]),y0&&M>0){var S=M/2;t.lineWidth=S,t.strokeStyle="rgba(0,0,0,0.1)",n(t,u[m],x,v,b,y,w,k,c,S+S/2,g),t.strokeStyle="rgba(0,0,0,0.2)",n(t,u[m],x,v,b,y,w,k,c,S/2,g)}t.strokeStyle=u[m].color?u[m].color:o.color,t.lineWidth=T,n(t,u[m],x,v,b,y,w,k,c,0,g)}}}(0,o,t)})),o.restore()}e.plot.plugins.push({init:function(e){e.hooks.processRawData.push(t),e.hooks.draw.push(a)},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"})}(jQuery),function(e){"use strict";jQuery.plot.uiConstants={SNAPPING_CONSTANT:20,PANHINT_LENGTH_CONSTANT:10,MINOR_TICKS_COUNT_CONSTANT:4,TICK_LENGTH_CONSTANT:10,ZOOM_DISTANCE_MARGIN:25}}(),function(e){"use strict";var t=n(Number.MAX_VALUE,10),i=n(Number.MAX_VALUE,4);function n(e,t){for(var i,n,o=Math.floor(Math.log(e)*Math.LOG10E)-1,a=[],r=-o;r<=o;r++){n=parseFloat("1e"+r);for(var s=1;s<9;s+=t)i=n*s,a.push(i)}return a}var o=function(n,o,r){var s=[],l=-1,c=-1,u=n.getCanvas(),p=t,h=a(o,n),d=o.max;r||(r=.3*Math.sqrt("x"===o.direction?u.width:u.height)),t.some((function(e,t){return e>=h&&(l=t,!0)})),t.some((function(e,t){return e>=d&&(c=t,!0)})),-1===c&&(c=t.length-1),c-l<=r/4&&p.length!==i.length&&(p=i,l*=2,c*=2);var f,m,g,x=null,v=1/r;if(c-l>=r/4){for(var b=c;b>=l;b--)f=p[b],m=(Math.log(f)-Math.log(h))/(Math.log(d)-Math.log(h)),g=f,null===x?x={pixelCoord:m,idealPixelCoord:m}:Math.abs(m-x.pixelCoord)>=v?x={pixelCoord:m,idealPixelCoord:x.idealPixelCoord-v}:g=null,g&&s.push(g);s.reverse()}else{var y=n.computeTickSize(h,d,r),w={min:h,max:d,tickSize:y};s=e.plot.linearTickGenerator(w)}return s},a=function(e,t){var i=e.min,n=e.max;return i<=0&&n<(i=null===e.datamin?e.min=.1:d(t,e))&&(e.max=null!==e.datamax?e.datamax:e.options.max,e.options.offset.below=0,e.options.offset.above=0),i},r=function(t,i,n){var o=t>0?Math.floor(Math.log(t)/Math.LN10):0;if(n)return o>=-4&&o<=7?e.plot.defaultTickFormatter(t,i,n):e.plot.expRepTickFormatter(t,i,n);if(o>=-4&&o<=7){var a=o<0?t.toFixed(-o):t.toFixed(o+2);if(-1!==a.indexOf(".")){for(var r=a.lastIndexOf("0");r===a.length-1;)r=(a=a.slice(0,-1)).lastIndexOf("0");a.indexOf(".")===a.length-1&&(a=a.slice(0,-1))}return a}return e.plot.expRepTickFormatter(t,i)},s=function(e){return e0}e.plot.plugins.push({init:function(t){t.hooks.processOptions.push((function(t){e.each(t.getAxes(),(function(e,i){var n=i.options;"log"===n.mode?(i.tickGenerator=function(e){return o(t,e,11)},"function"!=typeof i.options.tickFormatter&&(i.options.tickFormatter=r),i.options.transform=n.inverted?u:s,i.options.inverseTransform=n.inverted?p:l,i.options.autoScaleMargin=0,t.hooks.setRange.push(h)):n.inverted&&(i.options.transform=c,i.options.inverseTransform=c)}))}))},options:{xaxis:{}},name:"log",version:"0.1"}),e.plot.logTicksGenerator=o,e.plot.logTickFormatter=r}(jQuery),function(e){var t=function(e,t,i,n,o){var a=n*Math.sqrt(Math.PI)/2;e.rect(t-a,i-a,a+a,a+a)},i=function(e,t,i,n,o){var a=n*Math.sqrt(Math.PI)/2;e.rect(t-a,i-a,a+a,a+a)},n=function(e,t,i,n,o){var a=n*Math.sqrt(Math.PI/2);e.moveTo(t-a,i),e.lineTo(t,i-a),e.lineTo(t+a,i),e.lineTo(t,i+a),e.lineTo(t-a,i),e.lineTo(t,i-a)},o=function(e,t,i,n,o){var a=n*Math.sqrt(2*Math.PI/Math.sin(Math.PI/3)),r=a*Math.sin(Math.PI/3);e.moveTo(t-a/2,i+r/2),e.lineTo(t+a/2,i+r/2),o||(e.lineTo(t,i-r/2),e.lineTo(t-a/2,i+r/2),e.lineTo(t+a/2,i+r/2))},a=function(e,t,i,n,o,a){o||(e.moveTo(t+n,i),e.arc(t,i,n,0,2*Math.PI,!1))},r={square:t,rectangle:i,diamond:n,triangle:o,cross:function(e,t,i,n,o){var a=n*Math.sqrt(Math.PI)/2;e.moveTo(t-a,i-a),e.lineTo(t+a,i+a),e.moveTo(t-a,i+a),e.lineTo(t+a,i-a)},ellipse:a,plus:function(e,t,i,n,o){var a=n*Math.sqrt(Math.PI/2);e.moveTo(t-a,i),e.lineTo(t+a,i),e.moveTo(t,i+a),e.lineTo(t,i-a)}};t.fill=!0,i.fill=!0,n.fill=!0,o.fill=!0,a.fill=!0,e.plot.plugins.push({init:function(e){e.drawSymbol=r},name:"symbols",version:"1.0"})}(jQuery),function(e){"use strict";function t(e,t,i,n){if(!0===t.flatdata){var o=t.start||0,a="number"==typeof t.step?t.step:1;n.pointsize=2;for(var r=0,s=0;rt.left&&s.leftt.top&&s.topt.left&&o.leftt.top&&o.top(m=e.plot.saturated.saturate(h.c2p(m)))){var x=f;f=m,m=x}if(d.zoomRange){if(m-fd.zoomRange[1])continue}var v=e.plot.saturated.saturate(g.below-(h.min-f)),b=e.plot.saturated.saturate(g.above-(h.max-m));d.offset={below:v,above:b}}}t.setupGrid(!0),t.draw(),i.preventEvent||t.getPlaceholder().trigger("plotzoom",[t,i])},t.pan=function(n){var o={x:+n.left,y:+n.top};isNaN(o.x)&&(o.x=0),isNaN(o.y)&&(o.y=0),e.each(n.axes||t.getAxes(),(function(e,t){var a=t.options,r=o[t.direction];if((a.axisPan||!n.axes)&&(a.plotPan||n.axes)){var s=t.p2c(a.panRange[0])-t.p2c(t.min),l=t.p2c(a.panRange[1])-t.p2c(t.max);if(void 0!==a.panRange[0]&&r>=l&&(r=l),void 0!==a.panRange[1]&&r<=s&&(r=s),0!==r){var c=i.saturate(t.c2p(t.p2c(t.min)+r)-t.c2p(t.p2c(t.min))),u=i.saturate(t.c2p(t.p2c(t.max)+r)-t.c2p(t.p2c(t.max)));isFinite(c)||(c=0),isFinite(u)||(u=0),a.offset={below:i.saturate(c+(a.offset.below||0)),above:i.saturate(u+(a.offset.above||0))}}}})),t.setupGrid(!0),t.draw(),n.preventEvent||t.getPlaceholder().trigger("plotpan",[t,n])},t.recenter=function(i){e.each(i.axes||t.getAxes(),(function(e,t){i.axes?"x"===this.direction?t.options.offset={below:0}:"y"===this.direction&&(t.options.offset={above:0}):t.options.offset={below:0,above:0}})),t.setupGrid(!0),t.draw()};var P=null,C={x:0,y:0};t.smartPan=function(e,n,a,r,s){var l,c,u,p,h,d,m=!!s||function(e){return Math.abs(e.y)=o||Math.abs(e.x)=o}(e),g=t.getAxes();(function(e){return Math.abs(e.x)>0&&Math.abs(e.y)>0})(e=s?function(e){switch(!P&&Math.max(Math.abs(e.x),Math.abs(e.y))>=o&&(P=Math.abs(e.x)=o?{x:0,y:e.y}:Math.abs(e.y)=o?{x:e.x,y:0}:e}(e))&&(n.diagMode=!0),m&&!0===n.diagMode&&(n.diagMode=!1,function(e,t,i){var n;Object.keys(e).forEach((function(o){n=e[o],0===i[n.direction]&&(n.options.offset.below=t[o].navigationOffset.below,n.options.offset.above=t[o].navigationOffset.above)}))}(g,n,e)),f=m?{start:{x:n.startPageX-t.offset().left+t.getPlotOffset().left,y:n.startPageY-t.offset().top+t.getPlotOffset().top},end:{x:n.startPageX-e.x-t.offset().left+t.getPlotOffset().left,y:n.startPageY-e.y-t.offset().top+t.getPlotOffset().top}}:{start:{x:n.startPageX-t.offset().left+t.getPlotOffset().left,y:n.startPageY-t.offset().top+t.getPlotOffset().top},end:!1},isNaN(e.x)&&(e.x=0),isNaN(e.y)&&(e.y=0),a&&(g=a),Object.keys(g).forEach((function(t){if(c=g[t],u=c.min,p=c.max,l=c.options,d=e[c.direction],h=C[c.direction],(l.axisPan||!a)&&(a||l.plotPan)){var n=h+c.p2c(l.panRange[0])-c.p2c(u),o=h+c.p2c(l.panRange[1])-c.p2c(p);if(void 0!==l.panRange[0]&&d>=o&&(d=o),void 0!==l.panRange[1]&&d<=n&&(d=n),0!==d){var r=i.saturate(c.c2p(c.p2c(u)-(h-d))-c.c2p(c.p2c(u))),s=i.saturate(c.c2p(c.p2c(p)-(h-d))-c.c2p(c.p2c(p)));isFinite(r)||(r=0),isFinite(s)||(s=0),c.options.offset.below=i.saturate(r+(c.options.offset.below||0)),c.options.offset.above=i.saturate(s+(c.options.offset.above||0))}}})),C=e,t.setupGrid(!0),t.draw(),r||t.getPlaceholder().trigger("plotpan",[t,e,a,n])},t.smartPan.end=function(){f=null,P=null,C={x:0,y:0},t.triggerRedrawOverlay()},t.getTouchedAxis=function(e,i){var n=t.getPlaceholder().offset();return n.left=e-n.left,n.top=i-n.top,t.getXAxes().concat(t.getYAxes()).filter((function(e){var t=e.box;if(void 0!==t)return n.left>t.left&&n.leftt.top&&n.top=t.length?null:t[e.fillBetween]:null}(t,e.getData());if(n){for(var o,a,r,s,l,c,u,p,h=i.pointsize,d=i.points,f=n.datapoints.pointsize,m=n.datapoints.points,g=[],x=t.lines.show,v=h>2&&i.format[2].y,b=x&&t.lines.steps,y=!0,w=0,k=0;!(w>=d.length);){if(u=g.length,null==d[w]){for(p=0;p=m.length){if(!x)for(p=0;ps){if(x&&w>0&&null!=d[w-h]){for(r=a+(d[w-h+1]-a)*(s-o)/(d[w-h]-o),g.push(s),g.push(r),p=2;p0&&null!=m[k-f]&&(c=l+(m[k-f+1]-l)*(o-s)/(m[k-f]-s)),w+=h}y=!1,u!==g.length&&v&&(g[u+2]=c)}if(b&&u!==g.length&&u>0&&null!==g[u]&&g[u]!==g[u-h]&&g[u+1]!==g[u-h+1]){for(p=0;p=e.min&&n<=e.max&&t.push([n,i])}return t.sort((function(e,t){return e[0]-t[0]})),t}function n(t,n,o){if("categories"===t[n].options.mode){if(!t[n].categories){var a={},r=t[n].options.categories||{};if(e.isArray(r))for(var s=0;st&&(t=e[i]);return t+1}(i),l=0;l2&&(t.bars.horizontal?i.format[2].x:i.format[2].y);n&&!o&&function(e,t){for(var i=[],n=0;n=m.length);){if(h=v.length,null==m[S]){for(d=0;d=x.length){if(!b)for(d=0;dc){if(b&&S>0&&null!=m[S-f]){for(l=s+(m[S-f+M]-s)*(c-r)/(m[S-f+T]-r),v.push(c),v.push(l+u),d=2;d0&&null!=x[P-g]&&(p=u+(x[P-g+M]-u)*(r-c)/(x[P-g+T]-c)),v[h+M]+=p,S+=f}k=!1,h!==v.length&&n&&(v[h+2]+=p)}if(w&&h!==v.length&&h>0&&null!==v[h]&&v[h]!==v[h-f]&&v[h+1]!==v[h-f+1]){for(d=0;dt)&&(!function(e,t,i,n){var o=e.offset(),r={left:0,top:0},s=a(t)/i.prevDistance,c=a(t);r.left=l(t,"pinch").x-o.left,r.top=l(t,"pinch").y-o.top,e.zoom({center:r,amount:s,axes:n.touchedAxis}),i.prevDistance=c}(i,e,f,m),f.zoomEnable=!0),d=null}),1e3/60))},end:function(e){d&&(clearTimeout(d),d=null),b(e,"pinch",f),f.prevDistance=null}},h={recenterPlot:function(t){t&&t.detail&&"touchstart"===t.detail.type&&function(t,i,o,a){if(function(e,t,i){var o=e.getTouchedAxis(t.detail.firstTouch.x,t.detail.firstTouch.y);void 0!==o[0]&&(i.prevTouchedAxis=o[0].direction);void 0!==(o=e.getTouchedAxis(t.detail.secondTouch.x,t.detail.secondTouch.y))[0]&&(i.touchedAxis=o,i.currentTouchedAxis=o[0].direction);n(i)&&(i.touchedAxis=null,i.prevTouchedAxis="none",i.currentTouchedAxis="none")}(t,i,a),"x"===a.currentTouchedAxis&&"x"===a.prevTouchedAxis||"y"===a.currentTouchedAxis&&"y"===a.prevTouchedAxis||"none"===a.currentTouchedAxis&&"none"===a.prevTouchedAxis){var r;t.recenter({axes:a.touchedAxis}),r=a.touchedAxis?new e.Event("re-center",{detail:{axisTouched:a.touchedAxis}}):new e.Event("re-center",{detail:i}),t.getPlaceholder().trigger(r)}}(i,t,0,m)}},!0!==c.pan.enableTouch&&!0!==c.zoom.enableTouch||(i.hooks.bindEvents.push((function(e,t){var i=e.getOptions();i.zoom.interactive&&i.zoom.enableTouch&&(t[0].addEventListener("pinchstart",p.start,!1),t[0].addEventListener("pinchdrag",p.drag,!1),t[0].addEventListener("pinchend",p.end,!1)),i.pan.interactive&&i.pan.enableTouch&&(t[0].addEventListener("panstart",u.start,!1),t[0].addEventListener("pandrag",u.drag,!1),t[0].addEventListener("panend",u.end,!1)),i.recenter.interactive&&i.recenter.enableTouch&&t[0].addEventListener("doubletap",h.recenterPlot,!1)})),i.hooks.shutdown.push((function(e,t){t[0].removeEventListener("panstart",u.start),t[0].removeEventListener("pandrag",u.drag),t[0].removeEventListener("panend",u.end),t[0].removeEventListener("pinchstart",p.start),t[0].removeEventListener("pinchdrag",p.drag),t[0].removeEventListener("pinchend",p.end),t[0].removeEventListener("doubletap",h.recenterPlot)})))}function n(e){return!e.touchedAxis||0===e.touchedAxis.length}function o(e,t,i,n){var o,a=l(e,t);switch(n.navigationConstraint){case"unconstrained":n.touchedAxis=null,i.prevTapPosition={x:i.prevPanPosition.x,y:i.prevPanPosition.y},i.prevPanPosition={x:a.x,y:a.y};break;case"axisConstrained":o=n.touchedAxis[0].direction,n.currentTouchedAxis=o,i.prevTapPosition[o]=i.prevPanPosition[o],i.prevPanPosition[o]=a[o]}}function a(e){var t,i,n,o,a=e.detail.touches[0],r=e.detail.touches[1];return t=a.pageX,i=a.pageY,n=r.pageX,o=r.pageY,Math.sqrt((t-n)*(t-n)+(i-o)*(i-o))}function r(e,t,i,n){var o=l(e,t);switch(n.navigationConstraint){case"unconstrained":i.prevPanPosition.x=o.x,i.prevPanPosition.y=o.y;break;case"axisConstrained":i.prevPanPosition[n.currentTouchedAxis]=o[n.currentTouchedAxis]}}function s(e,t,i){var n=l(e,t);return{x:n.x-i.prevPanPosition.x,y:n.y-i.prevPanPosition.y}}function l(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}}e.plot.plugins.push({init:function(e){e.hooks.processOptions.push(i)},options:{zoom:{enableTouch:!1},pan:{enableTouch:!1,touchMode:"manual"},recenter:{enableTouch:!0}},name:"navigateTouch",version:"0.3"})}(jQuery),function(e){"use strict";var t=e.plot.browser,i="click",n="hover";e.plot.plugins.push({init:function(o){var a,r=[];function s(e){var t=o.getOptions(),i=new CustomEvent("mouseevent");return i.pageX=e.detail.changedTouches[0].pageX,i.pageY=e.detail.changedTouches[0].pageY,i.clientX=e.detail.changedTouches[0].clientX,i.clientY=e.detail.changedTouches[0].clientY,t.grid.hoverable&&l(i,n,30),!1}function l(e,t,i){var n=o.getData();if(void 0!==e&&n.length>0&&void 0!==n[0].xaxis.c2p&&void 0!==n[0].yaxis.c2p){var a=t+"able";d("plot"+t,e,(function(e){return!1!==n[e][a]}),i)}}function c(e){a=e,o.getPlaceholder()[0].lastMouseMoveEvent=e,l(e,n)}function u(e){a=void 0,o.getPlaceholder()[0].lastMouseMoveEvent=void 0,d("plothover",e,(function(e){return!1}))}function p(e){l(e,i)}function h(){o.unhighlight(),o.getPlaceholder().trigger("plothovercleanup")}function d(e,i,n,a){var s=o.getOptions(),l=o.offset(),c=t.getPageXY(i),u=c.X-l.left,p=c.Y-l.top,h=o.c2p({left:u,top:p}),d=void 0!==a?a:s.grid.mouseActiveRadius;h.pageX=c.X,h.pageY=c.Y;var g=o.findNearbyItems(u,p,n,d),x=g[0];for(let e=1;es.max||rl.max)){var u=t.points.radius+t.points.lineWidth/2;n.lineWidth=u,n.strokeStyle=c;var p=1.5*u;a=s.p2c(a),r=l.p2c(r),n.beginPath();var h=t.points.symbol;"circle"===h?n.arc(a,r,p,0,2*Math.PI,!1):"string"==typeof h&&o.drawSymbol&&o.drawSymbol[h]&&o.drawSymbol[h](n,a,r,p,!1),n.closePath(),n.stroke()}}function w(t,i,n){var o,a="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),r=a,s=t.bars.barWidth[0]||t.bars.barWidth;switch(t.bars.align){case"left":o=0;break;case"right":o=-s;break;default:o=-s/2}n.lineWidth=t.bars.lineWidth,n.strokeStyle=a;var l=t.bars.fillTowards||0,c=l>t.yaxis.min?Math.min(t.yaxis.max,l):t.yaxis.min;e.plot.drawSeries.drawBar(i[0],i[1],i[2]||c,o,o+s,(function(){return r}),t.xaxis,t.yaxis,n,t.bars.horizontal,t.bars.lineWidth)}o.hooks.bindEvents.push((function(e,t){var i=e.getOptions();(i.grid.hoverable||i.grid.clickable)&&(t[0].addEventListener("touchevent",h,!1),t[0].addEventListener("tap",s,!1)),i.grid.clickable&&t.bind("click",p),i.grid.hoverable&&(t.bind("mousemove",c),t.bind("mouseleave",u))})),o.hooks.shutdown.push((function(e,t){t[0].removeEventListener("tap",s),t[0].removeEventListener("touchevent",h),t.unbind("mousemove",c),t.unbind("mouseleave",u),t.unbind("click",p),r=[]})),o.hooks.processOptions.push((function(e,t){e.highlight=f,e.unhighlight=m,(t.grid.hoverable||t.grid.clickable)&&(e.hooks.drawOverlay.push(b),e.hooks.processDatapoints.push(x),e.hooks.setupGrid.push(v)),a=e.getPlaceholder()[0].lastMouseMoveEvent}))},options:{grid:{hoverable:!1,clickable:!1}},name:"hover",version:"0.1"})}(jQuery),function(e){"use strict";function t(e,t){var i,n={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?n.isUnsupportedGesture=!0:n.isUnsupportedGesture=!1}(t),i.dispatchEvent(new CustomEvent("touchevent",{detail:t})),m(t)?a(t,"pinch"):(a(t,"pan"),f(t)||(function(e){var t=(new Date).getTime(),i=t-n.prevTapTime;if(i>=0&&i<500&&d(n.prevTap.x,n.prevTap.y,n.currentTap.x,n.currentTap.y)<20)return e.firstTouch=n.prevTap,e.secondTouch=n.currentTap,!0;return n.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){n.prevTap={x:n.currentTap.x,y:n.currentTap.y},p(e),function(e){n.tapStartTime=(new Date).getTime(),n.interceptedLongTap=!1,n.currentTapStart={x:e.touches[0].pageX,y:e.touches[0].pageY},n.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),i.dispatchEvent(new CustomEvent("panstart",{detail:e}))},touchmove:function(e){h(e),p(e),function(e){n.currentTapEnd={x:e.touches[0].pageX,y:e.touches[0].pageY}}(e),n.isUnsupportedGesture||i.dispatchEvent(new CustomEvent("pandrag",{detail:e}))},touchend:function(e){h(e),f(e)?(i.dispatchEvent(new CustomEvent("pinchend",{detail:e})),i.dispatchEvent(new CustomEvent("panstart",{detail:e}))):function(e){return e.touches&&0===e.touches.length}(e)&&i.dispatchEvent(new CustomEvent("panend",{detail:e}))}},s={touchstart:function(e){i.dispatchEvent(new CustomEvent("pinchstart",{detail:e}))},touchmove:function(e){h(e),n.twoTouches=m(e),n.isUnsupportedGesture||i.dispatchEvent(new CustomEvent("pinchdrag",{detail:e}))},touchend:function(e){h(e)}},l={onDoubleTap:function(e){h(e),i.dispatchEvent(new CustomEvent("doubletap",{detail:e}))}},c={touchstart:function(e){c.waitForLongTap(e)},touchmove:function(e){},touchend:function(e){n.longTapTriggerId&&(clearTimeout(n.longTapTriggerId),n.longTapTriggerId=null)},isLongTap:function(e){return(new Date).getTime()-n.tapStartTime>=1500&&!n.interceptedLongTap&&d(n.currentTapStart.x,n.currentTapStart.y,n.currentTapEnd.x,n.currentTapEnd.y)<20&&(n.interceptedLongTap=!0,!0)},waitForLongTap:function(e){n.longTapTriggerId||(n.longTapTriggerId=setTimeout((function(){c.isLongTap(e)&&i.dispatchEvent(new CustomEvent("longtap",{detail:e})),n.longTapTriggerId=null}),1500))}},u={touchstart:function(e){n.tapStartTime=(new Date).getTime()},touchmove:function(e){},touchend:function(e){u.isTap(e)&&(i.dispatchEvent(new CustomEvent("tap",{detail:e})),h(e))},isTap:function(e){return(new Date).getTime()-n.tapStartTime<=125&&d(n.currentTapStart.x,n.currentTapStart.y,n.currentTapEnd.x,n.currentTapEnd.y)<20}};function p(e){n.currentTap={x:e.touches[0].pageX,y:e.touches[0].pageY}}function h(t){n.isUnsupportedGesture||(t.preventDefault(),e.getOptions().propagateSupportedGesture||t.stopPropagation())}function d(e,t,i,n){return Math.sqrt((e-i)*(e-i)+(t-n)*(t-n))}function f(e){return n.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){i=t[0],t[0].addEventListener("touchstart",o,!1),t[0].addEventListener("touchmove",o,!1),t[0].addEventListener("touchend",o,!1)})),e.hooks.shutdown.push((function(e,t){t[0].removeEventListener("touchstart",o),t[0].removeEventListener("touchmove",o),t[0].removeEventListener("touchend",o),n.longTapTriggerId&&(clearTimeout(n.longTapTriggerId),n.longTapTriggerId=null)})))}jQuery.plot.plugins.push({init:function(e){e.hooks.processOptions.push(t)},options:{propagateSupportedGesture:!1},name:"navigateTouch",version:"0.3"})}(),function(e){"use strict";var t=e.plot.saturated.floorInBase,i=function(e,t){var i=new e(t),n=i.setTime.bind(i);i.update=function(e){n(e),e=Math.round(1e3*e)/1e3,this.microseconds=1e3*(e-Math.floor(e))};var o=i.getTime.bind(i);return i.getTime=function(){return o()+this.microseconds/1e3},i.setTime=function(e){this.update(e)},i.getMicroseconds=function(){return this.microseconds},i.setMicroseconds=function(e){var t=o()+e/1e3;this.update(t)},i.setUTCMicroseconds=function(e){this.setMicroseconds(e)},i.getUTCMicroseconds=function(){return this.getMicroseconds()},i.microseconds=null,i.microEpoch=null,i.update(t),i};function n(e,t,i,n){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,i){var n,o=1e3*e+t;if(i<6&&i>0){var a=parseFloat("1e"+(i-6));n=("00000"+(o=Math.round(Math.round(o*a)/a))).slice(-6,-(6-i))}else n=("00000"+(o=Math.round(o))).slice(-6);return n},s=[],l=!1,c=e.getHours(),u=c<12;i||(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),n||(n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),o=c>12?c-12:0===c?12:c;for(var p=-1,h=0;h0)p=Number(d);else if(l){switch(d){case"a":d=""+n[e.getDay()];break;case"b":d=""+i[e.getMonth()];break;case"d":d=a(e.getDate());break;case"e":d=a(e.getDate()," ");break;case"h":case"H":d=a(c);break;case"I":d=a(o);break;case"l":d=a(o," ");break;case"m":d=a(e.getMonth()+1);break;case"M":d=a(e.getMinutes());break;case"q":d=""+(Math.floor(e.getMonth()/3)+1);break;case"S":d=a(e.getSeconds());break;case"s":d=""+r(e.getMilliseconds(),e.getMicroseconds(),p);break;case"y":d=a(e.getFullYear()%100);break;case"Y":d=""+e.getFullYear();break;case"p":d=u?"am":"pm";break;case"P":d=u?"AM":"PM";break;case"w":d=""+e.getDay()}s.push(d),l=!1}else"%"===d?l=!0:s.push(d)}return s.join("")}function o(e){function t(e,t,i,n){e[t]=function(){return i[n].apply(i,arguments)}}var i={date:e};void 0!==e.strftime&&t(i,"strftime",e,"strftime"),t(i,"getTime",e,"getTime"),t(i,"setTime",e,"setTime");for(var n=["Date","Day","FullYear","Hours","Minutes","Month","Seconds","Milliseconds","Microseconds"],o=0;on?e=n:e<-n&&(e=-n),"browser"===t.timezone)return i(Date,e);if(t.timezone&&"utc"!==t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var a=i(timezoneJS.Date,e);return a.setTimezone(t.timezone),a.setTime(e),a}return o(i(Date,e))}return o(i(Date,e))}var r={microsecond:1e-6,millisecond:.001,second:1,minute:60,hour:3600,day:86400,month:2592e3,quarter:7776e3,year:525949.2*60},s={microsecond:.001,millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},l={microsecond:1,millisecond:1e3,second:1e6,minute:6e7,hour:36e8,day:864e8,month:2592e9,quarter:7776e9,year:31556951999999.996},c=[[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"]],u=c.concat([[3,"month"],[6,"month"],[1,"year"]]),p=c.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);function h(e){var i,n=e.options,o=[],c=a(e.min,n),h=0,d=n.tickSize&&"quarter"===n.tickSize[1]||n.minTickSize&&"quarter"===n.minTickSize[1]?p:u;i="seconds"===n.timeBase?r:"microseconds"===n.timeBase?l:s,null!==n.minTickSize&&void 0!==n.minTickSize&&(h="number"==typeof n.tickSize?n.tickSize:n.minTickSize[0]*i[n.minTickSize[1]]);for(var f=0;f=h);++f);var m=d[f][0],g=d[f][1];if("year"===g){if(null!==n.minTickSize&&void 0!==n.minTickSize&&"year"===n.minTickSize[1])m=Math.floor(n.minTickSize[0]);else{var x=parseFloat("1e"+Math.floor(Math.log(e.delta/i.year)/Math.LN10)),v=e.delta/i.year/x;m=v<1.5?1:v<3?2:v<7.5?5:10,m*=x}m<1&&(m=1)}e.tickSize=n.tickSize||[m,g];var b=e.tickSize[0],y=b*i[g=e.tickSize[1]];"microsecond"===g?c.setMicroseconds(t(c.getMicroseconds(),b)):"millisecond"===g?c.setMilliseconds(t(c.getMilliseconds(),b)):"second"===g?c.setSeconds(t(c.getSeconds(),b)):"minute"===g?c.setMinutes(t(c.getMinutes(),b)):"hour"===g?c.setHours(t(c.getHours(),b)):"month"===g?c.setMonth(t(c.getMonth(),b)):"quarter"===g?c.setMonth(3*t(c.getMonth()/3,b)):"year"===g&&c.setFullYear(t(c.getFullYear(),b)),y>=i.millisecond&&(y>=i.second?c.setMicroseconds(0):c.setMicroseconds(1e3*c.getMilliseconds())),y>=i.minute&&c.setSeconds(0),y>=i.hour&&c.setMinutes(0),y>=i.day&&c.setHours(0),y>=4*i.day&&c.setDate(1),y>=2*i.month&&c.setMonth(t(c.getMonth(),3)),y>=2*i.quarter&&c.setMonth(t(c.getMonth(),6)),y>=i.year&&c.setMonth(0);var w,k,T=0,M=Number.NaN;do{if(k=M,w=c.getTime(),M=n&&"seconds"===n.timeBase?w/1e3:n&&"microseconds"===n.timeBase?1e3*w:w,o.push(M),"month"===g||"quarter"===g)if(b<1){c.setDate(1);var S=c.getTime();c.setMonth(c.getMonth()+("quarter"===g?3:1));var P=c.getTime();c.setTime(M+T*i.hour+(P-S)*b),T=c.getHours(),c.setHours(0)}else c.setMonth(c.getMonth()+b*("quarter"===g?3:1));else"year"===g?c.setFullYear(c.getFullYear()+b):"seconds"===n.timeBase?c.setTime(1e3*(M+y)):"microseconds"===n.timeBase?c.setTime((M+y)/1e3):c.setTime(M+y)}while(M-1&&x++,h="%S.%"+x+"s"}else h=di?i:t}function p(e){var t=e.getOptions();return"smart"===t.selection.mode?i.currentMode:t.selection.mode}function h(e,o){var a=t.getPlaceholder().offset(),r=t.getPlotOffset();e.x=u(0,o.pageX-a.left-r.left,t.width()),e.y=u(0,o.pageY-a.top-r.top,t.height()),e!==i.first&&function(e){if(i.first){var t={x:e.x-i.first.x,y:e.y-i.first.y};Math.abs(t.x)a){var c=o;o=a,a=c}return{from:o,to:a,axis:n}}function g(){var e=t.getOptions().selection.minSize;return Math.abs(i.second.x-i.first.x)>=e&&Math.abs(i.second.y-i.first.y)>=e}t.clearSelection=f,t.setSelection=function(e,n){var o;"y"===p(t)?(i.first.x=0,i.second.x=t.width()):(o=m(e,"x"),i.first.x=o.axis.p2c(o.from),i.second.x=o.axis.p2c(o.to)),"x"===p(t)?(i.first.y=0,i.second.y=t.height()):(o=m(e,"y"),i.first.y=o.axis.p2c(o.from),i.second.y=o.axis.p2c(o.to)),i.show=!0,t.triggerRedrawOverlay(),!n&&g()&&c()},t.getSelection=l,t.hooks.bindEvents.push((function(e,t){null!=e.getOptions().selection.mode&&(e.addEventHandler("dragstart",r,t,0),e.addEventHandler("drag",a,t,0),e.addEventHandler("dragend",s,t,0))})),t.hooks.drawOverlay.push((function(t,n){if(i.show&&g()){var o=t.getPlotOffset(),a=t.getOptions();n.save(),n.translate(o.left,o.top);var r=e.color.parse(a.selection.color),s=a.selection.visualization,l=a.selection.displaySelectionDecorations,c=1;"fill"===s&&(c=.8),n.strokeStyle=r.scale("a",c).toString(),n.lineWidth=1,n.lineJoin=a.selection.shape,n.fillStyle=r.scale("a",.4).toString();var u=Math.min(i.first.x,i.second.x)+.5,h=u,d=Math.min(i.first.y,i.second.y)+.5,f=d,m=Math.abs(i.second.x-i.first.x)-1,x=Math.abs(i.second.y-i.first.y)-1;"x"===p(t)&&(x+=d,d=0),"y"===p(t)&&(m+=u,u=0),"fill"===s?(n.fillRect(u,d,m,x),n.strokeRect(u,d,m,x)):(n.fillRect(0,0,t.width(),t.height()),n.clearRect(u,d,m,x),l&&function(e,t,i,n,o,a,r,s){var l=15,c=Math.max(0,Math.min(l,n/2-2,o/2-2));e.fillStyle="#ffffff","xy"===s&&(e.beginPath(),e.moveTo(t,i+c),e.lineTo(t-3,i+c),e.lineTo(t-3,i-3),e.lineTo(t+c,i-3),e.lineTo(t+c,i),e.lineTo(t,i),e.closePath(),e.moveTo(t,i+o-c),e.lineTo(t-3,i+o-c),e.lineTo(t-3,i+o+3),e.lineTo(t+c,i+o+3),e.lineTo(t+c,i+o),e.lineTo(t,i+o),e.closePath(),e.moveTo(t+n,i+c),e.lineTo(t+n+3,i+c),e.lineTo(t+n+3,i-3),e.lineTo(t+n-c,i-3),e.lineTo(t+n-c,i),e.lineTo(t+n,i),e.closePath(),e.moveTo(t+n,i+o-c),e.lineTo(t+n+3,i+o-c),e.lineTo(t+n+3,i+o+3),e.lineTo(t+n-c,i+o+3),e.lineTo(t+n-c,i+o),e.lineTo(t+n,i+o),e.closePath(),e.stroke(),e.fill()),t=a,i=r,"x"===s&&(e.beginPath(),e.moveTo(t,i+l),e.lineTo(t,i-l),e.lineTo(t-3,i-l),e.lineTo(t-3,i+l),e.closePath(),e.moveTo(t+n,i+l),e.lineTo(t+n,i-l),e.lineTo(t+n+3,i-l),e.lineTo(t+n+3,i+l),e.closePath(),e.stroke(),e.fill()),"y"===s&&(e.beginPath(),e.moveTo(t-l,i),e.lineTo(t+l,i),e.lineTo(t+l,i-3),e.lineTo(t-l,i-3),e.closePath(),e.moveTo(t-l,i+o),e.lineTo(t+l,i+o),e.lineTo(t+l,i+o+3),e.lineTo(t-l,i+o+3),e.closePath(),e.stroke(),e.fill())}(n,u,d,m,x,h,f,p(t))),n.restore()}})),t.hooks.shutdown.push((function(e,t){t.unbind("dragstart",r),t.unbind("drag",a),t.unbind("dragend",s)}))},options:{selection:{mode:null,visualization:"focus",displaySelectionDecorations:!0,color:"#888888",shape:"round",minSize:5}},name:"selection",version:"1.1"})}(jQuery),function(e){"use strict";var t=1,i=e.plot.browser,n=i.getPixelRatio;function o(e,o){var u=e.filter(a);t=n(o.getContext("2d"));var p=u.map((function(e){var t=new Image,n=new Promise(function(e,t){return e.sourceDescription='',e.sourceComponent=t,function(n,o){e.onload=function(t){e.successfullyLoaded=!0,n(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),n(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),n(e)},function(e,t){"CANVAS"===e.tagName&&(n=e,t.src=n.toDataURL("image/png"));var n;"svg"===e.tagName&&function(e,t){i.isSafari()||i.isMobileSafari()?function(e,t){function i(e){var t="";const i=new Uint8Array(e),n=16384;for(var o=0;oe[l].genLeft&&(o=e[l].genLeft),a>e[l].genTop&&(a=e[l].genTop);for(l=1;l',"",i.innerHTML,""].join("\n")}function l(e){var t="";return e.match(/^]+xmlns="http:\/\/www\.w3\.org\/2000\/svg"/)||(t=e.replace(/^]+"http:\/\/www\.w3\.org\/1999\/xlink"/)||(t=e.replace(/^\r\n'+t}function c(){return-100}e.plot.composeImages=o,e.plot.plugins.push({init:function(e){e.composeImages=o},name:"composeImages",version:"1.0"})}(jQuery),function(e){function t(e){var t="",i=e.name,n=e.xPos,o=e.yPos,a=e.fillColor,r=e.strokeColor,s=e.strokeWidth;switch(i){case"circle":default:t='';break;case"diamond":t='';break;case"cross":t='';break;case"rectangle":t='';break;case"plus":t='';break;case"bar":t='';break;case"area":t='';break;case"line":t=''}return t}var i='';function n(e,t){for(var i in e)if(e.hasOwnProperty(i)&&e[i]!==t[i])return!0;return!1}e.plot.plugins.push({init:function(o){o.hooks.setupGrid.push((function(o){var a=o.getOptions(),r=o.getData(),s=a.legend.labelFormatter,l=a.legend.legendEntries,c=a.legend.plotOffset,u=function(t,i,n){var o=i,a=t.reduce((function(e,t,i){var n=o?o(t.label,t):t.label;if(!t.hasOwnProperty("label")||n){var a={label:n||"Plot "+(i+1),color:t.color,options:{lines:t.lines,points:t.points,bars:t.bars}};e.push(a)}return e}),[]);if(n)if(e.isFunction(n))a.sort(n);else if("reverse"===n)a.reverse();else{var r="descending"!==n;a.sort((function(e,t){return e.label===t.label?0:e.label',d[f++]='',d[f++]=i;var b=0,y=[],w=window.getComputedStyle(document.querySelector("body"));for(u=0;uy[e]&&(y[e]=k+48):y[e]=k+48}for(u=0;u'+v.label+"",d[f++]=""+c+l+""}d[f++]="",null==x[0]&&(x=[x,x]),"n"===g.charAt(0)?m+="top:"+(x[1]+h.top)+"px;":"s"===g.charAt(0)&&(m+="bottom:"+(x[1]+h.bottom)+"px;"),"e"===g.charAt(1)?m+="right:"+(x[0]+h.right)+"px;":"w"===g.charAt(1)&&(m+="left:"+(x[0]+h.left)+"px;");var T=6;for(u=0;u'+d.join("")+"").appendTo(a)).css("width",T+"px"),M.css("height",S+"em"),M.css("pointerEvents","none"))}}(o,a,o.getPlaceholder(),u)}))},options:{legend:{show:!1,noColumns:1,labelFormatter:null,container:null,position:"ne",margin:5,sorted:null}},name:"legend",version:"1.0"})}(jQuery),function(e){function t(e,t,i){var n=e.getPlotOffset();if(i.images&&i.images.show)for(var o=i.datapoints.points,a=i.datapoints.pointsize,r=0;rp&&(s=p,p=c,c=s),u>h&&(s=h,h=u,u=s),"center"===i.images.anchor&&(c-=s=.5*(p-c)/(l.width-1),p+=s,u-=s=.5*(h-u)/(l.height-1),h+=s),!(c===p||u===h||c>=d.max||p<=d.min||u>=f.max||h<=f.min))){var m=0,g=0,x=l.width,v=l.height;cd.max&&(x+=(x-m)*(d.max-p)/(p-c),p=d.max),uf.max&&(g+=(g-v)*(f.max-h)/(h-u),h=f.max),(c=d.p2c(c))>(p=d.p2c(p))&&(s=p,p=c,c=s),(u=f.p2c(u))>(h=f.p2c(h))&&(s=h,h=u,u=s),s=t.globalAlpha,t.globalAlpha*=i.images.alpha,t.drawImage(l,m,g,x-m,v-g,c+n.left,u+n.top,p-c,h-u),t.globalAlpha=s}}}function i(e,t,i,n){t.images.show&&(n.format=[{required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0},{x:!0,number:!0,required:!0},{y:!0,number:!0,required:!0}])}e.plot.image={},e.plot.image.loadDataImages=function(t,i,n){var o=[],a=[],r=i.series.images.show;e.each(t,(function(t,i){(r||i.images.show)&&(i.data&&(i=i.data),e.each(i,(function(e,t){"string"==typeof t[0]&&(o.push(t[0]),a.push(t))})))})),e.plot.image.load(o,(function(t){e.each(a,(function(e,i){var n=i[0];t[n]&&(i[0]=t[n])})),n()}))},e.plot.image.load=function(t,i){var n=t.length,o={};0===n&&i({}),e.each(t,(function(t,a){var r=function(){--n,o[a]=this,0===n&&i(o)};e("").load(r).error(r).attr("src",a)}))},e.plot.plugins.push({init:function(e){e.hooks.processRawData.push(i),e.hooks.drawSeries.push(t)},options:{series:{images:{show:!1,alpha:1,anchor:"corner"}}},name:"image",version:"1.1"})}(jQuery),jQuery.plot.plugins.push({init:function(e){var t={x:-1,y:-1,locked:!1,highlighted:!1};function i(i){t.locked||-1!==t.x&&(t.x=-1,e.triggerRedrawOverlay())}function n(i){var n=e.offset();if(t.locked){var o=Math.max(0,Math.min(i.pageX-n.left,e.width())),a=Math.max(0,Math.min(i.pageY-n.top,e.height()));o>t.x-4&&ot.y-4&&a"+e+"
"+Math.round(t.percent)+"%"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};e.plot.plugins.push({init:function(t){var i=null,n=null,o=null,a=null,r=null,s=null,l=!1,c=null,u=[];function p(t,a,r){l||(l=!0,i=t.getCanvas(),n=e(i).parent(),o=t.getOptions(),t.setData(function(t){var i,n,a=0,r=0,s=0,l=o.series.pie.combine.color,c=[];for(i=0;io.series.pie.combine.threshold)&&c.push(e.extend(t[i],{data:[[1,n]],color:t[i].color,label:t[i].label,angle:n*Math.PI*2/a,percent:n/(a/100)}));s>1&&c.push({data:[[1,r]],color:l,label:o.series.pie.combine.label,angle:r*Math.PI*2/a,percent:r/(a/100)});return c}(t.getData())))}function h(t,i){if(n){var u=t.getPlaceholder().width(),p=t.getPlaceholder().height(),h=n.children().filter(".legend").children().width()||0;c=i,l=!1,a=Math.min(u,p/o.series.pie.tilt)/2,s=p/2+o.series.pie.offset.top,r=u/2,"auto"===o.series.pie.offset.left?(o.legend.position.match("w")?r+=h/2:r-=h/2,ru-a&&(r=u-a)):r+=o.series.pie.offset.left;var f=t.getData(),m=0;do{m>0&&(a*=.95),m+=1,g(),o.series.pie.tilt<=.8&&x()}while(!v()&&m<10);m>=10&&(g(),n.prepend("
Could not draw pie with labels contained inside canvas
")),t.setSeries&&t.insertLegend&&(t.setSeries(f),t.insertLegend())}function g(){c.clearRect(0,0,u,p),n.children().filter(".pieLabel, .pieLabelBackground").remove()}function x(){var e=o.series.pie.shadow.left,t=o.series.pie.shadow.top,i=o.series.pie.shadow.alpha,n=o.series.pie.radius>1?o.series.pie.radius:a*o.series.pie.radius;if(!(n>=u/2-e||n*o.series.pie.tilt>=p/2-t||n<=10)){c.save(),c.translate(e,t),c.globalAlpha=i,c.fillStyle="#000",c.translate(r,s),c.scale(1,o.series.pie.tilt);for(var l=1;l<=10;l++)c.beginPath(),c.arc(0,0,n,0,2*Math.PI,!1),c.fill(),n-=l;c.restore()}}function v(){var t,i=Math.PI*o.series.pie.startAngle,l=o.series.pie.radius>1?o.series.pie.radius:a*o.series.pie.radius;c.save(),c.translate(r,s),c.scale(1,o.series.pie.tilt),c.save();var h=i;for(t=0;t0){for(c.save(),c.lineWidth=o.series.pie.stroke.width,h=i,t=0;t1?o.series.pie.label.radius:a*o.series.pie.label.radius,c=0;c=100*o.series.pie.label.threshold&&!h(f[c],t,c))return!1;t+=f[c].angle}return!0;function h(t,i,a){if(0===t.data[0][1])return!0;var c,h=o.legend.labelFormatter,d=o.series.pie.label.formatter;c=h?h(t.label,t):t.label,d&&(c=d(c,t));var f=(i+t.angle+i)/2,m=r+Math.round(Math.cos(f)*l),g=s+Math.round(Math.sin(f)*l)*o.series.pie.tilt,x=""+c+"";n.append(x);var v=n.children("#pieLabel"+a),b=g-v.height()/2,y=m-v.width()/2;if(v.css("top",b),v.css("left",y),0-b>0||0-y>0||p-(b+v.height())<0||u-(y+v.width())<0)return!1;if(0!==o.series.pie.label.background.opacity){var w=o.series.pie.label.background.color;null==w&&(w=t.color);var k="top:"+b+"px;left:"+y+"px;";e("
").css("opacity",o.series.pie.label.background.opacity).insertBefore(v)}return!0}}();function m(e,t,i){e<=0||isNaN(e)||(i?c.fillStyle=t:(c.strokeStyle=t,c.lineJoin="round"),c.beginPath(),Math.abs(e-2*Math.PI)>1e-9&&c.moveTo(0,0),c.arc(0,0,l,h,h+e/2,!1),c.arc(0,0,l,h+e/2,h+e,!1),c.closePath(),h+=e,i?c.fill():c.stroke())}}}function d(e){if(o.series.pie.innerRadius>0){e.save();var t=o.series.pie.innerRadius>1?o.series.pie.innerRadius:a*o.series.pie.innerRadius;e.globalCompositeOperation="destination-out",e.beginPath(),e.fillStyle=o.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.fill(),e.closePath(),e.restore(),e.save(),e.beginPath(),e.strokeStyle=o.series.pie.stroke.color,e.arc(0,0,t,0,2*Math.PI,!1),e.stroke(),e.closePath(),e.restore()}}function f(e,t){for(var i=!1,n=-1,o=e.length,a=o-1;++n1?u.series.pie.radius:a*u.series.pie.radius,h=0;h1?t.series.pie.tilt=1:t.series.pie.tilt<0&&(t.series.pie.tilt=0))})),t.hooks.bindEvents.push((function(e,t){var i=e.getOptions();i.series.pie.show&&(i.grid.hoverable&&(t.unbind("mousemove").mousemove(m),t.bind("mouseleave",m)),i.grid.clickable&&t.unbind("click").click(g))})),t.hooks.shutdown.push((function(e,t){t.unbind("mousemove",m),t.unbind("mouseleave",m),t.unbind("click",g),u=[]})),t.hooks.processDatapoints.push((function(e,t,i,n){e.getOptions().series.pie.show&&p(e,t,i)})),t.hooks.drawOverlay.push((function(e,t){e.getOptions().series.pie.show&&function(e,t){var i=e.getOptions(),n=i.series.pie.radius>1?i.series.pie.radius:a*i.series.pie.radius;t.save(),t.translate(r,s),t.scale(1,i.series.pie.tilt);for(var o=0;o1e-9&&t.moveTo(0,0),t.arc(0,0,n,e.startAngle,e.startAngle+e.angle/2,!1),t.arc(0,0,n,e.startAngle+e.angle/2,e.startAngle+e.angle,!1),t.closePath(),t.fill())}d(t),t.restore()}(e,t)})),t.hooks.draw.push((function(e,t){e.getOptions().series.pie.show&&h(e,t)}))},options:t,name:"pie",version:"1.1"})}(jQuery),function(e,t,i){var n,o=[],a=e.resize=e.extend(e.resize,{}),r=!1,s="setTimeout",l="resize",c=l+"-special-event",u="pendingDelay",p="activeDelay",h="throttleWindow";function d(i){!0===r&&(r=i||1);for(var s=o.length-1;s>=0;s--){var p=e(o[s]);if(p[0]==t||p.is(":visible")){var h=p.width(),f=p.height(),m=p.data(c);!m||h===m.w&&f===m.h||(p.trigger(l,[m.w=h,m.h=f]),r=i||!0)}else(m=p.data(c)).w=0,m.h=0}null!==n&&(r&&(null==i||i-r<1e3)?n=t.requestAnimationFrame(d):(n=setTimeout(d,a[u]),r=!1))}a[u]=200,a[p]=20,a[h]=!0,e.event.special[l]={setup:function(){if(!a[h]&&this[s])return!1;var t=e(this);o.push(this),t.data(c,{w:t.width(),h:t.height()}),1===o.length&&(n=i,d())},teardown:function(){if(!a[h]&&this[s])return!1;for(var t=e(this),i=o.length-1;i>=0;i--)if(o[i]==this){o.splice(i,1);break}t.removeData(c),o.length||(r?cancelAnimationFrame(n):clearTimeout(n),n=null)},add:function(t){if(!a[h]&&this[s])return!1;var n;function o(t,o,a){var r=e(this),s=r.data(c)||{};s.w=o!==i?o:r.width(),s.h=a!==i?a:r.height(),n.apply(this,arguments)}if(e.isFunction(t))return n=t,o;n=t.handler,t.handler=o}},t.requestAnimationFrame||(t.requestAnimationFrame=t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e,i){return t.setTimeout((function(){e((new Date).getTime())}),a[p])}),t.cancelAnimationFrame||(t.cancelAnimationFrame=t.webkitCancelRequestAnimationFrame||t.mozCancelRequestAnimationFrame||t.oCancelRequestAnimationFrame||t.msCancelRequestAnimationFrame||clearTimeout)}(jQuery,window),jQuery.plot.plugins.push({init:function(e){function t(){var t=e.getPlaceholder();0!==t.width()&&0!==t.height()&&(e.resize(),e.setupGrid(),e.draw())}e.hooks.bindEvents.push((function(e,i){e.getPlaceholder().resize(t)})),e.hooks.shutdown.push((function(e,i){e.getPlaceholder().unbind("resize",t)}))},options:{},name:"resize",version:"1.0"}),function(e){e.plot.plugins.push({init:function(t){function i(t,i,n,o,a){var r,s,l,c,u,p=n.pointsize,h=e.extend({},i);h.datapoints={points:[],pointsize:p,format:n.format},h.label=null,h.color=a,h.threshold=null,h.originSeries=i,h.data=[];var d,f=n.points,m=i.lines.show,g=[],x=[];for(r=0;r0&&null!=f[r-p]){var v=s+(o-l)*(s-f[r-p])/(l-f[r-p+1]);for(u.push(v),u.push(o),d=2;d0){var b=e.inArray(i,t.getData());t.getData().splice(b+1,0,h)}}t.hooks.processDatapoints.push((function(t,n,o){n.threshold&&(n.threshold instanceof Array?(n.threshold.sort((function(e,t){return e.below-t.below})),e(n.threshold).each((function(e,a){i(t,n,o,a.below,a.color)}))):i(t,n,o,n.threshold.below,n.threshold.color))}))},options:{series:{threshold:null}},name:"threshold",version:"1.2"})}(jQuery),function(e){var t={tooltip:{show:!1,cssClass:"flotTip",content:"%s | X: %x | Y: %y",xDateFormat:null,yDateFormat:null,monthNames:null,dayNames:null,shifts:{x:10,y:20},defaultTheme:!0,snap:!0,lines:!1,clickTips:!1,onHover:function(e,t){},$compat:!1}};t.tooltipOpts=t.tooltip;var i=function(e){this.tipPosition={x:0,y:0},this.init(e)};i.prototype.init=function(t){var i=this,n=e.plot.plugins.length;if(this.plotPlugins=[],n)for(var o=0;o=o.x&&(a=u-1,s=u);if(-1!==s){var p={x:n.data[a][0],y:n.data[a][1]},h={x:n.data[s][0],y:n.data[s][1]},d=function(e,t,i,n,o,a,s){if(!s||(s=function(e,t,i,n,o,a){if(void 0!==i)return{x:i,y:t};if(void 0!==n)return{x:e,y:n};var r,s=-1/((a-n)/(o-i));return{x:r=(o*(e*s-t+n)+i*(e*-s+t-a))/(s*(o-i)+n-a),y:s*r-s*e+t}}(e,t,i,n,o,a),s.x>=Math.min(i,o)&&s.x<=Math.max(i,o)&&s.y>=Math.min(n,a)&&s.y<=Math.max(n,a))){var l=n-a,c=o-i,u=i*a-n*o;return Math.abs(l*e+c*t+u)/Math.sqrt(l*l+c*c)}var p=r(e,t,i,n),h=r(e,t,o,a);return p>h?h:p}(n.xaxis.p2c(o.x),n.yaxis.p2c(o.y),n.xaxis.p2c(p.x),n.yaxis.p2c(p.y),n.xaxis.p2c(h.x),n.yaxis.p2c(h.y),!1);if(de(window)[i.wfunc]()-o&&(t.x-=o,t.x=Math.max(t.x,0)),t.y-e(window).scrollTop()>e(window)[i.hfunc]()-a&&(t.y-=a),isNaN(t.x)?i.tipPosition.x=i.tipPosition.xPrev:(i.tipPosition.x=t.x,i.tipPosition.xPrev=t.x),isNaN(t.y)?i.tipPosition.y=i.tipPosition.yPrev:(i.tipPosition.y=t.y,i.tipPosition.yPrev=t.y)},t.showTooltip=function(e,n,o){var a=i.getDomElement(),r=i.stringFormat(i.tooltipOptions.content,e);""!==r&&(a.html(r),t.setTooltipPosition({x:i.tipPosition.x,y:i.tipPosition.y}),a.css({left:i.tipPosition.x+i.tooltipOptions.shifts.x,top:i.tipPosition.y+i.tooltipOptions.shifts.y}).show(),"function"==typeof i.tooltipOptions.onHover&&i.tooltipOptions.onHover(e,a))},t.hideTooltip=function(){i.getDomElement().hide().html("")},t.removeTooltip=function(){i.getDomElement().remove()}},i.prototype.getDomElement=function(){var t=e("
");return this.tooltipOptions&&this.tooltipOptions.cssClass&&0===(t=e("."+this.tooltipOptions.cssClass)).length&&((t=e("
").addClass(this.tooltipOptions.cssClass)).appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&t.css({background:"#fff","z-index":"1040",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),t},i.prototype.stringFormat=function(e,t){var i,n,o,a,r,s=/%s/,l=/%c/,c=/%lx/,u=/%ly/,p=/%x\.{0,1}(\d{0,})/,h=/%y\.{0,1}(\d{0,})/;if(void 0!==t.series.threshold?(i=t.datapoint[0],n=t.datapoint[1],o=t.datapoint[2]):void 0!==t.series.curvedLines?(i=t.datapoint[0],n=t.datapoint[1]):void 0!==t.series.lines&&t.series.lines.steps?(i=t.series.datapoints.points[2*t.dataIndex],n=t.series.datapoints.points[2*t.dataIndex+1],o=""):(i=t.series.data[t.dataIndex][0],n=t.series.data[t.dataIndex][1],o=t.series.data[t.dataIndex][2]),null===t.series.label&&t.series.originSeries&&(t.series.label=t.series.originSeries.label),"function"==typeof e&&(e=e(t.series.label,i,n,t)),"boolean"==typeof e&&!e)return"";if(o&&(e=e.replace("%ct",o)),void 0!==t.series.percent?a=t.series.percent:void 0!==t.series.percents&&(a=t.series.percents[t.dataIndex]),"number"==typeof a&&(e=this.adjustValPrecision(/%p\.{0,1}(\d{0,})/,e,a)),t.series.hasOwnProperty("pie")&&void 0!==t.series.data[0][1]&&(r=t.series.data[0][1]),"number"==typeof r&&(e=e.replace("%n",r)),e=void 0!==t.series.label?e.replace(s,t.series.label):e.replace(s,""),e=void 0!==t.series.color?e.replace(l,t.series.color):e.replace(l,""),e=this.hasAxisLabel("xaxis",t)?e.replace(c,t.series.xaxis.options.axisLabel):e.replace(c,""),e=this.hasAxisLabel("yaxis",t)?e.replace(u,t.series.yaxis.options.axisLabel):e.replace(u,""),this.isTimeMode("xaxis",t)&&this.isXDateFormat(t)&&(e=e.replace(p,this.timestampToDate(i,this.tooltipOptions.xDateFormat,t.series.xaxis.options))),this.isTimeMode("yaxis",t)&&this.isYDateFormat(t)&&(e=e.replace(h,this.timestampToDate(n,this.tooltipOptions.yDateFormat,t.series.yaxis.options))),"number"==typeof i&&(e=this.adjustValPrecision(p,e,i)),"number"==typeof n&&(e=this.adjustValPrecision(h,e,n)),void 0!==t.series.xaxis.ticks){var d;d=this.hasRotatedXAxisTicks(t)?"rotatedTicks":"ticks";var f=t.dataIndex+t.seriesIndex;for(var m in t.series.xaxis[d]){if(t.series.xaxis[d].hasOwnProperty(f)&&!this.isTimeMode("xaxis",t))(this.isCategoriesMode("xaxis",t)?t.series.xaxis[d][f].label:t.series.xaxis[d][f].v)===i&&(e=e.replace(p,t.series.xaxis[d][f].label.replace(/\$/g,"$$$$")))}}if(void 0!==t.series.yaxis.ticks)for(var g in t.series.yaxis.ticks){if(t.series.yaxis.ticks.hasOwnProperty(g))(this.isCategoriesMode("yaxis",t)?t.series.yaxis.ticks[g].label:t.series.yaxis.ticks[g].v)===n&&(e=e.replace(h,t.series.yaxis.ticks[g].label.replace(/\$/g,"$$$$")))}return void 0!==t.series.xaxis.tickFormatter&&(e=e.replace("%x",t.series.xaxis.tickFormatter(i,t.series.xaxis).replace(/\$/g,"$$"))),void 0!==t.series.yaxis.tickFormatter&&(e=e.replace("%y",t.series.yaxis.tickFormatter(n,t.series.yaxis).replace(/\$/g,"$$"))),e},i.prototype.isTimeMode=function(e,t){return void 0!==t.series[e].options.mode&&"time"===t.series[e].options.mode},i.prototype.isXDateFormat=function(e){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat},i.prototype.isYDateFormat=function(e){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat},i.prototype.isCategoriesMode=function(e,t){return void 0!==t.series[e].options.mode&&"categories"===t.series[e].options.mode},i.prototype.timestampToDate=function(t,i,n){var o=e.plot.dateGenerator(t,n);return e.plot.formatDate(o,i,this.tooltipOptions.monthNames,this.tooltipOptions.dayNames)},i.prototype.adjustValPrecision=function(e,t,i){var n;return null!==t.match(e)&&""!==RegExp.$1&&(n=RegExp.$1,i=i.toFixed(n),t=t.replace(e,i)),t},i.prototype.hasAxisLabel=function(t,i){return-1!==e.inArray("axisLabels",this.plotPlugins)&&void 0!==i.series[t].options.axisLabel&&i.series[t].options.axisLabel.length>0},i.prototype.hasRotatedXAxisTicks=function(t){return-1!==e.inArray("tickRotor",this.plotPlugins)&&void 0!==t.series.xaxis.rotatedTicks};e.plot.plugins.push({init:function(e){new i(e)},options:t,name:"tooltip",version:"0.8.5"})}(jQuery);