You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ac...@apache.org on 2012/12/31 07:05:22 UTC

[2/3] [#5518] Updated to VizGrimoireJS 0.2. Fixed CSS issues in radar viz inside Allura. Fixed path for global data config.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9213be0d/AlluraBitergiaMetrics/bitergiametrics/nf/metrics/vizgrimoire.min.js
----------------------------------------------------------------------
diff --git a/AlluraBitergiaMetrics/bitergiametrics/nf/metrics/vizgrimoire.min.js b/AlluraBitergiaMetrics/bitergiametrics/nf/metrics/vizgrimoire.min.js
index 4964861..113de8a 100644
--- a/AlluraBitergiaMetrics/bitergiametrics/nf/metrics/vizgrimoire.min.js
+++ b/AlluraBitergiaMetrics/bitergiametrics/nf/metrics/vizgrimoire.min.js
@@ -27,5 +27,5 @@
 .each(this.series,function(a){if(a.hide)return;c.each(g,function(b){a[b]&&a[b].show&&(this.extendRange(b,a),h=!0)},this),h||this.extendRange(this.options.defaultType,a)},this)},extendRange:function(a,b){this[a].extendRange&&this[a].extendRange(b,b.data,b[a],this[a]),this[a].extendYRange&&this[a].extendYRange(b.yaxis,b.data,b[a],this[a]),this[a].extendXRange&&this[a].extendXRange(b.xaxis,b.data,b[a],this[a])},calculateSpacing:function(){var a=this.axes,b=this.options,d=this.series,e=b.grid.labelMargin,f=this._text,g=a.x,h=a.x2,i=a.y,j=a.y2,k=b.grid.outlineWidth,l,m,n,o;c.each(a,function(a){a.calculateTicks(),a.calculateTextDimensions(f,b)}),o=f.dimensions(b.title,{size:b.fontSize*1.5},"font-size:1em;font-weight:bold;","flotr-title"),this.titleHeight=o.height,o=f.dimensions(b.subtitle,{size:b.fontSize},"font-size:smaller;","flotr-subtitle"),this.subtitleHeight=o.height;for(m=0;m<b.length;++m)d[m].points.show&&(k=Math.max(k,d[m].points.radius+d[m].points.lineWidth/2));var p=this.plotOf
 fset;g.options.margin===!1?(p.bottom=0,p.top=0):(p.bottom+=(b.grid.circular?0:g.used&&g.options.showLabels?g.maxLabel.height+e:0)+(g.used&&g.options.title?g.titleSize.height+e:0)+k,p.top+=(b.grid.circular?0:h.used&&h.options.showLabels?h.maxLabel.height+e:0)+(h.used&&h.options.title?h.titleSize.height+e:0)+this.subtitleHeight+this.titleHeight+k),i.options.margin===!1?(p.left=0,p.right=0):(p.left+=(b.grid.circular?0:i.used&&i.options.showLabels?i.maxLabel.width+e:0)+(i.used&&i.options.title?i.titleSize.width+e:0)+k,p.right+=(b.grid.circular?0:j.used&&j.options.showLabels?j.maxLabel.width+e:0)+(j.used&&j.options.title?j.titleSize.width+e:0)+k),p.top=Math.floor(p.top),this.plotWidth=this.canvasWidth-p.left-p.right,this.plotHeight=this.canvasHeight-p.bottom-p.top,g.length=h.length=this.plotWidth,i.length=j.length=this.plotHeight,i.offset=j.offset=this.plotHeight,g.setScale(),h.setScale(),i.setScale(),j.setScale()},draw:function(a){var c=this.ctx,d;b.fire(this.el,"flotr:beforedraw",[this
 .series,this]);if(this.series.length){c.save(),c.translate(this.plotOffset.left,this.plotOffset.top);for(d=0;d<this.series.length;d++)this.series[d].hide||this.drawSeries(this.series[d]);c.restore(),this.clip()}b.fire(this.el,"flotr:afterdraw",[this.series,this]),a&&a()},drawSeries:function(a){function b(a,b){var c=this.getOptions(a,b);this[b].draw(c)}var e=!1;a=a||this.series,c.each(d.graphTypes,function(c,d){a[d]&&a[d].show&&this[d]&&(e=!0,b.call(this,a,d))},this),e||b.call(this,a,this.options.defaultType)},getOptions:function(a,b){var c=a[b],e=this[b],f=a.xaxis,g=a.yaxis,h={context:this.ctx,width:this.plotWidth,height:this.plotHeight,fontSize:this.options.fontSize,fontColor:this.options.fontColor,textEnabled:this.textEnabled,htmlText:this.options.HtmlText,text:this._text,element:this.el,data:a.data,color:a.color,shadowSize:a.shadowSize,xScale:f.d2p,yScale:g.d2p,xInverse:f.p2d,yInverse:g.p2d};return h=d.merge(c,h),h.fillStyle=this.processColor(c.fillColor||a.color,{opacity:c.fillO
 pacity}),h},getEventPosition:function(c){var d=document,e=d.body,f=d.documentElement,g=this.axes,h=this.plotOffset,i=this.lastMousePos,j=b.eventPointer(c),k=j.x-i.pageX,l=j.y-i.pageY,m,n,o;return"ontouchstart"in this.el?(m=a.position(this.overlay),n=j.x-m.left-h.left,o=j.y-m.top-h.top):(m=this.overlay.getBoundingClientRect(),n=c.clientX-m.left-h.left-e.scrollLeft-f.scrollLeft,o=c.clientY-m.top-h.top-e.scrollTop-f.scrollTop),{x:g.x.p2d(n),x2:g.x2.p2d(n),y:g.y.p2d(o),y2:g.y2.p2d(o),relX:n,relY:o,dX:k,dY:l,absX:j.x,absY:j.y,pageX:j.x,pageY:j.y}},clickHandler:function(a){if(this.ignoreClick)return this.ignoreClick=!1,this.ignoreClick;b.fire(this.el,"flotr:click",[this.getEventPosition(a),this])},mouseMoveHandler:function(a){if(this.mouseDownMoveHandler)return;var c=this.getEventPosition(a);b.fire(this.el,"flotr:mousemove",[a,c,this]),this.lastMousePos=c},mouseDownHandler:function(a){if(this.mouseUpHandler)return;this.mouseUpHandler=c.bind(function(a){b.stopObserving(document,"mouseup",t
 his.mouseUpHandler),b.stopObserving(document,"mousemove",this.mouseDownMoveHandler),this.mouseDownMoveHandler=null,this.mouseUpHandler=null,b.fire(this.el,"flotr:mouseup",[a,this])},this),this.mouseDownMoveHandler=c.bind(function(c){var d=this.getEventPosition(c);b.fire(this.el,"flotr:mousemove",[a,d,this]),this.lastMousePos=d},this),b.observe(document,"mouseup",this.mouseUpHandler),b.observe(document,"mousemove",this.mouseDownMoveHandler),b.fire(this.el,"flotr:mousedown",[a,this]),this.ignoreClick=!1},drawTooltip:function(b,c,d,e){var f=this.getMouseTrack(),g="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;",h=e.position,i=e.margin,j=this.plotOffset;c!==null&&d!==null?(e.relative?(h.charAt(0)=="n"?g+="bottom:"+(i-j.top-d+this.canvasHeight)+"px;top:auto;":h.charAt(0)=="s"&&(g+="top:"+(i+j.top+d)+"px;bottom:auto;"),h.charAt(1)=="e"?g+="left:"+(i+j.left+c)+"px;right:auto;":h.charAt
 (1)=="w"&&(g+="right:"+(i-j.left-c+this.canvasWidth)+"px;left:auto;")):(h.charAt(0)=="n"?g+="top:"+(i+j.top)+"px;bottom:auto;":h.charAt(0)=="s"&&(g+="bottom:"+(i+j.bottom)+"px;top:auto;"),h.charAt(1)=="e"?g+="right:"+(i+j.right)+"px;left:auto;":h.charAt(1)=="w"&&(g+="left:"+(i+j.left)+"px;right:auto;")),f.style.cssText=g,a.empty(f),a.insert(f,b),a.show(f)):a.hide(f)},clip:function(a){var b=this.plotOffset,c=this.canvasWidth,e=this.canvasHeight;a=a||this.ctx,d.isIE&&d.isIE<9?(a.save(),a.fillStyle=this.processColor(this.options.ieBackgroundColor),a.fillRect(0,0,c,b.top),a.fillRect(0,0,b.left,e),a.fillRect(0,e-b.bottom,c,b.bottom),a.fillRect(c-b.right,0,b.right,e),a.restore()):(a.clearRect(0,0,c,b.top),a.clearRect(0,0,b.left,e),a.clearRect(0,e-b.bottom,c,b.bottom),a.clearRect(c-b.right,0,b.right,e))},_initMembers:function(){this._handles=[],this.lastMousePos={pageX:null,pageY:null},this.plotOffset={left:0,right:0,top:0,bottom:0},this.ignoreClick=!0,this.prevHit=null},_initGraphTypes:fu
 nction(){c.each(d.graphTypes,function(a,b){this[b]=d.clone(a)},this)},_initEvents:function(){var a=this.el,d,e,f;"ontouchstart"in a?(d=c.bind(function(c){f=!0,b.stopObserving(document,"touchend",d),b.fire(a,"flotr:mouseup",[event,this]),this.multitouches=null,e||this.clickHandler(c)},this),this.observe(this.overlay,"touchstart",c.bind(function(c){e=!1,f=!1,this.ignoreClick=!1,c.touches&&c.touches.length>1&&(this.multitouches=c.touches),b.fire(a,"flotr:mousedown",[event,this]),this.observe(document,"touchend",d)},this)),this.observe(this.overlay,"touchmove",c.bind(function(c){var d=this.getEventPosition(c);this.options.preventDefault&&c.preventDefault(),e=!0,this.multitouches||c.touches&&c.touches.length>1?this.multitouches=c.touches:f||b.fire(a,"flotr:mousemove",[event,d,this]),this.lastMousePos=d},this))):this.observe(this.overlay,"mousedown",c.bind(this.mouseDownHandler,this)).observe(a,"mousemove",c.bind(this.mouseMoveHandler,this)).observe(this.overlay,"click",c.bind(this.clickH
 andler,this)).observe(a,"mouseout",function(){b.fire(a,"flotr:mouseout")})},_initCanvas:function(){function k(e,f){return e||(e=a.create("canvas"),typeof FlashCanvas!="undefined"&&typeof e.getContext=="function"&&FlashCanvas.initElement(e),e.className="flotr-"+f,e.style.cssText="position:absolute;left:0px;top:0px;",a.insert(b,e)),c.each(i,function(b,c){a.show(e);if(f=="canvas"&&e.getAttribute(c)===b)return;e.setAttribute(c,b*d.resolution),e.style[c]=b+"px"}),e.context_=null,e}function l(a){window.G_vmlCanvasManager&&window.G_vmlCanvasManager.initElement(a);var b=a.getContext("2d");return window.G_vmlCanvasManager||b.scale(d.resolution,d.resolution),b}var b=this.el,d=this.options,e=b.children,f=[],g,h,i,j;for(h=e.length;h--;)g=e[h],!this.canvas&&g.className==="flotr-canvas"?this.canvas=g:!this.overlay&&g.className==="flotr-overlay"?this.overlay=g:f.push(g);for(h=f.length;h--;)b.removeChild(f[h]);a.setStyles(b,{position:"relative"}),i={},i.width=b.clientWidth,i.height=b.clientHeight;i
 f(i.width<=0||i.height<=0||d.resolution<=0)throw"Invalid dimensions for plot, width = "+i.width+", height = "+i.height+", resolution = "+d.resolution;this.canvas=k(this.canvas,"canvas"),this.overlay=k(this.overlay,"overlay"),this.ctx=l(this.canvas),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.octx=l(this.overlay),this.octx.clearRect(0,0,this.overlay.width,this.overlay.height),this.canvasHeight=i.height,this.canvasWidth=i.width,this.textEnabled=!!this.ctx.drawText||!!this.ctx.fillText},_initPlugins:function(){c.each(d.plugins,function(a,b){c.each(a.callbacks,function(a,b){this.observe(this.el,b,c.bind(a,this))},this),this[b]=d.clone(a),c.each(this[b],function(a,d){c.isFunction(a)&&(this[b][d]=c.bind(a,this))},this)},this)},_initOptions:function(a){var e=d.clone(d.defaultOptions);e.x2axis=c.extend(c.clone(e.xaxis),e.x2axis),e.y2axis=c.extend(c.clone(e.yaxis),e.y2axis),this.options=d.merge(a||{},e),this.options.grid.minorVerticalLines===null&&this.options.xaxis.sca
 ling==="logarithmic"&&(this.options.grid.minorVerticalLines=!0),this.options.grid.minorHorizontalLines===null&&this.options.yaxis.scaling==="logarithmic"&&(this.options.grid.minorHorizontalLines=!0),b.fire(this.el,"flotr:afterinitoptions",[this]),this.axes=d.Axis.getAxes(this.options);var f=[],g=[],h=this.series.length,i=this.series.length,j=this.options.colors,k=[],l=0,m,n,o,p;for(n=i-1;n>-1;--n)m=this.series[n].color,m&&(--i,c.isNumber(m)?f.push(m):k.push(d.Color.parse(m)));for(n=f.length-1;n>-1;--n)i=Math.max(i,f[n]+1);for(n=0;g.length<i;){m=j.length==n?new d.Color(100,100,100):d.Color.parse(j[n]);var q=l%2==1?-1:1,r=1+q*Math.ceil(l/2)*.2;m.scale(r,r,r),g.push(m),++n>=j.length&&(n=0,++l)}for(n=0,o=0;n<h;++n){p=this.series[n],p.color?c.isNumber(p.color)&&(p.color=g[p.color].toString()):p.color=g[o++].toString(),p.xaxis||(p.xaxis=this.axes.x),p.xaxis==1?p.xaxis=this.axes.x:p.xaxis==2&&(p.xaxis=this.axes.x2),p.yaxis||(p.yaxis=this.axes.y),p.yaxis==1?p.yaxis=this.axes.y:p.yaxis==2&&(
 p.yaxis=this.axes.y2);for(var s in d.graphTypes)p[s]=c.extend(c.clone(this.options[s]),p[s]);p.mouse=c.extend(c.clone(this.options.mouse),p.mouse),c.isUndefined(p.shadowSize)&&(p.shadowSize=this.options.shadowSize)}},_setEl:function(a){if(!a)throw"The target container doesn't exist";if(a.graph instanceof Graph)a.graph.destroy();else if(!a.clientWidth)throw"The target container must be visible";a.graph=this,this.el=a}},Flotr.Graph=Graph}(),function(){function c(b){this.orientation=1,this.offset=0,this.datamin=Number.MAX_VALUE,this.datamax=-Number.MAX_VALUE,a.extend(this,b)}function d(a,b){return a=Math.log(Math.max(a,Number.MIN_VALUE)),b!==Math.E&&(a/=Math.log(b)),a}function e(a,b){return b===Math.E?Math.exp(a):Math.pow(b,a)}var a=Flotr._,b="logarithmic";c.prototype={setScale:function(){var a=this.length,c=this.max,f=this.min,g=this.offset,h=this.orientation,i=this.options,j=i.scaling===b,k;j?k=a/(d(c,i.base)-d(f,i.base)):k=a/(c-f),this.scale=k,j?(this.d2p=function(a){return g+h*(d(a
 ,i.base)-d(f,i.base))*k},this.p2d=function(a){return e((g+h*a)/k+d(f,i.base),i.base)}):(this.d2p=function(a){return g+h*(a-f)*k},this.p2d=function(a){return(g+h*a)/k+f})},calculateTicks:function(){var b=this.options;this.ticks=[],this.minorTicks=[],b.ticks?(this._cleanUserTicks(b.ticks,this.ticks),this._cleanUserTicks(b.minorTicks||[],this.minorTicks)):b.mode=="time"?this._calculateTimeTicks():b.scaling==="logarithmic"?this._calculateLogTicks():this._calculateTicks(),a.each(this.ticks,function(a){a.label+=""}),a.each(this.minorTicks,function(a){a.label+=""})},calculateRange:function(){if(!this.used)return;var a=this,b=a.options,c=b.min!==null?b.min:a.datamin,d=b.max!==null?b.max:a.datamax,e=b.autoscaleMargin;b.scaling=="logarithmic"&&(c<=0&&(c=a.datamin),d<=0&&(d=c));if(d==c){var f=d?.01:1;b.min===null&&(c-=f),b.max===null&&(d+=f)}if(b.scaling==="logarithmic"){c<0&&(c=d/b.base);var g=Math.log(d);b.base!=Math.E&&(g/=Math.log(b.base)),g=Math.ceil(g);var h=Math.log(c);b.base!=Math.E&&(
 h/=Math.log(b.base)),h=Math.ceil(h),a.tickSize=Flotr.getTickSize(b.noTicks,h,g,b.tickDecimals===null?0:b.tickDecimals),b.minorTickFreq===null&&(g-h>10?b.minorTickFreq=0:g-h>5?b.minorTickFreq=2:b.minorTickFreq=5)}else a.tickSize=Flotr.getTickSize(b.noTicks,c,d,b.tickDecimals);a.min=c,a.max=d,b.min===null&&b.autoscale&&(a.min-=a.tickSize*e,a.min<0&&a.datamin>=0&&(a.min=0),a.min=a.tickSize*Math.floor(a.min/a.tickSize)),b.max===null&&b.autoscale&&(a.max+=a.tickSize*e,a.max>0&&a.datamax<=0&&a.datamax!=a.datamin&&(a.max=0),a.max=a.tickSize*Math.ceil(a.max/a.tickSize)),a.min==a.max&&(a.max=a.min+1)},calculateTextDimensions:function(a,b){var c="",d,e;if(this.options.showLabels)for(e=0;e<this.ticks.length;++e)d=this.ticks[e].label.length,d>c.length&&(c=this.ticks[e].label);this.maxLabel=a.dimensions(c,{size:b.fontSize,angle:Flotr.toRad(this.options.labelsAngle)},"font-size:smaller;","flotr-grid-label"),this.titleSize=a.dimensions(this.options.title,{size:b.fontSize*1.2,angle:Flotr.toRad(this
 .options.titleAngle)},"font-weight:bold;","flotr-axis-title")},_cleanUserTicks:function(b,c){var d=this,e=this.options,f,g,h,i;a.isFunction(b)&&(b=b({min:d.min,max:d.max}));for(g=0;g<b.length;++g)i=b[g],typeof i=="object"?(f=i[0],h=i.length>1?i[1]:e.tickFormatter(f,{min:d.min,max:d.max})):(f=i,h=e.tickFormatter(f,{min:this.min,max:this.max})),c[g]={v:f,label:h}},_calculateTimeTicks:function(){this.ticks=Flotr.Date.generator(this)},_calculateLogTicks:function(){var a=this,b=a.options,c,d,e=Math.log(a.max);b.base!=Math.E&&(e/=Math.log(b.base)),e=Math.ceil(e);var f=Math.log(a.min);b.base!=Math.E&&(f/=Math.log(b.base)),f=Math.ceil(f);for(i=f;i<e;i+=a.tickSize){d=b.base==Math.E?Math.exp(i):Math.pow(b.base,i);var g=d*(b.base==Math.E?Math.exp(a.tickSize):Math.pow(b.base,a.tickSize)),h=(g-d)/b.minorTickFreq;a.ticks.push({v:d,label:b.tickFormatter(d,{min:a.min,max:a.max})});for(c=d+h;c<g;c+=h)a.minorTicks.push({v:c,label:b.tickFormatter(c,{min:a.min,max:a.max})})}d=b.base==Math.E?Math.exp(i)
 :Math.pow(b.base,i),a.ticks.push({v:d,label:b.tickFormatter(d,{min:a.min,max:a.max})})},_calculateTicks:function(){var a=this,b=a.options,c=a.tickSize,d=a.min,e=a.max,f=c*Math.ceil(d/c),g,h,i,j,k,l;b.minorTickFreq&&(h=c/b.minorTickFreq);for(k=0;(i=j=f+k*c)<=e;++k){g=b.tickDecimals,g===null&&(g=1-Math.floor(Math.log(c)/Math.LN10)),g<0&&(g=0),i=i.toFixed(g),a.ticks.push({v:i,label:b.tickFormatter(i,{min:a.min,max:a.max})});if(b.minorTickFreq)for(l=0;l<b.minorTickFreq&&k*c+l*h<e;++l)i=j+l*h,a.minorTicks.push({v:i,label:b.tickFormatter(i,{min:a.min,max:a.max})})}}},a.extend(c,{getAxes:function(a){return{x:new c({options:a.xaxis,n:1,length:this.plotWidth}),x2:new c({options:a.x2axis,n:2,length:this.plotWidth}),y:new c({options:a.yaxis,n:1,length:this.plotHeight,offset:this.plotHeight,orientation:-1}),y2:new c({options:a.y2axis,n:2,length:this.plotHeight,offset:this.plotHeight,orientation:-1})}}}),Flotr.Axis=c}(),function(){function b(b){a.extend(this,b)}var a=Flotr._;b.prototype={getRang
 e:function(){var a=this.data,b=a.length,c=Number.MAX_VALUE,d=Number.MAX_VALUE,e=-Number.MAX_VALUE,f=-Number.MAX_VALUE,g=!1,h=!1,i,j,k;if(b<0||this.hide)return!1;for(k=0;k<b;k++)i=a[k][0],j=a[k][1],i!==null&&(i<c&&(c=i,g=!0),i>e&&(e=i,g=!0)),j!==null&&(j<d&&(d=j,h=!0),j>f&&(f=j,h=!0));return{xmin:c,xmax:e,ymin:d,ymax:f,xused:g,yused:h}}},a.extend(b,{getSeries:function(c){return a.map(c,function(c){var d;return c.data?(d=new b,a.extend(d,c)):d=new b({data:c}),d})}}),Flotr.Series=b}(),function(){var a=Flotr,b=a.DOM,c=a._,d=function(a){this.o=a};d.prototype={dimensions:function(a,b,c,d){return a?this.o.html?this.html(a,this.o.element,c,d):this.canvas(a,b):{width:0,height:0}},canvas:function(b,c){if(!this.o.textEnabled)return;c=c||{};var d=this.measureText(b,c),e=d.width,f=c.size||a.defaultOptions.fontSize,g=c.angle||0,h=Math.cos(g),i=Math.sin(g),j=2,k=6,l;return l={width:Math.abs(h*e)+Math.abs(i*f)+j,height:Math.abs(i*e)+Math.abs(h*f)+k},l},html:function(a,c,d,e){var f=b.create("div");r
 eturn b.setStyles(f,{position:"absolute",top:"-10000px"}),b.insert(f,'<div style="'+d+'" class="'+e+' flotr-dummy-div">'+a+"</div>"),b.insert(this.o.element,f),b.size(f)},measureText:function(b,d){var e=this.o.ctx,f;return!e.fillText||a.isIphone&&e.measure?{width:e.measure(b,d)}:(d=c.extend({size:a.defaultOptions.fontSize,weight:1,angle:0},d),e.save(),e.font=(d.weight>1?"bold ":"")+d.size*1.3+"px sans-serif",f=e.measureText(b),e.restore(),f)}},Flotr.Text=d}(),Flotr.addType("lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4,steps:!1,stacked:!1},stack:{values:[]},draw:function(a){var b=a.context,c=a.lineWidth,d=a.shadowSize,e;b.save(),b.lineJoin="round",d&&(b.lineWidth=d/2,e=c/2+b.lineWidth/2,b.strokeStyle="rgba(0,0,0,0.1)",this.plot(a,e+d/2,!1),b.strokeStyle="rgba(0,0,0,0.2)",this.plot(a,e,!1)),b.lineWidth=c,b.strokeStyle=a.color,this.plot(a,0,!0),b.restore()},plot:function(a,b,c){function w(){!b&&a.fill&&o&&(p=g(o[0]),d.fillStyle=a.fillStyle,d.
 lineTo(q,n),d.lineTo(p,n),d.lineTo(p,h(o[1])),d.fill(),a.fillBorder&&d.stroke())}var d=a.context,e=a.width,f=a.height,g=a.xScale,h=a.yScale,i=a.data,j=a.stacked?this.stack:!1,k=i.length-1,l=null,m=null,n=h(0),o=null,p,q,r,s,t,u,v;if(k<1)return;d.beginPath();for(v=0;v<k;++v){if(i[v][1]===null||i[v+1][1]===null){a.fill&&v>0&&i[v][1]&&(d.stroke(),w(),o=null,d.closePath(),d.beginPath());continue}p=g(i[v][0]),q=g(i[v+1][0]),o===null&&(o=i[v]),j?(t=j.values[i[v][0]]||0,u=j.values[i[v+1][0]]||j.values[i[v][0]]||0,r=h(i[v][1]+t),s=h(i[v+1][1]+u),c&&(j.values[i[v][0]]=i[v][1]+t,v==k-1&&(j.values[i[v+1][0]]=i[v+1][1]+u))):(r=h(i[v][1]),s=h(i[v+1][1]));if(r>f&&s>f||r<0&&s<0||p<0&&q<0||p>e&&q>e)continue;(l!=p||m!=r+b)&&d.moveTo(p,r+b),l=q,m=s+b,a.steps?(d.lineTo(l+b/2,r+b),d.lineTo(l+b/2,m)):d.lineTo(l,m)}(!a.fill||a.fill&&!a.fillBorder)&&d.stroke(),w(),d.closePath()},extendYRange:function(a,b,c,d){var e=a.options;if(c.stacked&&(!e.max&&e.max!==0||!e.min&&e.min!==0)){var f=a.max,g=a.min,h=d.pos
 itiveSums||{},i=d.negativeSums||{},j,k;for(k=0;k<b.length;k++)j=b[k][0]+"",b[k][1]>0?(h[j]=(h[j]||0)+b[k][1],f=Math.max(f,h[j])):(i[j]=(i[j]||0)+b[k][1],g=Math.min(g,i[j]));d.negativeSums=i,d.positiveSums=h,a.max=f,a.min=g}c.steps&&(this.hit=function(a){var b=a.data,c=a.args,d=a.yScale,e=c[0],f=b.length,g=c[1],h=a.xInverse(e.relX),i=e.relY,j;for(j=0;j<f-1;j++)if(h>=b[j][0]&&h<=b[j+1][0]){Math.abs(d(b[j][1])-i)<8&&(g.x=b[j][0],g.y=b[j][1],g.index=j,g.seriesIndex=a.index);break}},this.drawHit=function(a){var b=a.context,c=a.args,d=a.data,e=a.xScale,f=c.index,g=e(c.x),h=a.yScale(c.y),i;d.length-1>f&&(i=a.xScale(d[f+1][0]),b.save(),b.strokeStyle=a.color,b.lineWidth=a.lineWidth,b.beginPath(),b.moveTo(g,h),b.lineTo(i,h),b.stroke(),b.closePath(),b.restore())},this.clearHit=function(a){var b=a.context,c=a.args,d=a.data,e=a.xScale,f=a.lineWidth,g=c.index,h=e(c.x),i=a.yScale(c.y),j;d.length-1>g&&(j=a.xScale(d[g+1][0]),b.clearRect(h-f,i-f,j-h+2*f,2*f))})}}),Flotr.addType("bars",{options:{show:
 !1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0,topPadding:.1,grouped:!1},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(a){var b=a.context;this.current+=1,b.save(),b.lineJoin="miter",b.lineWidth=a.lineWidth,b.strokeStyle=a.color,a.fill&&(b.fillStyle=a.fillStyle),this.plot(a),b.restore()},plot:function(a){var b=a.data,c=a.context,d=a.shadowSize,e,f,g,h,i,j;if(b.length<1)return;this.translate(c,a.horizontal);for(e=0;e<b.length;e++){f=this.getBarGeometry(b[e][0],b[e][1],a);if(f===null)continue;g=f.left,h=f.top,i=f.width,j=f.height,a.fill&&c.fillRect(g,h,i,j),d&&(c.save(),c.fillStyle="rgba(0,0,0,0.05)",c.fillRect(g+d,h+d,i,j),c.restore()),a.lineWidth&&c.strokeRect(g,h,i,j)}},translate:function(a,b){b&&(a.rotate(-Math.PI/2),a.scale(-1,1))},getBarGeometry:function(a,b,c){var d=c.horizontal,e=c.barWidth,f=c.centered,g=c.stacked?this.stack:!1,h=c.lineWidth,i=f?e/2:0,j=d?c.yScale:c.xScale,k=d?c.xScale:c.yScale,l=d
 ?b:a,m=d?a:b,n=0,o,p,q,r,s;return c.grouped&&(this.current/this.groups,l-=i,e/=this.groups,i=e/2,l=l+e*this.current-i),g&&(o=m>0?g.positive:g.negative,n=o[l]||n,o[l]=n+m),p=j(l-i),q=j(l+e-i),r=k(m+n),s=k(n),s<0&&(s=0),a===null||b===null?null:{x:l,y:m,xScale:j,yScale:k,top:r,left:Math.min(p,q)-h/2,width:Math.abs(q-p)-h,height:s-r}},hit:function(a){var b=a.data,c=a.args,d=c[0],e=c[1],f=a.xInverse(d.relX),g=a.yInverse(d.relY),h=this.getBarGeometry(f,g,a),i=h.width/2,j=h.left,k=h.y,l,m;for(m=b.length;m--;)l=this.getBarGeometry(b[m][0],b[m][1],a),(k>0&&k<l.y||k<0&&k>l.y)&&Math.abs(j-l.left)<i&&(e.x=b[m][0],e.y=b[m][1],e.index=m,e.seriesIndex=a.index)},drawHit:function(a){var b=a.context,c=a.args,d=this.getBarGeometry(c.x,c.y,a),e=d.left,f=d.top,g=d.width,h=d.height;b.save(),b.strokeStyle=a.color,b.lineWidth=a.lineWidth,this.translate(b,a.horizontal),b.beginPath(),b.moveTo(e,f+h),b.lineTo(e,f),b.lineTo(e+g,f),b.lineTo(e+g,f+h),a.fill&&(b.fillStyle=a.fillStyle,b.fill()),b.stroke(),b.closeP
 ath(),b.restore()},clearHit:function(a){var b=a.context,c=a.args,d=this.getBarGeometry(c.x,c.y,a),e=d.left,f=d.width,g=d.top,h=d.height,i=2*a.lineWidth;b.save(),this.translate(b,a.horizontal),b.clearRect(e-i,Math.min(g,g+h)-i,f+2*i,Math.abs(h)+2*i),b.restore()},extendXRange:function(a,b,c,d){this._extendRange(a,b,c,d),this.groups=this.groups+1||1,this.current=0},extendYRange:function(a,b,c,d){this._extendRange(a,b,c,d)},_extendRange:function(a,b,c,d){var e=a.options.max;if(_.isNumber(e)||_.isString(e))return;var f=a.min,g=a.max,h=c.horizontal,i=a.orientation,j=this.positiveSums||{},k=this.negativeSums||{},l,m,n,o;(i==1&&!h||i==-1&&h)&&c.centered&&(g=Math.max(a.datamax+c.barWidth,g),f=Math.min(a.datamin-c.barWidth,f));if(c.stacked&&(i==1&&h||i==-1&&!h))for(o=b.length;o--;)l=b[o][i==1?1:0]+"",m=b[o][i==1?0:1],m>0?(j[l]=(j[l]||0)+m,g=Math.max(g,j[l])):(k[l]=(k[l]||0)+m,f=Math.min(f,k[l]));(i==1&&h||i==-1&&!h)&&c.topPadding&&(a.max===a.datamax||c.stacked&&this.stackMax!==g)&&(g+=c.topPa
 dding*(g-f)),this.stackMin=f,this.stackMax=g,this.negativeSums=k,this.positiveSums=j,a.max=g,a.min=f}}),Flotr.addType("bubbles",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,baseRadius:2},draw:function(a){var b=a.context,c=a.shadowSize;b.save(),b.lineWidth=a.lineWidth,b.fillStyle="rgba(0,0,0,0.05)",b.strokeStyle="rgba(0,0,0,0.05)",this.plot(a,c/2),b.strokeStyle="rgba(0,0,0,0.1)",this.plot(a,c/4),b.strokeStyle=a.color,b.fillStyle=a.fillStyle,this.plot(a),b.restore()},plot:function(a,b){var c=a.data,d=a.context,e,f,g,h,i;b=b||0;for(f=0;f<c.length;++f)e=this.getGeometry(c[f],a),d.beginPath(),d.arc(e.x+b,e.y+b,e.z,0,2*Math.PI,!0),d.stroke(),a.fill&&d.fill(),d.closePath()},getGeometry:function(a,b){return{x:b.xScale(a[0]),y:b.yScale(a[1]),z:a[2]*b.baseRadius}},hit:function(a){var b=a.data,c=a.args,d=c[0],e=c[1],f=d.relX,g=d.relY,h,j,k,l;e.best=e.best||Number.MAX_VALUE;for(i=b.length;i--;)j=this.getGeometry(b[i],a),k=j.x-f,l=j.y-g,h=Math.sqrt(k*k+l*l),h<j.z&&j.z<e.best&&(e.x=b[i][0
 ],e.y=b[i][1],e.index=i,e.seriesIndex=a.index,e.best=j.z)},drawHit:function(a){var b=a.context,c=this.getGeometry(a.data[a.args.index],a);b.save(),b.lineWidth=a.lineWidth,b.fillStyle=a.fillStyle,b.strokeStyle=a.color,b.beginPath(),b.arc(c.x,c.y,c.z,0,2*Math.PI,!0),b.fill(),b.stroke(),b.closePath(),b.restore()},clearHit:function(a){var b=a.context,c=this.getGeometry(a.data[a.args.index],a),d=c.z+a.lineWidth;b.save(),b.clearRect(c.x-d,c.y-d,2*d,2*d),b.restore()}}),function(){function a(a){return typeof a=="object"&&a.constructor&&(Image?!0:a.constructor===Image)}Flotr.defaultMarkerFormatter=function(a){return Math.round(a.y*100)/100+""},Flotr.addType("markers",{options:{show:!1,lineWidth:1,color:"#000000",fill:!1,fillColor:"#FFFFFF",fillOpacity:.4,stroke:!1,position:"ct",verticalMargin:0,labelFormatter:Flotr.defaultMarkerFormatter,fontSize:Flotr.defaultOptions.fontSize,stacked:!1,stackingType:"b",horizontal:!1},stack:{positive:[],negative:[],values:[]},draw:function(a){function m(a,b)
 {return g=d.negative[a]||0,f=d.positive[a]||0,b>0?(d.positive[a]=g+b,g+b):(d.negative[a]=f+b,f+b)}var b=a.data,c=a.context,d=a.stacked?a.stack:!1,e=a.stackingType,f,g,h,i,j,k,l;c.save(),c.lineJoin="round",c.lineWidth=a.lineWidth,c.strokeStyle="rgba(0,0,0,0.5)",c.fillStyle=a.fillStyle;for(i=0;i<b.length;++i)j=b[i][0],k=b[i][1],d&&(e=="b"?a.horizontal?k=m(k,j):j=m(j,k):e=="a"&&(h=d.values[j]||0,d.values[j]=h+k,k=h+k)),l=a.labelFormatter({x:j,y:k,index:i,data:b}),this.plot(a.xScale(j),a.yScale(k),l,a);c.restore()},plot:function(b,c,d,e){var f=e.context;if(a(d)&&!d.complete)throw"Marker image not loaded.";this._plot(b,c,d,e)},_plot:function(b,c,d,e){var f=e.context,g=2,h=b,i=c,j;a(d)?j={height:d.height,width:d.width}:j=e.text.canvas(d),j.width=Math.floor(j.width+g*2),j.height=Math.floor(j.height+g*2),e.position.indexOf("c")!=-1?h-=j.width/2+g:e.position.indexOf("l")!=-1&&(h-=j.width),e.position.indexOf("m")!=-1?i-=j.height/2+g:e.position.indexOf("t")!=-1?i-=j.height+e.verticalMargin:i+=
 e.verticalMargin,h=Math.floor(h)+.5,i=Math.floor(i)+.5,e.fill&&f.fillRect(h,i,j.width,j.height),e.stroke&&f.strokeRect(h,i,j.width,j.height),a(d)?f.drawImage(d,h+g,i+g):Flotr.drawText(f,d,h+g,i+g,{textBaseline:"top",textAlign:"left",size:e.fontSize,color:e.color})}})}(),function(){var a=Flotr._;Flotr.defaultPieLabelFormatter=function(a,b){return(100*b/a).toFixed(2)+"%"},Flotr.addType("pie",{options:{show:!1,lineWidth:1,fill:!0,fillColor:null,fillOpacity:.6,explode:6,sizeRatio:.6,startAngle:Math.PI/4,labelFormatter:Flotr.defaultPieLabelFormatter,pie3D:!1,pie3DviewAngle:Math.PI/2*.8,pie3DspliceThickness:20,epsilon:.1},draw:function(a){var b=a.data,c=a.context,d=c.canvas,e=a.lineWidth,f=a.shadowSize,g=a.sizeRatio,h=a.height,i=a.width,j=a.explode,k=a.color,l=a.fill,m=a.fillStyle,n=Math.min(d.width,d.height)*g/2,o=b[0][1],p=[],q=1,r=Math.PI*2*o/this.total,s=this.startAngle||2*Math.PI*a.startAngle,t=s+r,u=s+r/2,v=a.labelFormatter(this.total,o),w=j+n+4,x=Math.cos(u)*w,y=Math.sin(u)*w,z=x<0
 ?"right":"left",A=y>0?"top":"bottom",B,C,D;c.save(),c.translate(i/2,h/2),c.scale(1,q),C=Math.cos(u)*j,D=Math.sin(u)*j,f>0&&(this.plotSlice(C+f,D+f,n,s,t,c),l&&(c.fillStyle="rgba(0,0,0,0.1)",c.fill())),this.plotSlice(C,D,n,s,t,c),l&&(c.fillStyle=m,c.fill()),c.lineWidth=e,c.strokeStyle=k,c.stroke(),B={size:a.fontSize*1.2,color:a.fontColor,weight:1.5},v&&(a.htmlText||!a.textEnabled?(divStyle="position:absolute;"+A+":"+(h/2+(A==="top"?y:-y))+"px;",divStyle+=z+":"+(i/2+(z==="right"?-x:x))+"px;",p.push('<div style="',divStyle,'" class="flotr-grid-label">',v,"</div>")):(B.textAlign=z,B.textBaseline=A,Flotr.drawText(c,v,x,y,B)));if(a.htmlText||!a.textEnabled){var E=Flotr.DOM.node('<div style="color:'+a.fontColor+'" class="flotr-labels"></div>');Flotr.DOM.insert(E,p.join("")),Flotr.DOM.insert(a.element,E)}c.restore(),this.startAngle=t,this.slices=this.slices||[],this.slices.push({radius:Math.min(d.width,d.height)*g/2,x:C,y:D,explode:j,start:s,end:t})},plotSlice:function(a,b,c,d,e,f){f.beginP
 ath(),f.moveTo(a,b),f.arc(a,b,c,d,e,!1),f.lineTo(a,b),f.closePath()},hit:function(a){var b=a.data[0],c=a.args,d=a.index,e=c[0],f=c[1],g=this.slices[d],h=e.relX-a.width/2,i=e.relY-a.height/2,j=Math.sqrt(h*h+i*i),k=Math.atan(i/h),l=Math.PI*2,m=g.explode||a.explode,n=g.start%l,o=g.end%l,p=a.epsilon;h<0?k+=Math.PI:h>0&&i<0&&(k+=l),j<g.radius+m&&j>m&&(k>n&&k<o||n>o&&(k<o||k>n)||n===o&&(g.start===g.end&&Math.abs(k-n)<p||g.start!==g.end&&Math.abs(k-n)>p))&&(f.x=b[0],f.y=b[1],f.sAngle=n,f.eAngle=o,f.index=0,f.seriesIndex=d,f.fraction=b[1]/this.total)},drawHit:function(a){var b=a.context,c=this.slices[a.args.seriesIndex];b.save(),b.translate(a.width/2,a.height/2),this.plotSlice(c.x,c.y,c.radius,c.start,c.end,b),b.stroke(),b.restore()},clearHit:function(a){var b=a.context,c=this.slices[a.args.seriesIndex],d=2*a.lineWidth,e=c.radius+d;b.save(),b.translate(a.width/2,a.height/2),b.clearRect(c.x-e,c.y-e,2*e+d,2*e+d),b.restore()},extendYRange:function(a,b){this.total=(this.total||0)+b[0][1]}})}(),
 Flotr.addType("points",{options:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#FFFFFF",fillOpacity:1,hitRadius:null},draw:function(a){var b=a.context,c=a.lineWidth,d=a.shadowSize;b.save(),d>0&&(b.lineWidth=d/2,b.strokeStyle="rgba(0,0,0,0.1)",this.plot(a,d/2+b.lineWidth/2),b.strokeStyle="rgba(0,0,0,0.2)",this.plot(a,b.lineWidth/2)),b.lineWidth=a.lineWidth,b.strokeStyle=a.color,a.fill&&(b.fillStyle=a.fillStyle),this.plot(a),b.restore()},plot:function(a,b){var c=a.data,d=a.context,e=a.xScale,f=a.yScale,g,h,i;for(g=c.length-1;g>-1;--g){i=c[g][1];if(i===null)continue;h=e(c[g][0]),i=f(i);if(h<0||h>a.width||i<0||i>a.height)continue;d.beginPath(),b?d.arc(h,i+b,a.radius,0,Math.PI,!1):(d.arc(h,i,a.radius,0,2*Math.PI,!0),a.fill&&d.fill()),d.stroke(),d.closePath()}}}),Flotr.addType("radar",{options:{show:!1,lineWidth:2,fill:!0,fillOpacity:.4,radiusRatio:.9,sensibility:2},draw:function(a){var b=a.context,c=a.shadowSize;b.save(),b.translate(a.width/2,a.height/2),b.lineWidth=a.lineWidth,b.fillS
 tyle="rgba(0,0,0,0.05)",b.strokeStyle="rgba(0,0,0,0.05)",this.plot(a,c/2),b.strokeStyle="rgba(0,0,0,0.1)",this.plot(a,c/4),b.strokeStyle=a.color,b.fillStyle=a.fillStyle,this.plot(a),b.restore()},plot:function(a,b){var c=a.data,d=a.context,e=Math.min(a.height,a.width)*a.radiusRatio/2,f=2*Math.PI/c.length,g=-Math.PI/2,h,i;b=b||0,d.beginPath();for(h=0;h<c.length;++h)i=c[h][1]/this.max,d[h===0?"moveTo":"lineTo"](Math.cos(h*f+g)*e*i+b,Math.sin(h*f+g)*e*i+b);d.closePath(),a.fill&&d.fill(),d.stroke()},getGeometry:function(a,b){var c=Math.min(b.height,b.width)*b.radiusRatio/2,d=2*Math.PI/b.data.length,e=-Math.PI/2,f=a[1]/this.max;return{x:Math.cos(a[0]*d+e)*c*f+b.width/2,y:Math.sin(a[0]*d+e)*c*f+b.height/2}},hit:function(a){var b=a.args,c=b[0],d=b[1],e=c.relX,f=c.relY,g,h,i,j;for(var k=0;k<d.series.length;k++){var l=d.series[k],m=l.data;for(var n=m.length;n--;){h=this.getGeometry(m[n],a),i=h.x-e,j=h.y-f,g=Math.sqrt(i*i+j*j);if(g<a.sensibility*2)return d.x=m[n][0],d.y=m[n][1],d.index=n,d.ser
 iesIndex=k,d}}},drawHit:function(a){var b=2*Math.PI/a.data.length,c=-Math.PI/2,d=Math.min(a.height,a.width)*a.radiusRatio/2,e=a.args.series,f=e.points.hitRadius||e.points.radius||e.mouse.radius,g=a.context;g.translate(a.width/2,a.height/2);var h=a.args.index,i=a.data[h][1]/this.max,j=Math.cos(h*b+c)*d*i,k=Math.sin(h*b+c)*d*i;g.beginPath(),g.arc(j,k,f,0,2*Math.PI,!0),g.closePath(),g.stroke()},clearHit:function(a){var b=2*Math.PI/a.data.length,c=-Math.PI/2,d=Math.min(a.height,a.width)*a.radiusRatio/2,e=a.context,f=a.args.series,g=f.points?f.points.lineWidth:1;offset=(f.points.hitRadius||f.points.radius||f.mouse.radius)+g,e.translate(a.width/2,a.height/2);var h=a.args.index,i=a.data[h][1]/this.max,j=Math.cos(h*b+c)*d*i,k=Math.sin(h*b+c)*d*i;e.clearRect(j-offset,k-offset,offset*2,offset*2)},extendYRange:function(a,b){this.max=Math.max(a.max,this.max||-Number.MAX_VALUE)}}),function(){function a(a,b){return a.which?a.which===1:a.button===0||a.button===1}function b(a,b){return Math.min(Mat
 h.max(0,a),b.plotWidth-1)}function c(a,b){return Math.min(Math.max(0,a),b.plotHeight)}var d=Flotr.DOM,e=Flotr.EventAdapter,f=Flotr._;Flotr.addPlugin("selection",{options:{pinchOnly:null,mode:null,color:"#B6D9FF",fps:20},callbacks:{"flotr:mouseup":function(a){var b=this.options.selection,c=this.selection,d=this.getEventPosition(a);if(!b||!b.mode)return;c.interval&&clearInterval(c.interval),this.multitouches?c.updateSelection():b.pinchOnly||c.setSelectionPos(c.selection.second,d),c.clearSelection(),c.selecting&&c.selectionIsSane()&&(c.drawSelection(),c.fireSelectEvent(),this.ignoreClick=!0)},"flotr:mousedown":function(b){var c=this.options.selection,d=this.selection,e=this.getEventPosition(b);if(!c||!c.mode)return;if(!c.mode||!a(b)&&f.isUndefined(b.touches))return;c.pinchOnly||d.setSelectionPos(d.selection.first,e),d.interval&&clearInterval(d.interval),this.lastMousePos.pageX=null,d.selecting=!1,d.interval=setInterval(f.bind(d.updateSelection,this),1e3/c.fps)},"flotr:destroy":function
 (a){clearInterval(this.selection.interval)}},getArea:function(){var a=this.selection.selection,b=this.axes,c=a.first,d=a.second,e,f,g,h;return e=b.x.p2d(a.first.x),f=b.x.p2d(a.second.x),g=b.y.p2d(a.first.y),h=b.y.p2d(a.second.y),{x1:Math.min(e,f),y1:Math.min(g,h),x2:Math.max(e,f),y2:Math.max(g,h),xfirst:e,xsecond:f,yfirst:g,ysecond:h}},selection:{first:{x:-1,y:-1},second:{x:-1,y:-1}},prevSelection:null,interval:null,fireSelectEvent:function(a){var b=this.selection.getArea();a=a||"select",b.selection=this.selection.selection,e.fire(this.el,"flotr:"+a,[b,this])},setSelection:function(a,d){var e=this.options,f=this.axes.x,g=this.axes.y,h=g.scale,i=f.scale,j=e.selection.mode.indexOf("x")!=-1,k=e.selection.mode.indexOf("y")!=-1,l=this.selection.selection;this.selection.clearSelection(),l.first.y=c(j&&!k?0:(g.max-a.y1)*h,this),l.second.y=c(j&&!k?this.plotHeight-1
 :(g.max-a.y2)*h,this),l.first.x=b(k&&!j?0:(a.x1-f.min)*i,this),l.second.x=b(k&&!j?this.plotWidth:(a.x2-f.min)*i,this),this.selection.drawSelection(),d||this.selection.fireSelectEvent()},setSelectionPos:function(a,d){var e=this.options.selection.mode,f=this.selection.selection;e.indexOf("x")==-1?a.x=a==f.first?0:this.plotWidth:a.x=b(d.relX,this),e.indexOf("y")==-1?a.y=a==f.first?0:this.plotHeight-1:a.y=c(d.relY,this)},drawSelection:function(){this.selection.fireSelectEvent("selecting");var a=this.selection.selection,b=this.octx,c=this.options,d=this.plotOffset,e=this.selection.prevSelection;if(e&&a.first.x==e.first.x&&a.first.y==e.first.y&&a.second.x==e.second.x&&a.second.y==e.second.y)return;b.save(),b.strokeStyle=this.processColor(c.selection.color,{opacity:.8}),b.lineWidth=1,b.lineJoin="miter",b.fillStyle=this.processColor(c.selection.color,{opacity:.4}),this.selection.prevSelection={first:{x:a.first.x,y:a.first.y},second:{x:a.second.x,y:a.second.y}};var f=Math.min(a.first.x,a.sec
 ond.x),g=Math.min(a.first.y,a.second.y),h=Math.abs(a.second.x-a.first.x),i=Math.abs(a.second.y-a.first.y);b.fillRect(f+d.left+.5,g+d.top+.5,h,i),b.strokeRect(f+d.left+.5,g+d.top+.5,h,i),b.restore()},updateSelection:function(){if(!this.lastMousePos.pageX)return;this.selection.selecting=!0;if(this.multitouches)this.selection.setSelectionPos(this.selection.selection.first,this.getEventPosition(this.multitouches[0])),this.selection.setSelectionPos(this.selection.selection.second,this.getEventPosition(this.multitouches[1]));else{if(this.options.selection.pinchOnly)return;this.selection.setSelectionPos(this.selection.selection.second,this.lastMousePos)}this.selection.clearSelection(),this.selection.selectionIsSane()&&this.selection.drawSelection()},clearSelection:function(){if(!this.selection.prevSelection)return;var a=this.selection.prevSelection,b=1,c=this.plotOffset,d=Math.min(a.first.x,a.second.x),e=Math.min(a.first.y,a.second.y),f=Math.abs(a.second.x-a.first.x),g=Math.abs(a.second.y-
 a.first.y);this.octx.clearRect(d+c.left-b+.5,e+c.top-b,f+2*b+.5,g+2*b+.5),this.selection.prevSelection=null},selectionIsSane:function(){var a=this.selection.selection;return Math.abs(a.second.x-a.first.x)>=5||Math.abs(a.second.y-a.first.y)>=5}})}(),function(){var a=Flotr.DOM,b=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(a){return a},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var b=this.legend.markup;b&&(this.legend.markup=null,a.remove(b))}},insertLegend:function(){if(!this.options.legend.show)return;var c=this.series,d=this.plotOffset,e=this.options,f=e.legend,g=[],h=!1,i=this.ctx,j=b.filter(c,function(a){return a.label&&!a.hide}).length,k=f.position,l=f.margin,m=f.backgroundOpacity,n,o,p;if(j){var q=f.labelBoxWidth,r=f.la
 belBoxHeight,s=f.labelBoxMargin,t=d.left+l,u=d.top+l,v=0,w={size:e.fontSize*1.1,color:e.grid.color};for(n=c.length-1;n>-1;--n){if(!c[n].label||c[n].hide)continue;o=f.labelFormatter(c[n].label),v=Math.max(v,this._text.measureText(o,w).width)}var x=Math.round(q+s*3+v),y=Math.round(j*(s+r)+s);!m&&m!==0&&(m=.1);if(!e.HtmlText&&this.textEnabled&&!f.container){k.charAt(0)=="s"&&(u=d.top+this.plotHeight-(l+y)),k.charAt(0)=="c"&&(u=d.top+this.plotHeight/2-(l+y/2)),k.charAt(1)=="e"&&(t=d.left+this.plotWidth-(l+x)),p=this.processColor(f.backgroundColor,{opacity:m}),i.fillStyle=p,i.fillRect(t,u,x,y),i.strokeStyle=f.labelBoxBorderColor,i.strokeRect(Flotr.toPixel(t),Flotr.toPixel(u),x,y);var z=t+s,A=u+s;for(n=0;n<c.length;n++){if(!c[n].label||c[n].hide)continue;o=f.labelFormatter(c[n].label),i.fillStyle=c[n].color,i.fillRect(z,A,q-1,r-1),i.strokeStyle=f.labelBoxBorderColor,i.lineWidth=1,i.strokeRect(Math.ceil(z)-1.5,Math.ceil(A)-1.5,q+2,r+2),Flotr.drawText(i,o,z+q+s,A+r,w),A+=r+s}}else{for(n=0;n
 <c.length;++n){if(!c[n].label||c[n].hide)continue;n%f.noColumns===0&&(g.push(h?"</tr><tr>":"<tr>"),h=!0);var B=c[n],C=f.labelBoxWidth,E=f.labelBoxHeight;o=f.labelFormatter(B.label),p="background-color:"+(B.bars&&B.bars.show&&B.bars.fillColor&&B.bars.fill?B.bars.fillColor:B.color)+";",g.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',f.labelBoxBorderColor,';padding:1px">','<div style="width:',C-1,"px;height:",E-1,"px;border:1px solid ",c[n].color,'">','<div style="width:',C,"px;height:",E,"px;",p,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',o,"</td>")}h&&g.push("</tr>");if(g.length>0){var F='<table style="font-size:smaller;color:'+e.grid.color+'">'+g.join("")+"</table>";if(f.container)F=a.node(F),this.legend.markup=F,a.insert(f.container,F);else{var G={position:"absolute",zIndex:"2",border:"1px solid "+f.labelBoxBorderColor};k.charAt(0)=="n"?(G.top=l+d.top+"px",G.bottom="auto"):k.charAt(0)=="c"?(G.top=l+(this.plotHeight-y)/2+"px",G
 .bottom="auto"):k.charAt(0)=="s"&&(G.bottom=l+d.bottom+"px",G.top="auto"),k.charAt(1)=="e"?(G.right=l+d.right+"px",G.left="auto"):k.charAt(1)=="w"&&(G.left=l+d.left+"px",G.right="auto");var H=a.create("div"),I;H.className="flotr-legend",a.setStyles(H,G),a.insert(H,F),a.insert(this.el,H);if(!m)return;var J=f.backgroundColor||e.grid.backgroundColor||"#ffffff";b.extend(G,a.size(H),{backgroundColor:J,zIndex:"",border:""}),G.width+="px",G.height+="px",H=a.create("div"),H.className="flotr-legend-bg",a.setStyles(H,G),a.opacity(H,m),a.insert(H," "),a.insert(this.el,H)}}}}}})}(),function(){var a=Flotr.DOM,b=Flotr._,c=Flotr,d="opacity:0.7;background-color:#000;color:#fff;display:none;position:absolute;padding:2px 8px;-moz-border-radius:4px;border-radius:4px;white-space:nowrap;";Flotr.addPlugin("hit",{callbacks:{"flotr:mousemove":function(a,b){this.hit.track(b)},"flotr:click":function(a){var c=this.hit.track(a);b.defaults(a,c)},"flotr:mouseout":function(){this.hit.clearHit()},"flotr:destroy":f
 unction(){this.mouseTrack=null}},track:function(a){if(this.options.mouse.track||b.any(this.series,function(a){return a.mouse&&a.mouse.track}))return this.hit.hit(a)},executeOnType:function(a,d,e){function h(a,h){b.each(b.keys(c.graphTypes),function(b){a[b]&&a[b].show&&this[b][d]&&(g=this.getOptions(a,b),g.fill=!!a.mouse.fillColor,g.fillStyle=this.processColor(a.mouse.fillColor||"#ffffff",{opacity:a.mouse.fillOpacity}),g.color=a.mouse.lineColor,g.context=this.octx,g.index=h,e&&(g.args=e),this[b][d].call(this[b],g),f=!0)},this)}var f=!1,g;return b.isArray(a)||(a=[a]),b.each(a,h,this),f},drawHit:function(a){var b=this.octx,c=a.series;if(c.mouse.lineColor){b.save(),b.lineWidth=c.points?c.points.lineWidth:1,b.strokeStyle=c.mouse.lineColor,b.fillStyle=this.processColor(c.mouse.fillColor||"#ffffff",{opacity:c.mouse.fillOpacity}),b.translate(this.plotOffset.left,this.plotOffset.top);if(!this.hit.executeOnType(c,"drawHit",a)){var d=a.xaxis,e=a.yaxis;b.beginPath(),b.arc(d.d2p(a.x),e.d2p(a.y),
 c.points.hitRadius||c.points.radius||c.mouse.radius,0,2*Math.PI,!0),b.fill(),b.stroke(),b.closePath()}b.restore(),this.clip(b)}this.prevHit=a},clearHit:function(){var b=this.prevHit,c=this.octx,d=this.plotOffset;c.save(),c.translate(d.left,d.top);if(b){if(!this.hit.executeOnType(b.series,"clearHit",this.prevHit)){var e=b.series,f=e.points?e.points.lineWidth:1;offset=(e.points.hitRadius||e.points.radius||e.mouse.radius)+f,c.clearRect(b.xaxis.d2p(b.x)-offset,b.yaxis.d2p(b.y)-offset,offset*2,offset*2)}a.hide(this.mouseTrack),this.prevHit=null}c.restore()},hit:function(a){var c=this.options,d=this.prevHit,e,f,g,h,i,j,k,l,m;if(this.series.length===0)return;m={relX:a.relX,relY:a.relY,absX:a.absX,absY:a.absY,series:this.series};if(c.mouse.trackY&&!c.mouse.trackAll&&this.hit.executeOnType(this.series,"hit",[a,m])&&!b.isUndefined(m.seriesIndex))i=this.series[m.seriesIndex],m.series=i,m.mouse=i.mouse,m.xaxis=i.xaxis,m.yaxis=i.yaxis;else{e=this.hit.closest(a);if(e){e=c.mouse.trackY?e.point:e.x
 ,h=e.seriesIndex,i=this.series[h],k=i.xaxis,l=i.yaxis,f=2*i.mouse.sensibility;if(c.mouse.trackAll||e.distanceX<f/k.scale&&(!c.mouse.trackY||e.distanceY<f/l.scale))m.series=i,m.xaxis=i.xaxis,m.yaxis=i.yaxis,m.mouse=i.mouse,m.x=e.x,m.y=e.y,m.dist=e.distance,m.index=e.dataIndex,m.seriesIndex=h}}if(!d||d.index!==m.index||d.seriesIndex!==m.seriesIndex)this.hit.clearHit(),m.series&&m.mouse&&m.mouse.track&&(this.hit.drawMouseTrack(m),this.hit.drawHit(m),Flotr.EventAdapter.fire(this.el,"flotr:hit",[m,this]));return m},closest:function(a){function v(a){a.distance=m,a.distanceX=n,a.distanceY=o,a.seriesIndex=t,a.dataIndex=u,a.x=r,a.y=s,j=!0}var b=this.series,c=this.options,d=a.relX,e=a.relY,f=Number.MAX_VALUE,g=Number.MAX_VALUE,h={},i={},j=!1,k,l,m,n,o,p,q,r,s,t,u;for(t=0;t<b.length;t++){k=b[t],l=k.data,p=k.xaxis.p2d(d),q=k.yaxis.p2d(e);for(u=l.length;u--;){r=l[u][0],s=l[u][1];if(r===null||s===null)continue;if(r<k.xaxis.min||r>k.xaxis.max)continue;n=Math.abs(r-p),o=Math.abs(s-q),m=n*n+o*o,m<f&
 &(f=m,v(h)),n<g&&(g=n,v(i))}}return j?{point:h,x:i}:!1},drawMouseTrack:function(b){var c="",e=b.series,f=b.mouse.position,g=b.mouse.margin,h=b.x,i=b.y,j=d,k=this.mouseTrack,l=this.plotOffset,m=l.left,n=l.right,o=l.bottom,p=l.top,q=b.mouse.trackDecimals,r=this.options;k||(k=a.node('<div class="flotr-mouse-value"></div>'),this.mouseTrack=k,a.insert(this.el,k));if(!b.mouse.relative)f.charAt(0)=="n"?c+="top:"+(g+p)+"px;bottom:auto;":f.charAt(0)=="s"&&(c+="bottom:"+(g+o)+"px;top:auto;"),f.charAt(1)=="e"?c+="right:"+(g+n)+"px;left:auto;":f.charAt(1)=="w"&&(c+="left:"+(g+m)+"px;right:auto;");else if(e.pie&&e.pie.show){var s={x:this.plotWidth/2,y:this.plotHeight/2},t=Math.min(this.canvasWidth,this.canvasHeight)*e.pie.sizeRatio/2,u=b.sAngle<b.eAngle?(b.sAngle+b.eAngle)/2:(b.sAngle+b.eAngle+2*Math.PI)/2;c+="bottom:"+(g-p-s.y-Math.sin(u)*t/2+this.canvasHeight)+"px;top:auto;",c+="left:"+(g+m+s.x+Math.cos(u)*t/2)+"px;right:auto;"}else/n/.test(f)?c+="bottom:"+(g-p-b.yaxis.d2p(b.y)+this.canvasHeig
 ht)+"px;top:auto;":c+="top:"+(g+p+b.yaxis.d2p(b.y))+"px;bottom:auto;",/w/.test(f)?c+="right:"+(g-m-b.xaxis.d2p(b.x)+this.canvasWidth)+"px;left:auto;":c+="left:"+(g+m+b.xaxis.d2p(b.x))+"px;right:auto;";j+=c,k.style.cssText=j;if(!q||q<0)q=0;h&&h.toFixed&&(h=h.toFixed(q)),i&&i.toFixed&&(i=i.toFixed(q)),k.innerHTML=b.mouse.trackFormatter({x:h,y:i,series:b.series,index:b.index,nearest:b,fraction:b.fraction}),a.show(k),b.mouse.relative&&(/[ew]/.test(f)?/[ns]/.test(f)||(k.style.top=p+b.yaxis.d2p(b.y)-a.size(k).height/2+"px"):k.style.left=m+b.xaxis.d2p(b.x)-a.size(k).width/2+"px")}})}(),function(){var a=Flotr.DOM;Flotr.addPlugin("labels",{callbacks:{"flotr:afterdraw":function(){this.labels.draw()}},draw:function(){function s(a,b,d){var e=d?b.minorTicks:b.ticks,f=b.orientation===1,h=b.n===1,k,m;k={color:b.options.color||o.grid.color,angle:Flotr.toRad(b.options.labelsAngle),textBaseline:"middle"};for(l=0;l<e.length&&(d?b.options.showMinorLabels:b.options.showLabels);++l){c=e[l],c.label+="";if
 (!c.label||!c.label.length)continue;x=Math.cos(l*i+j)*g,y=Math.sin(l*i+j)*g,k.textAlign=f?Math.abs(x)<.1?"center":x<0?"right":"left":"left",Flotr.drawText(p,c.label,f?x:3,f?y:-(b.ticks[l].v/b.max)*(g-o.fontSize),k)}}function t(a,b,d,e){function j(a){return a.options.showLabels&&a.used}function k(a,b,c,d){return a.plotOffset.left+(b?d:c?-o.grid.labelMargin:o.grid.labelMargin+a.plotWidth)}function m(a,b,c,d){return a.plotOffset.top+(b?o.grid.labelMargin:d)+(b&&c?a.plotHeight:0)}var f=b.orientation===1,g=b.n===1,h,i;h={color:b.options.color||o.grid.color,textAlign:d,textBaseline:e,angle:Flotr.toRad(b.options.labelsAngle)},h=Flotr.getBestTextAlign(h.angle,h);for(l=0;l<b.ticks.length&&j(b);++l){c=b.ticks[l];if(!c.label||!c.label.length)continue;i=b.d2p(c.v);if(i<0||i>(f?a.plotWidth:a.plotHeight))continue;Flotr.drawText(p,c.label,k(a,f,g,i),m(a,f,g,i),h),!f&&!g&&(p.save(),p.strokeStyle=h.color,p.beginPath(),p.moveTo(a.plotOffset.left+a.plotWidth-8,a.plotOffset.top+b.d2p(c.v)),p.lineTo(a.p
 lotOffset.left+a.plotWidth,a.plotOffset.top+b.d2p(c.v)),p.stroke(),p.restore())}}function u(a,b){var d=b.orientation===1,e=b.n===1,g="",h,i,j,k=a.plotOffset;!d&&!e&&(p.save(),p.strokeStyle=b.options.color||o.grid.color,p.beginPath());if(b.options.showLabels&&(e?!0:b.used))for(l=0;l<b.ticks.length;++l){c=b.ticks[l];if(!c.label||!c.label.length||(d?k.left:k.top)+b.d2p(c.v)<0||(d?k.left:k.top)+b.d2p(c.v)>(d?a.canvasWidth:a.canvasHeight))continue;j=k.top+(d?(e?1:-1)*(a.plotHeight+o.grid.labelMargin):b.d2p(c.v)-b.maxLabel.height/2),h=d?k.left+b.d2p(c.v)-f/2:0,g="",l===0?g=" first":l===b.ticks.length-1&&(g=" last"),g+=d?" flotr-grid-label-x":" flotr-grid-label-y",m+=['<div style="position:absolute; text-align:'+(d?"center":"right")+"; ","top:"+j+"px; ",(!d&&!e?"right:":"left:")+h+"px; ","width:"+(d?f:(e?k.left:k.right)-o.grid.labelMargin)+"px; ",b.options.color?"color:"+b.options.color+"; ":" ",'" class="flotr-grid-label'+g+'">'+c.label+"</div>"].join(" "),!d&&!e&&(p.moveTo(k.left+a.plotW
 idth-8,k.top+b.d2p(c.v)),p.lineTo(k.left+a.plotWidth,k.top+b.d2p(c.v)))}}var b,c,d,e,f,g,h,i,j,k,l,m="",n=0,o=this.options,p=this.ctx,q=this.axes,r={size:o.fontSize};for(l=0;l<q.x.ticks.length;++l)q.x.ticks[l].label&&++n;f=this.plotWidth/n,o.grid.circular&&(p.save(),p.translate(this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+this.plotHeight/2),g=this.plotHeight*o.radar.radiusRatio/2+o.fontSize,h=this.axes.x.ticks.length,i=2*(Math.PI/h),j=-Math.PI/2,s(this,q.x,!1),s(this,q.x,!0),s(this,q.y,!1),s(this,q.y,!0),p.restore()),!o.HtmlText&&this.textEnabled?(t(this,q.x,"center","top"),t(this,q.x2,"center","bottom"),t(this,q.y,"right","middle"),t(this,q.y2,"left","middle")):(q.x.options.showLabels||q.x2.options.showLabels||q.y.options.showLabels||q.y2.options.showLabels)&&!o.grid.circular&&(m="",u(this,q.x),u(this,q.x2),u(this,q.y),u(this,q.y2),p.stroke(),p.restore(),k=a.create("div"),a.setStyles(k,{fontSize:"smaller",color:o.grid.color}),k.className="flotr-labels",a.insert(this.el
 ,k),a.insert(k,m))}})}(),function(){var a=Flotr.DOM,b=Flotr._;Flotr.addPlugin("legend",{options:{show:!0,noColumns:1,labelFormatter:function(a){return a},labelBoxBorderColor:"#CCCCCC",labelBoxWidth:14,labelBoxHeight:10,labelBoxMargin:5,container:null,position:"nw",margin:5,backgroundColor:"#F0F0F0",backgroundOpacity:.85},callbacks:{"flotr:afterinit":function(){this.legend.insertLegend()},"flotr:destroy":function(){var b=this.legend.markup;b&&(this.legend.markup=null,a.remove(b))}},insertLegend:function(){if(!this.options.legend.show)return;var c=this.series,d=this.plotOffset,e=this.options,f=e.legend,g=[],h=!1,i=this.ctx,j=b.filter(c,function(a){return a.label&&!a.hide}).length,k=f.position,l=f.margin,m=f.backgroundOpacity,n,o,p;if(j){var q=f.labelBoxWidth,r=f.labelBoxHeight,s=f.labelBoxMargin,t=d.left+l,u=d.top+l,v=0,w={size:e.fontSize*1.1,color:e.grid.color};for(n=c.length-1;n>-1;--n){if(!c[n].label||c[n].hide)continue;o=f.labelFormatter(c[n].label),v=Math.max(v,this._text.measure
 Text(o,w).width)}var x=Math.round(q+s*3+v),y=Math.round(j*(s+r)+s);!m&&m!==0&&(m=.1);if(!e.HtmlText&&this.textEnabled&&!f.container){k.charAt(0)=="s"&&(u=d.top+this.plotHeight-(l+y)),k.charAt(0)=="c"&&(u=d.top+this.plotHeight/2-(l+y/2)),k.charAt(1)=="e"&&(t=d.left+this.plotWidth-(l+x)),p=this.processColor(f.backgroundColor,{opacity:m}),i.fillStyle=p,i.fillRect(t,u,x,y),i.strokeStyle=f.labelBoxBorderColor,i.strokeRect(Flotr.toPixel(t),Flotr.toPixel(u),x,y);var z=t+s,A=u+s;for(n=0;n<c.length;n++){if(!c[n].label||c[n].hide)continue;o=f.labelFormatter(c[n].label),i.fillStyle=c[n].color,i.fillRect(z,A,q-1,r-1),i.strokeStyle=f.labelBoxBorderColor,i.lineWidth=1,i.strokeRect(Math.ceil(z)-1.5,Math.ceil(A)-1.5,q+2,r+2),Flotr.drawText(i,o,z+q+s,A+r,w),A+=r+s}}else{for(n=0;n<c.length;++n){if(!c[n].label||c[n].hide)continue;n%f.noColumns===0&&(g.push(h?"</tr><tr>":"<tr>"),h=!0);var B=c[n],C=f.labelBoxWidth,E=f.labelBoxHeight;o=f.labelFormatter(B.label),p="background-color:"+(B.bars&&B.bars.show&
 &B.bars.fillColor&&B.bars.fill?B.bars.fillColor:B.color)+";",g.push('<td class="flotr-legend-color-box">','<div style="border:1px solid ',f.labelBoxBorderColor,';padding:1px">','<div style="width:',C-1,"px;height:",E-1,"px;border:1px solid ",c[n].color,'">','<div style="width:',C,"px;height:",E,"px;",p,'"></div>',"</div>","</div>","</td>",'<td class="flotr-legend-label">',o,"</td>")}h&&g.push("</tr>");if(g.length>0){var F='<table style="font-size:smaller;color:'+e.grid.color+'">'+g.join("")+"</table>";if(f.container)F=a.node(F),this.legend.markup=F,a.insert(f.container,F);else{var G={position:"absolute",zIndex:"2",border:"1px solid "+f.labelBoxBorderColor};k.charAt(0)=="n"?(G.top=l+d.top+"px",G.bottom="auto"):k.charAt(0)=="c"?(G.top=l+(this.plotHeight-y)/2+"px",G.bottom="auto"):k.charAt(0)=="s"&&(G.bottom=l+d.bottom+"px",G.top="auto"),k.charAt(1)=="e"?(G.right=l+d.right+"px",G.left="auto"):k.charAt(1)=="w"&&(G.left=l+d.left+"px",G.right="auto");var H=a.create("div"),I;H.className="f
 lotr-legend",a.setStyles(H,G),a.insert(H,F),a.insert(this.el,H);if(!m)return;var J=f.backgroundColor||e.grid.backgroundColor||"#ffffff";b.extend(G,a.size(H),{backgroundColor:J,zIndex:"",border:""}),G.width+="px",G.height+="px",H=a.create("div"),H.className="flotr-legend-bg",a.setStyles(H,G),a.opacity(H,m),a.insert(H," "),a.insert(this.el,H)}}}}}})}(),function(){var a=Flotr.DOM;Flotr.addPlugin("titles",{callbacks:{"flotr:afterdraw":function(){this.titles.drawTitles()}},drawTitles:function(){var b,c=this.options,d=c.grid.labelMargin,e=this.ctx,f=this.axes;if(!c.HtmlText&&this.textEnabled){var g={size:c.fontSize,color:c.grid.color,textAlign:"center"};c.subtitle&&Flotr.drawText(e,c.subtitle,this.plotOffset.left+this.plotWidth/2,this.titleHeight+this.subtitleHeight-2,g),g.weight=1.5,g.size*=1.5,c.title&&Flotr.drawText(e,c.title,this.plotOffset.left+this.plotWidth/2,this.titleHeight-2,g),g.weight=1.8,g.size*=.8,f.x.options.title&&f.x.used&&(g.textAlign=f.x.options.titleAlign||"center",g.t
 extBaseline="top",g.angle=Flotr.toRad(f.x.options.titleAngle),g=Flotr.getBestTextAlign(g.angle,g),Flotr.drawText(e,f.x.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top+f.x.maxLabel.height+this.plotHeight+2*d,g)),f.x2.options.title&&f.x2.used&&(g.textAlign=f.x2.options.titleAlign||"center",g.textBaseline="bottom",g.angle=Flotr.toRad(f.x2.options.titleAngle),g=Flotr.getBestTextAlign(g.angle,g),Flotr.drawText(e,f.x2.options.title,this.plotOffset.left+this.plotWidth/2,this.plotOffset.top-f.x2.maxLabel.height-2*d,g)),f.y.options.title&&f.y.used&&(g.textAlign=f.y.options.titleAlign||"right",g.textBaseline="middle",g.angle=Flotr.toRad(f.y.options.titleAngle),g=Flotr.getBestTextAlign(g.angle,g),Flotr.drawText(e,f.y.options.title,this.plotOffset.left-f.y.maxLabel.width-2*d,this.plotOffset.top+this.plotHeight/2,g)),f.y2.options.title&&f.y2.used&&(g.textAlign=f.y2.options.titleAlign||"left",g.textBaseline="middle",g.angle=Flotr.toRad(f.y2.options.titleAngle),g=Flotr.getB
 estTextAlign(g.angle,g),Flotr.drawText(e,f.y2.options.title,this.plotOffset.left+this.plotWidth+f.y2.maxLabel.width+2*d,this.plotOffset.top+this.plotHeight/2,g))}else{b=[],c.title&&b.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;font-size:1em;font-weight:bold;text-align:center;width:",this.plotWidth,'px;" class="flotr-title">',c.title,"</div>"),c.subtitle&&b.push('<div style="position:absolute;top:',this.titleHeight,"px;left:",this.plotOffset.left,"px;font-size:smaller;text-align:center;width:",this.plotWidth,'px;" class="flotr-subtitle">',c.subtitle,"</div>"),b.push("</div>"),b.push('<div class="flotr-axis-title" style="font-weight:bold;">'),f.x.options.title&&f.x.used&&b.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight+c.grid.labelMargin+f.x.titleSize.height,"px;left:",this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",f.x.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x1">',f.x.options.title,"
 </div>"),f.x2.options.title&&f.x2.used&&b.push('<div style="position:absolute;top:0;left:',this.plotOffset.left,"px;width:",this.plotWidth,"px;text-align:",f.x2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-x2">',f.x2.options.title,"</div>"),f.y.options.title&&f.y.used&&b.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-f.y.titleSize.height/2,"px;left:0;text-align:",f.y.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y1">',f.y.options.title,"</div>"),f.y2.options.title&&f.y2.used&&b.push('<div style="position:absolute;top:',this.plotOffset.top+this.plotHeight/2-f.y.titleSize.height/2,"px;right:0;text-align:",f.y2.options.titleAlign,';" class="flotr-axis-title flotr-axis-title-y2">',f.y2.options.title,"</div>"),b=b.join("");var h=a.create("div");a.setStyles({color:c.grid.color}),h.className="flotr-titles",a.insert(this.el,h),a.insert(h,b)}}})}(),function(){function b(){var b=this.options,c=this.handles,d=this.el,e,f,g,h
 ;if(!b.selection.mode||!b.handles.show||"ontouchstart"in d)return;c.initialized=!0,h=a.node('<div class="flotr-handles"></div>'),b=b.handles,b.drag&&(g=a.node('<div class="flotr-handles-handle flotr-handles-drag flotr-handles-right"></div>'),f=a.node('<div class="flotr-handles-handle flotr-handles-drag flotr-handles-left"></div>'),a.insert(h,g),a.insert(h,f),a.hide(f),a.hide(g),c.left=f,c.right=g,this.observe(f,"mousedown",function(){c.moveHandler=i}),this.observe(g,"mousedown",function(){c.moveHandler=j})),b.scroll&&(e=a.node('<div class="flotr-handles-handle flotr-handles-scroll"></div>'),a.insert(h,e),a.hide(e),c.scroll=e,this.observe(e,"mousedown",function(){c.moveHandler=k})),this.observe(document,"mouseup",function(){c.moveHandler=null}),a.insert(d,h)}function c(a){if(!this.handles.initialized)return;var b=this.handles,c=this.options.handles,f=b.left,g=b.right,h=b.scroll;c&&(c.drag&&(d(this,f,a.x1),d(this,g,a.x2)),c.scroll&&e(this,h,a.x1,a.x2))}function d(b,c,d){a.show(c);var 
 e=a.size(c),f=Math.round(b.axes.x.d2p(d)-e.width/2),g=(b.plotHeight-e.height)/2;a.setStyles(c,{left:f+"px",top:g+"px"})}function e(b,c,d,e){a.show(c);var f=a.size(c),g=Math.round(b.axes.x.d2p(d)),h=b.plotHeight-f.height/2,i=b.axes.x.d2p(e)-b.axes.x.d2p(d);a.setStyles(c,{left:g+"px",top:h+"px",width:i+"px"})}function f(){if(!this.handles.initialized)return;var b=this.handles;b&&(a.hide(b.left),a.hide(b.right),a.hide(b.scroll))}function g(a,b){if(!this.handles.initialized)return;if(!this.handles.moveHandler)return;var c=b.x-this.lastMousePos.x,d=this.selection.selection,e=this.selection.getArea(),f=this.handles;f.moveHandler(e,c),h(e,f),this.selection.setSelection(e)}function h(a,b){var c=b.moveHandler;a.x1>a.x2&&(c==i?c=j:c==j&&(c=i),b.moveHandler=c)}function i(a,b){a.x1+=b}function j(a,b){a.x2+=b}function k(a,b){a.x1+=b,a.x2+=b}var a=Flotr.DOM;Flotr.addPlugin("handles",{options:{show:!1,drag:!0,scroll:!0},callbacks:{"flotr:afterinit":b,"flotr:select":c,"flotr:mousedown":f,"flotr:mou
 semove":g}})}(),function(){var a=Flotr.EventAdapter,b=Flotr._;Flotr.addPlugin("graphGrid",{callbacks:{"flotr:beforedraw":function(){this.graphGrid.drawGrid()},"flotr:afterdraw":function(){this.graphGrid.drawOutline()}},drawGrid:function(){function p(a){for(n=0;n<a.length;++n){var b=a[n].v/l.max;for(o=0;o<=u;++o)c[o===0?"moveTo":"lineTo"](Math.cos(o*v+w)*t*b,Math.sin(o*v+w)*t*b)}}function q(a,d){b.each(b.pluck(a,"v"),function(a){if(a<=l.min||a>=l.max||(a==l.min||a==l.max)&&e.outlineWidth)return;d(Math.floor(l.d2p(a))+c.lineWidth/2)})}function r(a){c.moveTo(a,0),c.lineTo(a,j)}function s(a){c.moveTo(0,a),c.lineTo(k,a)}var c=this.ctx,d=this.options,e=d.grid,f=e.verticalLines,g=e.horizontalLines,h=e.minorVerticalLines,i=e.minorHorizontalLines,j=this.plotHeight,k=this.plotWidth,l,m,n,o;(f||h||g||i)&&a.fire(this.el,"flotr:beforegrid",[this.axes.x,this.axes.y,d,this]),c.save(),c.lineWidth=1,c.strokeStyle=e.tickColor;if(e.circular){c.translate(this.plotOffset.left+k/2,this.plotOffset.top+j/2
 );var t=Math.min(j,k)*d.radar.radiusRatio/2,u=this.axes.x.ticks.length,v=2*(Math.PI/u),w=-Math.PI/2;c.beginPath(),l=this.axes.y,g&&p(l.ticks),i&&p(l.minorTicks),f&&b.times(u,function(a){c.moveTo(0,0),c.lineTo(Math.cos(a*v+w)*t,Math.sin(a*v+w)*t)}),c.stroke()}else c.translate(this.plotOffset.left,this.plotOffset.top),e.backgroundColor&&(c.fillStyle=this.processColor(e.backgroundColor,{x1:0,y1:0,x2:k,y2:j}),c.fillRect(0,0,k,j)),c.beginPath(),l=this.axes.x,f&&q(l.ticks,r),h&&q(l.minorTicks,r),l=this.axes.y,g&&q(l.ticks,s),i&&q(l.minorTicks,s),c.stroke();c.restore(),(f||h||g||i)&&a.fire(this.el,"flotr:aftergrid",[this.axes.x,this.axes.y,d,this])},drawOutline:function(){var a=this,b=a.options,c=b.grid,d=c.outline,e=a.ctx,f=c.backgroundImage,g=a.plotOffset,h=g.left,j=g.top,k=a.plotWidth,l=a.plotHeight,m,n,o,p,q,r;if(!c.outlineWidth)return;e.save();if(c.circular){e.translate(h+k/2,j+l/2);var s=Math.min(l,k)*b.radar.radiusRatio/2,t=this.axes.x.ticks.length,u=2*(Math.PI/t),v=-Math.PI/2;e.beg
 inPath(),e.lineWidth=c.outlineWidth,e.strokeStyle=c.color,e.lineJoin="round";for(i=0;i<=t;++i)e[i===0?"moveTo":"lineTo"](Math.cos(i*u+v)*s,Math.sin(i*u+v)*s);e.stroke()}else{e.translate(h,j);var w=c.outlineWidth,x=.5-w+(w+1)%2/2,y="lineTo",z="moveTo";e.lineWidth=w,e.strokeStyle=c.color,e.lineJoin="miter",e.beginPath(),e.moveTo(x,x),k-=w/2%1,l+=w/2,e[d.indexOf("n")!==-1?y:z](k,x),e[d.indexOf("e")!==-1?y:z](k,l),e[d.indexOf("s")!==-1?y:z](x,l),e[d.indexOf("w")!==-1?y:z](x,x),e.stroke(),e.closePath()}e.restore(),f&&(o=f.src||f,p=(parseInt(f.left,10)||0)+g.left,q=(parseInt(f.top,10)||0)+g.top,n=new Image,n.onload=function(){e.save(),f.alpha&&(e.globalAlpha=f.alpha),e.globalCompositeOperation="destination-over",e.drawImage(n,0,0,n.width,n.height,p,q,k,l),e.restore()},n.src=o)}})}(),!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"?module.exports=b():this[a]=b()}("bonzo",function(){function a(a){return new RegExp("(^|\\s+)"+a+"(\\s+|$)")}function b(a,b,c){for(v
 ar d=0,e=a.length;d<e;d++)b.call(c||a[d],a[d],d,a);return a}function c(a){return a.replace(/-(.)/g,function(a,b){return b.toUpperCase()})}function d(a){return a&&a.nodeName&&a.nodeType==1}function e(a,b,c,d){for(d=0,j=a.length;d<j;++d)if(b.call(c,a[d],d,a))return!0;return!1}function f(a,c,d){var e=0,f=c||this,g=[],h=w&&typeof a=="string"&&a.charAt(0)!="<"?function(b){return(b=w(a))&&(b.selected=1)&&b}():a;return b(m(h),function(a){b(f,function(b){var c=!b[v]||b[v]&&!b[v][v]?function(){var a=b.cloneNode(!0);return f.$&&f.cloneEvents&&f.$(a).cloneEvents(b),a}():b;d(a,c),g[e]=c,e++})},this),b(g,function(a,b){f[b]=a}),f.length=e,f}function g(a,b,c){var d=q(a),e=d.css("position"),f=d.offset(),g="relative",h=e==g,i=[parseInt(d.css("left"),10),parseInt(d.css("top"),10)];e=="static"&&(d.css("position",g),e=g),isNaN(i[0])&&(i[0]=h?0:a.offsetLeft),isNaN(i[1])&&(i[1]=h?0:a.offsetTop),b!=null&&(a.style.left=b-f.left+i[0]+G),c!=null&&(a.style.top=c-f.top+i[1]+G)}function h(b,c){return a(c).test(
 b.className)}function i(a,b){a.className=M(a.className+" "+b)}function k(b,c){b.className=M(b.className.replace(a(c)," "))}function l(a){this.length=0;if(a){a=typeof a!="string"&&!a.nodeType&&typeof a.length!="undefined"?a:[a],this.length=a.length;for(var b=0;b<a.length;b++)this[b]=a[b]}}function m(a){return typeof a=="string"?q.create(a):d(a)?[a]:a}function n(a,b,c){var d=this[0];return a==null&&b==null?(o(d)?p():{x:d.scrollLeft,y:d.scrollTop})[c]:(o(d)?s.scrollTo(a,b):(a!=null&&(d.scrollLeft=a),b!=null&&(d.scrollTop=b)),this)}function o(a){return a===s||/^(?:body|html)$/i.test(a.tagName)}function p(){return{x:s.pageXOffset||u.scrollLeft,y:s.pageYOffset||u.scrollTop}}function q(a,b){return new l(a,b)}var r=this,s=window,t=s.document,u=t.documentElement,v="parentNode",w=null,x=/^checked|value|selected$/,y=/select|fieldset|table|tbody|tfoot|td|tr|colgroup/i,z="table",A={thead:z,tbody:z,tfoot:z,tr:"tbody",th:"tr",td:"tr",fieldset:"form",option:"select"},B=/^checked|selected$/,C=/msie/
 i.test(navigator.userAgent),D=[],E=0,F=/^-?[\d\.]+$/,G="px",H="setAttribute",I="getAttribute",J=/(^\s*|\s*$)/g,K={lineHeight:1,zoom:1,zIndex:1,opacity:1},L=function(){var a=["webkitTransform","MozTransform","OTransform","msTransform","Transform"],b;for(b=0;b<a.length;b++)if(a[b]in t.createElement("a").style)return a[b]}(),M=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(J,"")},N=t.defaultView&&t.defaultView.getComputedStyle?function(a,b){b=b=="transform"?L:b,b=b=="transform-origin"?L+"Origin":b;var d=null;b=="float"&&(b="cssFloat");var e=t.defaultView.getComputedStyle(a,"");return e&&(d=e[c(b)]),a.style[b]||d}:C&&u.currentStyle?function(a,b){b=c(b),b=b=="float"?"styleFloat":b;if(b=="opacity"){var d=100;try{d=a.filters["DXImageTransform.Microsoft.Alpha"].opacity}catch(e){try{d=a.filters("alpha").opacity}catch(f){}}return d/100}var g=a.currentStyle?a.currentStyle[b]:null;return a.style[b]||g}:function(a,b){return a.style[c(b)]};l.prototype={get:functio
 n(a){return this[a]},each:function(a,c){return b(this,a,c)},map:function(a,b){var c=[],d,e;for(e=0;e<this.length;e++)d=a.call(this,this[e],e),b?b(d)&&c.push(d):c.push(d);return c},first:function(){return q(this[0])},last:function(){return q(this[this.length-1])},html:function(a,c){function d(c){while(c.firstChild)c.removeChild(c.firstChild);b(m(a),function(a){c.appendChild(a)})}var e=c?u.textContent===null?"innerText":"textContent":"innerHTML",f;return typeof a!="undefined"?this.each(function(b){(f=b.tagName.match(y))?d(b,f[0]):b[e]=a}):this[0]?this[0][e]:""},text:function(a){return this.html(a,1)},addClass:function(a){return this.each(function(b){h(b,a)||i(b,a)})},removeClass:function(a){return this.each(function(b){h(b,a)&&k(b,a)})},hasClass:function(a){return e(this,function(b){return h(b,a)})},toggleClass:function(a,b){return this.each(function(c){typeof b!="undefined"?b?i(c,a):k(c,a):h(c,a)?k(c,a):i(c,a)})},show:function(a){return this.each(function(b){b.style.display=a||""})},
 hide:function(a){return this.each(function(a){a.style.display="none"})},append:function(a){return this.each(function(c){b(m(a),function(a){c.appendChild(a)})})},prepend:function(a){return this.each(function(c){var d=c.firstChild;b(m(a),function(a){c.insertBefore(a,d)})})},appendTo:function(a,b){return f.call(this,a,b,function(a,b){a.appendChild(b)})},prependTo:function(a,b){return f.call(this,a,b,function(a,b){a.insertBefore(b,a.firstChild)})},next:function(){return this.related("nextSibling")},previous:function(){return this.related("previousSibling")},related:function(a){return this.map(function(b){b=b[a];while(b&&b.nodeType!==1)b=b[a];return b||0},function(a){return a})},before:function(a){return this.each(function(c){b(q.create(a),function(a){c[v].insertBefore(a,c)})})},after:function(a){return this.each(function(c){b(q.create(a),function(a){c[v].insertBefore(a,c.nextSibling)})})},insertBefore:function(a,b){return f.call(this,a,b,function(a,b){a[v].insertBefore(b,a)})},insertAft
 er:function(a,b){return f.call(this,a,b,function(a,b){var c=a.nextSibling;c?a[v].insertBefore(b,c):a[v].appendChild(b)})},css:function(a,b,d){function e(a,b,d){for(var e in f)f.hasOwnProperty(e)&&(d=f[e],(b=c(e))&&F.test(d)&&!(b in K)&&(d+=G),b=b=="transform"?L:b,b=b=="transformOrigin"?L+"Origin":b,a.style[b]=d)}if(b===undefined&&typeof a=="string")return b=this[0],b?b==t||b==s?(d=b==t?q.doc():q.viewport(),a=="width"?d.width:a=="height"?d.height:""):N(b,a):null;var f=a;typeof a=="string"&&(f={},f[a]=b),C&&f.opacity&&(f.filter="alpha(opacity="+f.opacity*100+")",f.zoom=a.zoom||1,delete f.opacity);if(b=f["float"])C?f.styleFloat=b:f.cssFloat=b,delete f["float"];return this.each(e)},offset:function(a,b){if(typeof a=="number"||typeof b=="number")return this.each(function(c){g(c,a,b)});var c=this[0],d=c.offsetWidth,e=c.offsetHeight,f=c.offsetTop,h=c.offsetLeft;while(c=c.offsetParent)f+=c.offsetTop,h+=c.offsetLeft;return{top:f,left:h,height:e,width:d}},attr:function(a,b){var c=this[0];if(ty
 peof a=="string"||a instanceof String)return typeof b=="undefined"?x.test(a)?B.test(a)&&typeof c[a]=="string"?!0:c[a]:c[I](a):this.each(function(c){x.test(a)?c[a]=b:c[H](a,b)});for(var d in a)a.hasOwnProperty(d)&&this.attr(d,a[d]);return this},val:function(a){return typeof a=="string"?this.attr("value",a):this[0].value},removeAttr:function(a){return this.each(function(b){B.test(a)?b[a]=!1:b.removeAttribute(a)})},data:function(a,b){var c=this[0];if(typeof b=="undefined"){c[I]("data-node-uid")||c[H]("data-node-uid",++E);var d=c[I]("data-node-uid");return D[d]||(D[d]={}),D[d][a]}return this.each(function(c){c[I]("data-node-uid")||c[H]("data-node-uid",++E);var d=c[I]("data-node-uid"),e=D[d]||(D[d]={});e[a]=b})},remove:function(){return this.each(function(a){a[v]&&a[v].removeChild(a)})},empty:function(){return this.each(function(a){while(a.firstChild)a.removeChild
 (a.firstChild)})},detach:function(){return this.map(function(a){return a[v].removeChild(a)})},scrollTop:function(a){return n.call(this,null,a,"y")},scrollLeft:function(a){return n.call(this,a,null,"x")},toggle:function(a){return this.each(function(a){a.style.display=a.offsetWidth||a.offsetHeight?"none":"block"}),a&&a(),this}},q.setQueryEngine=function(a){w=a,delete q.setQueryEngine},q.aug=function(a,b){for(var c in a)a.hasOwnProperty(c)&&((b||l.prototype)[c]=a[c])},q.create=function(a){return typeof a=="string"?function(){var b=/^<([^\s>]+)/.exec(a),c=t.createElement(b&&A[b[1].toLowerCase()]||"div"),d=[];c.innerHTML=a;var e=c.childNodes;c=c.firstChild,d.push(c);while(c=c.nextSibling)c.nodeType==1&&d.push(c);return d}():d(a)?[a.cloneNode(!0)]:[]},q.doc=function(){var a=this.viewport();return{width:Math.max(t.body.scrollWidth,u.scrollWidth,a.width),height:Math.max(t.body.scrollHeight,u.scrollHeight,a.height)}},q.firstChild=function(a){for(var b=a.childNodes,c=0,d=b&&b.length||0,e;c<d;
 c++)b[c].nodeType===1&&(e=b[d=c]);return e},q.viewport=function(){return{width:C?u.clientWidth:self.innerWidth,height:C?u.clientHeight:self.innerHeight}},q.isAncestor="compareDocumentPosition"in u?function(a,b){return(a.compareDocumentPosition(b)&16)==16}:"contains"in u?function(a,b){return a!==b&&a.contains(b)}:function(a,b){while(b=b[v])if(b===a)return!0;return!1};var O=r.bonzo;return q.noConflict=function(){return r.bonzo=O,this},q});var envision={_:Flotr._,bean:Flotr.bean,bonzo:bonzo,noConflict:function(a){var b=a.envision;return function(){return a.envision=b,this}}(this)};(function(){function d(a){this.options=a||{},this.components=[],this.node=null,this.rendered=!1}var a="envision-first",b="envision-last",c='<div class="envision-visualization"></div>';T_COMPONENT_CONTAINER='<div class="envision-component-container"></div>',d.prototype={render:function(a){var b=this.options;a=a||b.element;if(!a)throw"No element to render within.";return this.node=bonzo.create(c)[0],bonzo(this.
 node).addClass(b.name||""),this.container=a,bonzo(a).append(this.node),bonzo(a).data("envision",this),_.each(this.components,function(a){this._renderComponent(a)},this),this._updateClasses(),this.rendered=!0,this},add:function(a){return this.components.push(a),this.rendered&&(this._renderComponent(a),this._updateClasses()),this},remove:function(a){var b=this.components,c=this.indexOf(a);return c!==-1&&(b.splice(c,1),bonzo(a.container).remove(),this._updateClasses()),this},setPosition:function(a,b){var c=this.components;return b>=0&&b<c.length&&this.remove(a)&&(this.rendered&&(b===c.length?this.node.appendChild(a.container):this.node.insertBefore(a.container,c[b].container)),c.splice(b,0,a),this._updateClasses()),this},indexOf:function(a){return _.indexOf(this.components,a)},getComponent:function(a){var b=this.components;if(a<b.length)return b[a]},isFirst:function(a){return this.indexOf(a)===0?!0:!1},isLast:function(a){return this.indexOf(a)===this.components.length-1?!0:!1},destroy:
 function(){_.each(this.components,function(a){a.destroy()}),bonzo(this.container).empty()},_renderComponent:function(a){var b=bonzo.create(T_COMPONENT_CONTAINER)[0];bonzo(this.node).append(b),a.render(b)},_updateClasses:function(){var c=this.components,d=0,e=c.length-1,f;_.each(c,function(c,g){f=bonzo(c.container),g===d?f.addClass(a):f.removeClass(a),g===e?f.addClass(b):f.removeClass(b)})}},envision.Visualization=d})(),function(){function d(b){b=b||{};var d=bonzo.create(c)[0];this.options=b,this.node=d,b.adapter?this.api=b.adapter:b.adapterConstructor?this.api=new b.adapterConstructor(b.config):b.adapterCallback?this.api=b.adapterCallback.call(null,b.config):b.config&&(this.api=new a.adapters.flotr.Child(b.config||{})),this.preprocessors=[]}var a=envision,b="envision-component",c='<div class="'+b+'"></div>';d.prototype={render:function(a){var b=this.node,c=this.options;a=a||c.element;if(!a)throw"No element to render within.";bonzo(a).addClass(c.name||"").append(this.node),this._setD
 imension("width"),this._setDimension("height"),this.container=a,this.draw(c.data,c.config)},draw:function(b,c){var d=this.api,e=this.options,f=this.preprocessors,g;g=b=b||e.data,c=c||e.config,!e.skipPreprocess&&b&&(g=[],_.each(d.getDataArray(b),function(h,i){var j=f[i]||new a.Preprocessor,k=_.isArray(h),l=_.isFunction(h),m=k?h:l?h:h.data,n=e.processData,o=d.range(c),p=o.min,q=o.max,r=this.node.clientWidth,s=h,t,u;!l&&!k&&(s=h.data,u=_.extend({},h)),l?t=b(p,q,r):(s!==j.data?j.setData(s):j.reset(),n?(n.apply(this,[{preprocessor:j,min:p,max:q,resolution:r}]),t=j.getData()):t=j.bound(p,q).subsampleMinMax(r).getData()),d.transformData&&(t=d.transformData(t)),u?(u.data=t,g.push(u)):g.push(t)},this)),d&&d.draw(g,c,this.node)},trigger:function(){this.api.trigger.apply(this.api,Array.prototype.concat.apply([this],arguments))},attach:function(){this.api.attach.apply(this.api,Array.prototype.concat.apply([this],arguments))},detach:function(){this.api.detach.apply(this.api,Array.prototype.conca
 t.apply([this],arguments))},destroy:function(){this.api&&this.api.destroy&&this.api.destroy(),bonzo(this.container).empty()},_setDimension:function(a){var b=this.node,c=this.options;c[a]?bonzo(b).css(a,c[a]):c[a]=b.clientWidth,this[a]=c[a]}},a.Component=d}(),function(){function b(a){this.options=a=a||{},this.actions=[],this.actionOptions=[],this.followers=[],this.leaders=[],this.prevent={},a.leader&&this.leader(a.leader)}var a=envision;b.prototype={leader:function(a){return this.leaders.push(a),_.each(this.actions,function(b,c){this._bindLeader(a,b,this.actionOptions[c])},this),this},follower:function(a){return this.followers.push(a),this},group:function(a){return _.isArray(a)||(a=[a]),_.each(a,function(a){this.leader(a),this.follower(a)},this),this},add:function(a,b){return this.actions.push(a),this.actionOptions.push(b),_.each(this.leaders,function(c){this._bindLeader(c,a,b)},this),this},_bindLeader:function(a,b,c){_.each(b.events,function(b){var d=b.handler||b,e=b.consumer||b;a.a
 ttach(d,_.bind(function(a,b){if(this.prevent[name])return;c&&c.callback&&c.callback.call(this,b),this.prevent[name]=!0;try{_.each(this.followers,function(c){if(a===c)return;c.trigger(e,b)},this)}catch(d){throw this.prevent[name]=!1,d}this.prevent[name]=!1},this))},this)}},a.Interaction=b}(),function(){function a(a){a=a||{},this.getData=function(){return this.bounded&&d(this),this.processing},this.reset=function(){return this.processing=this.data,this},this.setData=function(a){var b,c;if(!_.isArray(a))throw new Error("Array expected.");if(a.length<2)throw new Error("Data must contain at least two dimensions.");c=a[0].length;for(b=a.length;b--;){if(!_.isArray(a[b]))throw new Error("Data dimensions must be arrays.");if(a[b].length!==c)throw new Error("Data dimensions must contain the same number of points.")}return this.processing=a,this.data=a,this},a.data&&this.setData(a.data)}function b(a,b){var c=_.sortedIndex(a,b);return a[c]>b&&c>0&&c--,c}function c(a,b){return _.sortedIndex(a,b)
 }function d(a){delete a.bounded;var d=a.processing,e=a.length(),f=d[0],g=d[1],h=a.min||0,i=a.max||e,j=b(f,h),k=c(f,i);a.processing=[f.slice(j,k+1),g.slice(j,k+1)],a.start=j,a.end=k}function e(a,b,c,d,e,f,g,h,i){var j=(a-d)/(f-d),k=1-j,l=(1+2*j)*k*k,m=j*k*k,n=j*j*(3-2*j),o=j*j*(j-1),p=(g-e)/(2*(f-d))+(typeof c=="undefined"?0:(e-c)/(2*(d-b))),q=(typeof i=="undefined"?0:(i-g)/(2*(h-f)))+(g-e)/(2*(f-d)),r=l*e+m*(f-d)*p+n*g+o*(f-d)*q;return r}a.prototype={length:function(){return this.getData()[0].length},bound:function(a,b){return!_.isNumber(a)||!_.isNumber(b)?this:(this.min=a,this.max=b,this.bounded=!0,this)},subsampleMinMax:function(a){var d=this.bounded;delete this.bounded;var e=this.processing,f=this.length(),g=e[0],h=e[1],i=d?b(g,this.min):0,j=d?c(g,this.max):f-1,k=(a-2)/2,l=[],m=[],n=Number.MAX_VALUE,o=-Number.MAX_VALUE,p=1,q=1,r=(j-i)/k,s,t,u,v;if(j-i+1>a){l.push(g[i]),m.push(h[i]),s=i+r;for(u=i;u<j;u++)u===Math.round(s)?(s+=r,v=Math.min(q,p),l.push(g[v]),m.push(h[v]),v=Math.max(
 q,p),l.push(g[v]),m.push(h[v]),p=u,n=h[p],q=u,o=h[q]):(h[u]>o&&(o=h[u],q=u),h[u]<n&&(n=h[u],p=u));u<s&&(l.push(g[p]),m.push(n),l.push(g[q]),m.push(o)),l.push(g[j]),m.push(h[j]),this.processing=[l,m],this.start=i,this.end=j}else this.bounded=d;return this},subsample:function(a){var d=this.bounded;delete this.bounded;var e=this.processing,f=this.length(),g=e[0],h=e[1],i=d?b(g,this.min):0,j=d?c(g,this.max):f-1,k=(j-i+1)/a,l=[],m=[],n,o;if(j-i+1>a){l.push(g[i]),m.push(h[i]);for(n=1;n<a;n++){if(n*k>=j-k)break;o=Math.round(n*k)+i,l.push(g[o]),m.push(h[o])}l.push(g[j]),m.push(h[j]),this.processing=[l,m],this.start=i,this.end=j}else this.bounded=d;return this},interpolate:function(a){var d=this.bounded;delete this.bounded;var f=this.processing,g=this.length(),h=f[0],i=f[1],j=d?b(h,this.min):0,k=d?c(h,this.max):g-1,l=(h[k]-h[j])/a,m=[],n=[],o,p,q;m.push(h[j]),n.push(i[j]);if(k-j+1<a){for(o=j;o<k;o++){q=h[o+1]-h[o],m.push(h[o]),n.push(i[o]);for(p=h[o+0]+l;p<h[o+1];p+=l)m.push(p),n.push(e(p,h[
 o-1],i[o-1],h[o+0],i[o+0],h[o+1],i[o+1],h[o+2],i[o+2]))}this.processing=[m,n],this.start=j,this.end=k}return this}},envision.Preprocessor=a}(),envision.actions=envision.actions||{},envision.actions.hit={events:["hit","mouseout"]},envision.actions.selection={events:[{handler:"select",consumer:"zoom"},{handler:"click",consumer:"reset"}]},envision.actions.zoom={events:[{handler:"select",consumer:"zoom"},"zoom","reset"]},envision.adapters=envision.adapters||{},envision.adapters.flotr={},envision.adapters.defaultOptions={grid:{outlineWidth:0,labelMargin:0,horizontalLines:!1,verticalLines:!1},bars:{show:!1,barWidth:.5,fill:!0,lineWidth:1,fillOpacity:1},lines:{lineWidth:1},xaxis:{margin:!1,tickDecimals:0,showLabels:!1},yaxis:{margin:!1,showLabels:!1},shadowSize:!1},function(){function e(a){this.options=a||{},this.flotr=null,this._flotrDefaultOptions()}function f(a,b){var c=a.options.config.selection.mode,d=a.api.flotr.axes,e,f,g,h,i;return c.indexOf("x")!==-1&&(e={},e.min=b.x1,e.max=b.x2,g
 ={},g.min=d.x.d2p(b.x1),g.max=d.x.d2p(b.x2)),c.indexOf("y")!==-1&&(f={},f.min=b.y1,f.max=b.y2,h={},h.min=d.y.d2p(b.y1),h.max=d.y.d2p(b.y2)),i={data:{x:e,y:f},x:g,y:h},i}var a=envision,b=envision.adapters,c=Flotr.EventAdapter,d=b.defaultOptions;e.prototype={destroy:function(){this.flotr.destroy()},draw:function(a,b,c){var d=this.options;a=this.getDataArray(a||d.data),b?b=Flotr.merge(b,Flotr.clone(d)):b=d,d.data=a;if(!b)throw"No graph submitted.";this.flotr=Flotr.draw(c,a,b)},range:function(a){var b=a.xaxis;return{min:b.min,max:b.max}},transformData:function(a){var b=a[0].length,c=a.length,d=[],e,f,g;for(f=0;f<b;f++){e=[];for(g=0;g<c;g++)e.push(a[g][f]);d.push(e)}return d},getDataArray:function(a){return a[0]&&(!_.isArray(a[0])||!a[0].length||a[0][0]&&_.isArray(a[0][0]))?a:[a]},_flotrDefaultOptions:function(a){var b=a||this.options,c;for(c in d)d.hasOwnProperty(c)&&(_.isUndefined(b[c])?b[c]=d[c]:_.defaults(b[c],d[c]))},attach:function(a,b,d){var e=this.events[b]||{},f=e.handler||!1;re
 turn b=e.name||!1,f?c.observe(a.node,b,function(){var b=[a].concat(Array.prototype.slice.call(arguments)),c=f.apply(this,b);return d.apply(null,[a,c])}):!1},detach:function(a,b,d){return c.stopObserve(a.node,b,handler)},trigger:function(a,b,c){var d=this.events[b],e=d.consumer||!1;return e?e.apply(this,[a,c]):!1},events:{hit:{name:"flotr:hit",handler:function(a,b){var c=b.x,d=b.y,e=a.api.flotr,f;return f={data:{index:b.index,x:c,y:d},x:e.axes.x.d2p(c),y:e.axes.y.d2p(d)},f},consumer:function(a,b){var c=a.api.flotr,d;d={x:b.data.x,y:b.data.y||1,relX:b.x,relY:b.y||1},c.hit.hit(d)}},select:{name:"flotr:selecting",handler:f,consumer:function(a,b){var c=a.api.flotr,d=c.axes,e=b.data||{},f={},g=b.x,h=b.y;!g&&e.x?(g=e.x,f.x1=g.min,f.x2=g.max):g&&(f.x1=d.x.p2d(g.min),f.x2=d.x.p2d(g.max)),!h&&e.y?(h=e.y,f.y1=h.min,f.y2=h.max):h&&(f.y1=d.y.d2p(h.min),f.y2=d.y.d2p(h.max)),c.selection.setSelection(f)}},zoom:{name:"flotr:select",handler:function(a,b){var c=f(a,b);return a.trigger("zoom",c),c},con
 sumer:function(a,b){var c=b.data.x,d=b.data.y,e={};c&&(e.xaxis={min:c.min,max:c.max}),d&&(e.yaxis={min:d.min,max:d.max}),a.draw(null,e)}},mouseout:{name:"flotr:mouseout",handler:function(a){},consumer:function(a){a.api.flotr.hit.clearHit()}},reset:{name:"flotr:click",handler:function(a){a.draw()},consumer:function(a){a.draw()}},click:{name:"flotr:click",handler:function(a){var b=a.api.flotr.axes.x.min,c=a.api.flotr.axes.x.max;return{data:{x:{min:b,max:c}},x:{min:a.api.flotr.axes.x.d2p(b),max:a.api.flotr.axes.x.d2p(c)}}},consumer:function(a,b){var c=b.data.x,d=b.data.y,e={};c&&(e.xaxis={min:c.min,max:c.max}),d&&(e.yaxis={min:d.min,max:d.max}),a.draw(null,e)}}}},b.flotr.Child=e}(),Flotr.addType("lite-lines",{options:{show:!1,lineWidth:2,fill:!1,fillBorder:!1,fillColor:null,fillOpacity:.4},draw:function(a){var b=a.context,c=a.lineWidth,d=a.shadowSize,e;b.save(),b.lineCap="butt",b.lineWidth=c,b.strokeStyle=a.color,this.plot(a),b.restore()},plot:function(a){var b=a.context,c=a.xScale,d=a
 .yScale,e=a.data,f=e.length-1,g=d(0),h,j;if(f<1)return;h=c(e[0][0]),j=d(e[0][1]),b.beginPath(),b.moveTo(h,j);for(i=0;i<f;++i)b.lineTo(c(e[i+1][0]),d(e[i+1][1]));(!a.fill||a.fill&&!a.fillBorder)&&b.stroke(),a.fill&&(h=c(e[0][0]),b.fillStyle=a.fillStyle,b.lineTo(c(e[f][0]),g),b.lineTo(h,g),b.lineTo(h,d(e[0][1])),b.fill(),a.fillBorder&&b.stroke())},extendYRange:function(a,b,c,d){var e=a.options;if(!e.max&&e.max!==0||!e.min&&e.min!==0)a.max+=c.lineWidth*.01,a.min-=c.lineWidth*.01}}),Flotr.addType("whiskers",{options:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,fillOpacity:.4,horizontal:!1,stacked:!1,centered:!0},stack:{positive:[],negative:[],_positive:[],_negative:[]},draw:function(a){var b=a.context;b.save(),b.lineJoin="miter",b.lineCap="butt",b.lineWidth=a.lineWidth,b.strokeStyle=a.color,a.fill&&(b.fillStyle=a.fillStyle),this.plot(a),b.restore()},plot:function(a){var b=a.data,c=a.context,d=a.shadowSize,e=a.xScale,f=a.yScale,g=f(0),h,i;if(b.length<1)return;c.translate(-a.lin
 eWidth,0),c.beginPath();for(h=0;h<b.length;h++)i=e(b[h][0]),c.moveTo(i,g),c.lineTo(i,f(b[h][1]));c.closePath(),c.stroke()},drawHit:function(a){var b=a.args,c=a.context,d=a.shadowSize,e=a.xScale,f=a.yScale,g=f(0),h=e(b.x),i=f(b.y);c.save(),c.translate(-a.lineWidth,0),c.beginPath(),c.moveTo(h,g),c.lineTo(h,i),c.closePath(),c.stroke(),c.restore()},clearHit:function(a){var b=a.args,c=a.context,d=a.shadowSize,e=a.xScale,f=a.yScale,g=a.lineWidth,h=f(0),i=e(b.x),j=f(b.y);c.save(),c.clearRect(i-2*g,j-g,4*g,h-j+g),c.restore()}}),envision.components=envision.components||{},function(){function a(a){this.options=a||{}}a.prototype={height:null,width:null,rendered:!1,render:function(a){var b=document.createElement("canvas"),c=bonzo(a).offset();this.height=c.height,this.width=c.width,bonzo(b).attr("height",c.height).attr("width",c.width).css({position:"absolute",top:"0px",left:"0px"}),a.appendChild(b),bonzo(a).css({position:"relative"}),typeof FlashCanvas!="undefined"&&FlashCanvas.initElement(b),t
 his.context=b.getContext("2d"),this.rendered=!0},draw:function(a,b,c){this.rendered||this.render(c);var d=this.context,e=this.height,f=this.width,g=Math.round(e/2)-.5,h,i;b=b||{min:f/2,max:f/2},h=b.min+.5,i=b.max+.5,d.clearRect(0,0,f,e);if(h||i)d.save(),d.strokeStyle=this.options.strokeStyle||"#B6D9FF",d.fillStyle=this.options.fillStyle||"rgba(182, 217, 255, .4)",d.beginPath(),h<=1?(d.moveTo(0,e),d.lineTo(0,-0.5)):(d.moveTo(h,e),d.quadraticCurveTo(h,g,Math.max(h-g,h/2),g),d.lineTo(Math.min(g,h/2),g),d.quadraticCurveTo(0,g,.5,-0.5)),d.lineTo(f-.5,-0.5),i>=f-1?d.lineTo(i,e):(d.quadraticCurveTo(f,g,Math.max(f-g,f-(f-i)/2),g),d.lineTo(Math.min(i+g,f-(f-i)/2),g),d.quadraticCurveTo(i,g,i,e)),d.stroke(),d.closePath(),d.fill(),d.restore()},trigger:function(a,b,c){b==="zoom"?this.zoom(a,c):b==="reset"&&this.reset(a)},zoom:function(a,b){var c=b.x||{},d=c.min,e=c.max,f=a.api;a.draw(null,{min:d,max:e})},reset:function(a){a.draw(null,{min:a.width/2,max:a.width/2})}},envision.components.Quadratic
 Drawing=a}(),envision.templates=envision.templates||{},function(){function b(a){var b=a.resolution;a.preprocessor.bound(a.min,a.max).subsampleMinMax(b+Math.round(b/3))}function c(){return{price:{name:"envision-finance-price",config:{"lite-lines":{lineWidth:1,show:!0,fill:!0,fillOpacity:.2},mouse:{track:!0,trackY:!1,trackAll:!0,sensibility:1,trackDecimals:4,position:"ne"},yaxis:{autoscale:!0,autoscaleMargin:.05,noTicks:4,showLabels:!0,min:0}},processData:b},volume:{name:"envision-finance-volume",config:{whiskers:{show:!0,lineWidth:2},mouse:{track:!0,trackY:!1,trackAll:!0},yaxis:{autoscale:!0,autoscaleMargin:.5}},processData:b},summary:{name:"envision-finance-summary",config:{"lite-lines":{show:!0,lineWidth:1,fill:!0,fillOpacity:.2,fillBorder:!0},xaxis:{noTicks:5,showLabels:!0},yaxis:{autoscale:!0,autoscaleMargin:.1},handles:{show:!0},selection:{mode:"x"},grid:{verticalLines:!1}}},connection:{name:"envision-finance-connection",adapterConstructor:a.components.QuadraticDrawing}}}functio
 n d(b){var d=b.data,e=c(),f=new a.Visualization({name:"envision-finance"}),g=new a.Interaction,h=new a.Interaction,i,j,k,l;b.defaults&&(e=Flotr.merge(b.defaults,e)),e.price.data=d.price,e.volume.data=d.volume,e.summary.data=d.summary,e.price.config.mouse.trackFormatter=b.trackFormatter||function(a){var b=a.index,c;return i.api.preprocessor&&(b+=i.api.preprocessor.start),c="Price: $"+d.price[1][b]+", Vol: "+d.volume[1][b],c},b.xTickFormatter&&(e.summary.config.xaxis.tickFormatter=b.xTickFormatter),e.price.config.yaxis.tickFormatter=b.yTickFormatter||function(a){return"$"+a},i=new a.Component(e.price),j=new a.Component(e.volume),k=new a.Component(e.connection),l=new a.Component(e.summary),f.add(i).add(j).add(k).add(l).render(b.container),g.follower(i).follower(j).follower(k).leader(l).add(a.actions.selection,b.selectionCallback?{callback:b.selectionCallback}:null),h.group([i,j]).add(a.actions.hit),b.selection&&l.trigger("select",b.selection),this.vis=f,this.selection=g,this.hit=h,this
 .price=i,this.volume=j,this.summary=l}var a=envision;a.templates.Finance=d}(),function(){function b(){return{detail:{name:"envision-timeseries-detail",config:{"lite-lines":{lineWidth:1,show:!0}}},summary:{name:"envision-timeseries-summary",config:{"lite-lines":{lineWidth:1,show:!0},handles:{show:!0},selection:{mode:"x"},yaxis:{autoscale:!0,autoscaleMargin:.1}}},connection:{name:"envision-timeseries-connection",adapterConstructor:a.components.QuadraticDrawing}}}function c(c){var d=c.data,e=b(),f=new a.Visualization({name:"envision-timeseries"}),g=new a.Interaction,h,i,j;c.defaults&&(e=Flotr.merge(c.defaults,e)),e.detail.data=d.detail,e.summary.data=d.summary,h=new a.Component(e.detail),j=new a.Component(e.connection),i=new a.Component(e.summary),f.add(h).add(j).add(i).render(c.container),g.follower(h).follower(j).leader(i).add(a.actions.selection,c.selectionCallback?{callback:c.selectionCallback}:null),c.selection&&i.trigger("select",c.selection),this.vis=f,this.selection=g,this.deta
 il=h,this.summary=i}var a=envision;a.templates.TimeSeries=c}(),function(){function c(){return{name:"zoom"}}function d(){return{name:"summary",config:{handles:{show:!0},selection:{mode:"x"}}}}function e(a,b){var c=_.defaults(a,b);return c.flotr=_.defaults(c.flotr,b.flotr),c}var a=envision,b;b=function(b){var f=new a.Visualization,g=new a.Component(e(b.zoom||{},c())),h=new a.Component(e(b.summary||{},d())),i=new a.Interaction({leader:h});f.add(g).add(h),i.add(a.actions.selection),i.follower(g),this.vis=f,this.interaction=i,b.container&&this.render(b.container)},b.prototype={render:function(a){this.vis.render(a)}},a.templates.Zoom=b}(),function(a,b,c,d){function e(b){return b[0]&&a.isPlainObject(b[0])?this.data=b[0]:this.el=b,this.isCoords=!0,this.coords={},this.init(),this}var f=e.prototype;f.init=function(){this.set(),this.original_coords=this.get()},f.set=function(a,b){var c=this.el;c&&!a&&(this.data=c.offset(),this.data.width=c.width(),this.data.height=c.height());if(c&&a&&!b){var 
 d=c.offset();this.data.top=d.top,this.data.left=d.left}var e=this.data;return this.coords.x1=e.left,this.coords.y1=e.top,this.coords.x2=e.left+e.width,this.coords.y2=e.top+e.height,this.coords.cx=e.left+e.width/2,this.coords.cy=e.top+e.height/2,this.coords.width=e.width,this.coords.height=e.height,this.coords.el=c||!1,this},f.update=function(b){if(!b&&!this.el)return this;if(b){var c=a.extend({},this.data,b);return this.data=c,this.set(!0,!0)}return this.set(!0),this},f.get=function(){return this.coords},a.fn.coords=function(){if(this.data("coords"))return this.data("coords");var a=new e(this,arguments[0]);return this.data("coords",a),a}}(jQuery,window,document),function(a,b,c,d){function f(b,c,d){this.options=a.extend(e,d),this.$element=b,this.last_colliders=[],this.last_colliders_coords=[],typeof c=="string"||c instanceof jQuery?this.$colliders=a(c,this.options.colliders_context).not(this.$element):this.colliders=a(c),this.init()}var e={colliders_context:c.body},g=f.prototype;g.in
 it=function(){this.find_collisions()},g.overlaps=function(a,b){var c=!1,d=!1;if(b.x1>=a.x1&&b.x1<=a.x2||b.x2>=a.x1&&b.x2<=a.x2||a.x1>=b.x1&&a.x2<=b.x2)c=!0;if(b.y1>=a.y1&&b.y1<=a.y2||b.y2>=a.y1&&b.y2<=a.y2||a.y1>=b.y1&&a.y2<=b.y2)d=!0;return c&&d},g.detect_overlapping_region=function(a,b){var c="",d="";return a.y1>b.cy&&a.y1<b.y2&&(c="N"),a.y2>b.y1&&a.y2<b.cy&&(c="S"),a.x1>b.cx&&a.x1<b.x2&&(d="W"),a.x2>b.x1&&a.x2<b.cx&&(d="E"),c+d||"C"},g.calculate_overlapped_area_coords=function(b,c){var d=Math.max(b.x1,c.x1),e=Math.max(b.y1,c.y1),f=Math.min(b.x2,c.x2),g=Math.min(b.y2,c.y2);return a({left:d,top:e,width:f-d,height:g-e}).coords().get()},g.calculate_overlapped_area=function(a){return a.width*a.height},g.manage_colliders_start_stop=function(b,c,d){var e=this.last_colliders_coords;for(var f=0,g=e.length;f<g;f++)a.inArray(e[f],b)===-1&&c.call(this,e[f]);for(var h=0,i=b.length;h<i;h++)a.inArray(b[h],e)===-1&&d.call(this,b[h])},g.find_collisions=function(b){var c=this,d=[],e=[],f=this.coll
 iders||this.$colliders,g=f.length,h=c.$element.coords().update(b||!1).get();while(g--){var i=c.$colliders?a(f[g]):f[g],j=i.isCoords?i:i.coords(),k=j.get(),l=c.overlaps(h,k);if(!l)continue;var m=c.detect_overlapping_region(h,k);if(m==="C"){var n=c.calculate_overlapped_area_coords(h,k),o=c.calculate_overlapped_area(n),p={area:o,area_coords:n,region:m,coords:k,player_coords:h,el:i};c.options.on_overlap&&c.options.on_overlap.call(this,p),d.push(j),e.push(p)}}return(c.options.on_overlap_stop||c.options.on_overlap_start)&&this.manage_colliders_start_stop(d,c.options.on_overlap_stop,c.options.on_overlap_start),this.last_colliders_coords=d,e},g.get_closest_colliders=function(a){var b=this.find_collisions(a);return b.sort(function(a,b){return a.region==="C"&&b.region==="C"?a.coords.y1<b.coords.y1||a.coords.x1<b.coords.x1?-1:1:a.area<b.area?1:1}),b},a.fn.collision=function(a,b){return new f(this,a,b)}}(jQuery,window,document),function(a,b){a.debounce=function(a,b,c){var d;return function(){va
 r e=this,f=arguments,g=function(){d=null,c||a.apply(e,f)};c&&!d&&a.apply(e,f),clearTimeout(d),d=setTimeout(g,b)}},a.throttle=function(a,b){var c,d,e,f,g,h,i=debounce(function(){g=f=!1},b);return function(){c=this,d=arguments;var j=function(){e=null,g&&a.apply(c,d),i()};return e||(e=setTimeout(j,b)),f?g=!0:h=a.apply(c,d),i(),f=!0,h}}}(window),function(a,b,c,d){function i(b,d){this.options=a.extend({},e,d),this.$body=a(c.body),this.$container=a(b

<TRUNCATED>