From 231f3b87230974699b3efe8423245378456dcd33 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 24 Oct 2012 11:28:01 +0200 Subject: [PATCH] Load worker related records from pusher payload --- assets/scripts/app/models/worker.coffee | 16 ++- assets/scripts/app/routes.coffee | 6 +- assets/scripts/app/store.coffee | 9 +- assets/scripts/app/templates/workers/list.hbs | 4 +- assets/scripts/app/views/sidebar.coffee | 2 +- public/scripts/app.js | 14 +-- public/scripts/min/app.js | 113 +++++++++++++++++- public/version | 2 +- 8 files changed, 146 insertions(+), 20 deletions(-) diff --git a/assets/scripts/app/models/worker.coffee b/assets/scripts/app/models/worker.coffee index b0039c26..57c8b061 100644 --- a/assets/scripts/app/models/worker.coffee +++ b/assets/scripts/app/models/worker.coffee @@ -18,17 +18,21 @@ require 'travis/model' @get('state') == 'working' ).property('state') - repo: (-> - Travis.Repo.find(@get('payload.repository.id') || @get('payload.repo.id')) - ).property('payload.repository.id', 'payload.repo.id') - - job_id: (-> + jobId: (-> @get('payload.job.id') ).property('payload.job.id') job: (-> Travis.Job.find @get('job_id') - ).property('job_id') + ).property('jobId') + + repo: (-> + Travis.Repo.find(@get('payload.repository.id') || @get('payload.repo.id')) + ).property('payload.repository.id', 'payload.repo.id') + + repoSlug: (-> + @get('payload.repo.slug') || @get('payload.repository.slug') + ).property('payload.repo.slug', 'payload.repository.slug') nameForSort: (-> if name = @get('name') diff --git a/assets/scripts/app/routes.coffee b/assets/scripts/app/routes.coffee index e88a4e5c..3f700615 100644 --- a/assets/scripts/app/routes.coffee +++ b/assets/scripts/app/routes.coffee @@ -211,9 +211,13 @@ Travis.Router = Ember.Router.extend deferred.promise() serialize: (router, repo) -> - if repo + if typeof repo == 'string' + [owner, name] = repo.split '/' + { owner: owner, name: name } + else if repo { owner: repo.get('owner'), name: repo.get('name') } else + # TODO: it would be nice to handle 404 somehow {} show: Ember.Route.extend diff --git a/assets/scripts/app/store.coffee b/assets/scripts/app/store.coffee index 5274e969..a4154358 100644 --- a/assets/scripts/app/store.coffee +++ b/assets/scripts/app/store.coffee @@ -42,6 +42,8 @@ Travis.Store = DS.Store.extend if clientId != undefined if data = dataCache[clientId] + # trying to set id here fails, TODO: talk with ember core team to create merge-like function + delete hash.id $.extend(data, hash) else dataCache[clientId] = hash @@ -80,7 +82,12 @@ Travis.Store = DS.Store.extend # if we need sideload becasue we have side records with other events it needs to # be revised if type == Travis.Build && (json.repository || json.repo) - result = @loadIncomplete(Travis.Repo, json.repository || json.repo) + @loadIncomplete(Travis.Repo, json.repository || json.repo) + else if type == Travis.Worker && json.worker.payload + if repo = (json.worker.payload.repo || json.worker.payload.repository) + @loadIncomplete(Travis.Repo, repo) + if job = json.worker.payload.job + @loadIncomplete(Travis.Job, job) @loadIncomplete(type, json[root]) addLoadedData: (type, clientId, hash) -> diff --git a/assets/scripts/app/templates/workers/list.hbs b/assets/scripts/app/templates/workers/list.hbs index 4ab1f6e0..1823d60d 100644 --- a/assets/scripts/app/templates/workers/list.hbs +++ b/assets/scripts/app/templates/workers/list.hbs @@ -16,8 +16,8 @@
  • {{#if worker.isWorking}} - {{#if worker.job_id}} - + {{#if worker.jobId}} + {{view.display}} {{/if}} diff --git a/assets/scripts/app/views/sidebar.coffee b/assets/scripts/app/views/sidebar.coffee index 85429b1e..66256123 100644 --- a/assets/scripts/app/views/sidebar.coffee +++ b/assets/scripts/app/views/sidebar.coffee @@ -66,7 +66,7 @@ payload = @get('worker.payload') if state == 'working' && payload?.repository && payload?.build - repo = payload.repository.slug + repo = @get('worker.repoSlug') number = ' #' + payload.build.number "#{name}: #{repo} #{number}".htmlSafe() else diff --git a/public/scripts/app.js b/public/scripts/app.js index c3ad03f0..cbfb1711 100644 --- a/public/scripts/app.js +++ b/public/scripts/app.js @@ -13,10 +13,10 @@ e(this,"isEscaped"),i=e(this,"shouldDisplayFunc"),s=e(this,"preserveContext"),o= e,t){var n=this.axis,r=n.options,i=n.chart.renderer,s=n.horiz,o=this.type,u=this.label,a=this.pos,f=r.labels,l=this.gridLine,c=o?o+"Grid":"grid",h=o?o+"Tick":"tick",d=r[c+"LineWidth"],v=r[c+"LineColor"],m=r[c+"LineDashStyle"],g=r[h+"Length"],c=r[h+"Width"]||0,y=r[h+"Color"],b=r[h+"Position"],h=this.mark,w=f.step,E=!0,S=r.categories&&r.tickmarkPlacement==="between"?.5:0,x=this.getPosition(s,a,S,t),T=x.x,x=x.y,N=n.staggerLines;d&&(a=n.getPlotLinePath(a+S,d,t),l===R&&(l={stroke:v,"stroke-width":d},m&&(l.dashstyle=m),o||(l.zIndex=1),this.gridLine=l=d?i.path(a).attr(l).add(n.gridGroup):null),!t&&l&&a&&l[this.isNew?"attr":"animate"]({d:a})),c&&(b==="inside"&&(g=-g),n.opposite&&(g=-g),o=this.getMarkPath(T,x,g,c,s,i),h?h.animate({d:o}):this.mark=i.path(o).attr({stroke:y,"stroke-width":c}).add(n.axisGroup)),u&&!isNaN(T)&&(u.xy=x=this.getLabelPosition(T,x,u,s,f,S,e,w),this.isFirst&&!p(r.showFirstLabel,1)||this.isLast&&!p(r.showLastLabel,1)?E=!1:!N&&s&&f.overflow==="justify"&&!this.handleOverflow(e,x)&&(E=!1),w&&e%w&&(E=!1),E?(u[this.isNew?"attr":"animate"](x),u.show(),this.isNew=!1):u.hide())},destroy:function(){C(this,this.axis)}},P.prototype={render:function(){var e=this,t=e.axis,n=t.horiz,r=(t.pointRange||0)/2,i=e.options,s=i.label,o=e.label,a=i.width,f=i.to,c=i.from,h=l(c)&&l(f),d=i.value,v=i.dashStyle,m=e.svgElem,g=[],y,b=i.color,w=i.zIndex,E=i.events,S=t.chart.renderer;t.isLog&&(c=u(c),f=u(f),d=u(d));if(a){if(g=t.getPlotLinePath(d,a),r={stroke:b,"stroke-width":a},v)r.dashstyle=v}else{if(!h)return;if(c=J(c,t.min-r),f=K(f,t.max+r),g=t.getPlotBandPath(c,f,i),r={fill:b},i.borderWidth)r.stroke=i.borderColor,r["stroke-width"]=i.borderWidth}l(w)&&(r.zIndex=w);if(m)g?m.animate({d:g},null,m.onGetPath):(m.hide(),m.onGetPath=function(){m.show()});else if(g&&g.length&&(e.svgElem=m=S.path(g).attr(r).add(),E))for(y in i=function(t){m.on(t,function(n){E[t].apply(e,[n])})},E)i(y);return s&&l(s.text)&&g&&g.length&&t.width>0&&t.height>0?(s=Yt({align:n&&h&&"center",x:n?!h&&4:10,verticalAlign:!n&&h&&"middle",y:n?h?16:10:h?6:-4,rotation:n&&!h&&90},s),o||(e.label=o=S.text(s.text,0,0).attr({align:s.textAlign||s.align,rotation:s.rotation,zIndex:w}).css(s.style).add()),t=[g[1],g[4],p(g[6],g[1])],g=[g[2],g[5],p(g[7],g[2])],n=T(t),h=T(g),o.align(s,!1,{x:n,y:h,width:N(t)-n,height:N(g)-h}),o.show()):o&&o.hide(),e},destroy:function(){f(this.axis.plotLinesAndBands,this),C(this,this.axis)}},H.prototype={destroy:function(){C(this,this.axis)},setTotal:function(e){this.cum=this.total=e},render:function(e){var t=this.options.formatter.call(this);this.label?this.label.attr({text:t,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(t,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,visibility:"hidden"}).add(e)},setOffset:function(e,t){var n=this.axis,r=n.chart,i=r.inverted,s=this.isNegative,o=n.translate(this.total,0,0,0,1),n=n.translate(0),n=Q(o-n),u=r.xAxis[0].translate(this.x)+e,r=r.plotHeight,i={x:i?s?o:o-n:u,y:i?r-u-t:s?r-o-n:r-o,width:i?n:t,height:i?t:n};this.label&&this.label.align(this.alignOptions,null,i).attr({visibility:"visible"})}},B.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:Xt,lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F",fontWeight:"bold"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Y-values"},stackLabels:{enabled:!1,formatter:function(){return this.total},style:Xt.style}},defaultLeftAxisOptions:{labels:{align:"right",x:-8,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{align:"left",x:8,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{align:"center",x:0,y:14},title:{rotation:0}},defaultTopAxisOptions:{labels:{align:"center",x:0,y:-5},title:{rotation:0}},init:function(e,t){var n=t.isX;this.horiz=e.inverted?!n:n,this.xOrY=(this.isXAxis=n)?"x":"y",this.opposite=t.opposite,this.side=this.horiz?this.opposite?0:2:this.opposite?1:3,this.setOptions(t);var r=this.options,i=r.type,s=i==="datetime";this.labelFormatter=r.labels.formatter||this.defaultLabelFormatter,this.staggerLines=this.horiz&&r.labels.staggerLines,this.userOptions=t,this.minPixelPadding=0,this.chart=e,this.reversed=r.reversed,this.categories=r.categories,this.isLog=i==="logarithmic",this.isLinked=l(r.linkedTo),this.isDatetimeAxis=s,this.ticks={},this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=r.minRange||r.maxZoom,this.range=r.range,this.offset=r.offset||0,this.stacks={},this.min=this.max=null;var o,r=this.options.events;e.axes.push(this),e[n?"xAxis":"yAxis"].push(this),this.series=[],e.inverted&&n&&this.reversed===R&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine,this.addPlotLine=this.addPlotBand=this.addPlotBandOrLine;for(o in r)Zt(this,o,r[o]);this.isLog&&(this.val2lin=u,this.lin2val=a)},setOptions:function(e){this.options=Yt(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],e)},defaultLabelFormatter:function(){var e=this.axis,t=this.value,n=e.tickInterval,r=this.dateTimeLabelFormat;return e.categories?t:r?vt(r,t):n%1e6===0?t/1e6+"M":n%1e3===0?t/1e3+"k":t>=1e3?g(t,0):g(t,-1)},getSeriesExtremes:function(){var e=this,t=e.chart,n=e.stacks,r=[],i=[],s;e.dataMin=e.dataMax=null,Jt(e.series,function(o){if(o.visible||!t.options.chart.ignoreHiddenSeries){var u=o.options,a,f,c,h,d,v,m,g,y,b=u.threshold,w,E=[],S=0;e.isLog&&b<=0&&(b=u.threshold=null);if(e.isXAxis){if(u=o.xData,u.length)e.dataMin=K(p(e.dataMin,u[0]),T(u)),e.dataMax=J(p(e.dataMax,u[0]),N(u))}else{var x,C,k,L=o.cropped,A=o.xAxis.getExtremes(),O=!!o.modifyValue;a=u.stacking,e.usePercentage=a==="percent",a&&(d=u.stack,h=o.type+p(d,""),v="-"+h,o.stackKey=h,f=r[h]||[],r[h]=f,c=i[v]||[],i[v]=c),e.usePercentage&&(e.dataMin=0,e.dataMax=99),u=o.processedXData,m=o.processedYData,w=m.length;for(s=0;s=A.min&&(u[s-1]||g)<=A.max))if(g=y.length)for(;g--;)y[g]!==null&&(E[S++]=y[g]);else E[S++]=y;!e.usePercentage&&E.length&&(e.dataMin=K(p(e.dataMin,E[0]),T(E)),e.dataMax=J(p(e.dataMax,E[0]),N(E))),l(b)&&(e.dataMin>=b?(e.dataMin=b,e.ignoreMinPadding=!0):e.dataMaxi+this.width)c=!0}else if(n=i,u=l-this.right,os+this.height)c=!0;return c?null:r.renderer.crispLine(["M",n,o,"L",u,a],t||0)},getPlotBandPath:function(e,t){var n=this.getPlotLinePath(t),r=this.getPlotLinePath(e);return r&&n?r.push(n[4],n[5],n[1],n[2]):r=null,r},getLinearTickPositions:function(e,t,n){for(var r,t=A(V(t/e)*e),n=A($(n/e)*e),i=[];t<=n;){i.push(t),t=A(t+e);if(t===r)break;r=t}return i},getLogTickPositions:function(e,t,n,r){var i=this.options,s=this.len,o=[];r||(this._minorAutoInterval=null);if(e>=.5)e=X(e),o=this.getLinearTickPositions(e,t,n);else if(e>=.08)for(var s=V(t),f,l,c,h,d,i=e>.3?[1,2,4]:e>.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];st&&o.push(h),h>n&&(d=!0),h=c}else if(t=a(t),n=a(n),e=i[r?"minorTickInterval":"tickInterval"],e=p(e==="auto"?null:e,this._minorAutoInterval,(n-t)*(i.tickPixelInterval/(r?5:1))/((r?s/this.tickPositions.length:s)||1)),e=b(e,null,W.pow(10,V(W.log(e)/W.LN10))),o=Gt(this.getLinearTickPositions(e,t,n),u),!r)this._minorAutoInterval=e/5;return r||(this.tickInterval=e),o},getMinorTickPositions:function(){var e=this.tickPositions,t=this.minorTickInterval,n=[],r,i;if(this.isLog){i=e.length;for(r=1;r=this.minRange,s,o,u,a,f;this.isXAxis&&this.minRange===R&&!this.isLog&&(l(e.min)||l(e.max)?this.minRange=null:(Jt(this.series,function(e){a=e.xData;for(o=f=e.xIncrement?1:a.length-1;o>0;o--)if(u=a[o]-a[o-1],s===R||u0||!t.ignoreMaxPadding)&&(t.max+=n*c)),t.tickInterval=t.min===t.max||t.min===void 0||t.max===void 0?1:a&&!d&&v===t.linkedParent.options.tickPixelInterval?t.linkedParent.tickInterval:p(d,m?1:(t.max-t.min)*v/(t.len||1)),o&&!e&&Jt(t.series,function(e){e.processData(t.min!==t.oldMin||t.max!==t.oldMax)}),t.setAxisTranslation(),t.beforeSetTickPositions&&t.beforeSetTickPositions(),t.postProcessTickInterval&&(t.tickInterval=t.postProcessTickInterval(t.tickInterval)),!s&&!i&&(e=W.pow(10,V(W.log(t.tickInterval)/W.LN10)),!l(r.tickInterval))&&(t.tickInterval=b(t.tickInterval,null,e,r)),t.minorTickInterval=r.minorTickInterval==="auto"&&t.tickInterval?t.tickInterval/5:r.minorTickInterval,t.tickPositions=f=r.tickPositions||f&&f.apply(t,[t.min,t.max]),f||(f=s?(t.getNonLinearTimeTicks||E)(w(t.tickInterval,r.units),t.min,t.max,r.startOfWeek,t.ordinalPositions,t.closestPointRange,!0):i?t.getLogTickPositions(t.tickInterval,t.min,t.max):t.getLinearTickPositions(t.tickInterval,t.min,t.max),t.tickPositions=f),a||(i=f[0],s=f[f.length-1],r.startOnTick?t.min=i:t.min>i&&f.shift(),r.endOnTick?t.max=s:t.maxt[r]&&this.options.alignTicks!==!1&&(t[r]=n.length),e.maxTicks=t},adjustTickAmount:function(){var e=this.xOrY,t=this.tickPositions,n=this.chart.maxTicks;if(n&&n[e]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1){var r=this.tickAmount,i=t.length;this.tickAmount=e=n[e];if(ie||e===null?e=n:t=e.min&&t<=e.max)c[t]||(c[t]=new D(e,t)),y&&c[t].isNew&&c[t].render(n,!0),c[t].isActive=!0,c[t].render(n)}),v&&Jt(o,function(t,n){n%2===0&&t1||Q(t-n.currentY)>1?function(){n.move(e,t)}:null},hide:function(){if(!this.tooltipIsHidden){var e=this.chart.hoverPoints;this.label.hide(),e&&Jt(e,function(e){e.setState()}),this.chart.hoverPoints=null,this.tooltipIsHidden=!0}},hideCrosshairs:function(){Jt(this.crosshairs,function(e){e&&e.hide()})},getAnchor:function(e,t){var n,r=this.chart,i=r.inverted,s=0,o=0,e=h(e);return n=e[0].tooltipPos,n||(Jt(e,function(e){s+=e.plotX,o+=e.plotLow?(e.plotLow+e.plotHigh)/2:e.plotY}),s/=e.length,o/=e.length,n=[i?r.plotWidth-o:s,this.shared&&!i&&e.length>1&&t?t.chartY-r.plotTop:i?r.plotHeight-s:o]),Gt(n,X)},getPosition:function(e,t,n){var r=this.chart,i=r.plotLeft,s=r.plotTop,o=r.plotWidth,u=r.plotHeight,a=p(this.options.distance,12),f=n.plotX,n=n.plotY,r=f+i+(r.inverted?a:-e-a),l=n-t+s+15,c;return r<7&&(r=i+f+a),r+e>i+o&&(r-=r+e-(i+o),l=n-t+s-a,c=!0),l=l&&n<=l+t&&(l=n+s+a)),l+t>s+u&&(l=J(s,s+u-t-a)),{x:r,y:l}},refresh:function(e,t){function n(){var e=this.points||h(this),t=e[0].series,n;return n=[t.tooltipHeaderFormatter(e[0].key)],Jt(e,function(e){t=e.series,n.push(t.tooltipFormatter&&t.tooltipFormatter(e)||e.point.tooltipFormatter(t.tooltipOptions.pointFormat))}),n.push(s.footerFormat||""),n.join("")}var r=this.chart,i=this.label,s=this.options,o,u,a,f={},l,c=[];l=s.formatter||n;var f=r.hoverPoints,d,v=s.crosshairs;a=this.shared,u=this.getAnchor(e,t),o=u[0],u=u[1],a&&(!e.series||!e.series.noSharedTooltip)?(f&&Jt(f,function(e){e.setState()}),r.hoverPoints=e,Jt(e,function(e){e.setState("hover"),c.push(e.getLabelConfig())}),f={x:e[0].category,y:e[0].y},f.points=c,e=e[0]):f=e.getLabelConfig(),l=l.call(f),f=e.series,a=a||!f.isCartesian||f.tooltipOutsidePlot||r.isInsidePlot(o,u),l===!1||!a?this.hide():(this.tooltipIsHidden&&i.show(),i.attr({text:l}),d=s.borderColor||e.color||f.color||"#606060",i.attr({stroke:d}),i=(s.positioner||this.getPosition).call(this,i.width,i.height,{plotX:o,plotY:u}),this.move(X(i.x),X(i.y)),this.tooltipIsHidden=!1);if(v){v=h(v);for(i=v.length;i--;)if(a=e.series[i?"yAxis":"xAxis"],v[i]&&a)(a=a.getPlotLinePath(i?p(e.stackY,e.y):e.x,1),this.crosshairs[i])?this.crosshairs[i].attr({d:a,visibility:"visible"}):(f={"stroke-width":v[i].width||1,stroke:v[i].color||"#C0C0C0",zIndex:v[i].zIndex||2},v[i].dashStyle&&(f.dashstyle=v[i].dashStyle),this.crosshairs[i]=r.renderer.path(a).attr(f).add())}tn(r,"tooltipRefresh",{text:l,x:o+r.plotLeft,y:u+r.plotTop,borderColor:d})},tick:function(){this.tooltipTick&&this.tooltipTick()}},F.prototype={normalizeMouseEvent:function(t){var n,r,i,t=t||z.event;return t.target||(t.target=t.srcElement),t.originalEvent&&(t=t.originalEvent),t.event&&(t=t.event),i=t.touches?t.touches.item(0):t,this.chartPosition=n=Qt(this.chart.container),i.pageX===R?(r=t.x,n=t.y):(r=i.pageX-n.left,n=i.pageY-n.top),e(t,{chartX:X(r),chartY:X(n)})},getMouseCoordinates:function(e){var t={xAxis:[],yAxis:[]},n=this.chart;return Jt(n.axes,function(r){var i=r.isXAxis;t[i?"xAxis":"yAxis"].push({axis:r,value:r.translate((n.inverted?!i:i)?e.chartX-n.plotLeft:n.plotHeight-e.chartY+n.plotTop,!0)})}),t},onmousemove:function(e){var t=this.chart,n=t.series,r,i,s=t.hoverPoint,o=t.hoverSeries,u,a,f=t.chartWidth,l=t.inverted?t.plotHeight+t.plotTop-e.chartY:e.chartX-t.plotLeft;if(t.tooltip&&this.options.tooltip.shared&&(!o||!o.noSharedTooltip)){i=[],u=n.length;for(a=0;af&&i.splice(u,1);i.length&&i[0].plotX!==this.hoverX&&(t.tooltip.refresh(i,e),this.hoverX=i[0].plotX)}o&&o.tracker&&(r=o.tooltipPoints[l])&&r!==s&&r.onMouseOver()},resetTracker:function(e){var t=this.chart,n=t.hoverSeries,r=t.hoverPoint,i=t.hoverPoints||r,t=t.tooltip;(e=e&&t&&i)&&h(i)[0].plotX===R&&(e=!1),e?t.refresh(i):(r&&r.onMouseOut(),n&&n.onMouseOut(),t&&(t.hide(),t.hideCrosshairs()),this.hoverX=null)},setDOMEvents:function(){function t(){if(n.selectionMarker){var e={xAxis:[],yAxis:[]},o=n.selectionMarker.getBBox(),u=o.x-r.plotLeft,a=o.y-r.plotTop,f;s&&(Jt(r.axes,function(t){if(t.options.zoomEnabled!==!1){var n=t.isXAxis,i=r.inverted?!n:n,s=t.translate(i?u:r.plotHeight-a-o.height,!0,0,0,1),i=t.translate(i?u+o.width:r.plotHeight-a,!0,0,0,1);!isNaN(s)&&!isNaN(i)&&(e[n?"xAxis":"yAxis"].push({axis:t,min:K(s,i),max:J(s,i)}),f=!0)}}),f&&tn(r,"selection",e,function(e){r.zoom(e)})),n.selectionMarker=n.selectionMarker.destroy()}r&&(d(i,{cursor:"auto"}),r.cancelClick=s,r.mouseIsDown=s=!1),en(U,lt?"touchend":"mouseup",t)}var n=this,r=n.chart,i=r.container,s,o=n.zoomX&&!r.inverted||n.zoomY&&r.inverted,u=n.zoomY&&!r.inverted||n.zoomX&&r.inverted;n.hideTooltipOnMouseMove=function(e){nn(e),n.chartPosition&&r.hoverSeries&&r.hoverSeries.isCartesian&&!r.isInsidePlot(e.pageX-n.chartPosition.left-r.plotLeft,e.pageY-n.chartPosition.top-r.plotTop)&&n.resetTracker()},n.hideTooltipOnMouseLeave=function(){n.resetTracker(),n.chartPosition=null},i.onmousedown=function(e){e=n.normalizeMouseEvent(e),!lt&&e.preventDefault&&e.preventDefault(),r.mouseIsDown=!0,r.cancelClick=!1,r.mouseDownX=n.mouseDownX=e.chartX,n.mouseDownY=e.chartY,Zt(U,lt?"touchend":"mouseup",t)};var a=function(e){if(!e||!(e.touches&&e.touches.length>1)){e=n.normalizeMouseEvent(e),lt||(e.returnValue=!1);var t=e.chartX,i=e.chartY,a=!r.isInsidePlot(t-r.plotLeft,i-r.plotTop);lt&&e.type==="touchstart"&&(c(e.target,"isTracker")?r.runTrackerClick||e.preventDefault():!r.runChartClick&&!a&&e.preventDefault()),a&&(tr.plotLeft+r.plotWidth&&(t=r.plotLeft+r.plotWidth),ir.plotTop+r.plotHeight&&(i=r.plotTop+r.plotHeight));if(r.mouseIsDown&&e.type!=="touchstart"){if(s=Math.sqrt(Math.pow(n.mouseDownX-t,2)+Math.pow(n.mouseDownY-i,2)),s>10){e=r.isInsidePlot(n.mouseDownX-r.plotLeft,n.mouseDownY-r.plotTop),r.hasCartesianSeries&&(n.zoomX||n.zoomY)&&e&&!n.selectionMarker&&(n.selectionMarker=r.renderer.rect(r.plotLeft,r.plotTop,o?1:r.plotWidth,u?1:r.plotHeight,0).attr({fill:n.options.chart.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add());if(n.selectionMarker&&o){var f=t-n.mouseDownX;n.selectionMarker.attr({width:Q(f),x:(f>0?0:f)+n.mouseDownX})}n.selectionMarker&&u&&(i-=n.mouseDownY,n.selectionMarker.attr({height:Q(i),y:(i>0?0:i)+n.mouseDownY})),e&&!n.selectionMarker&&n.options.chart.panning&&r.pan(t)}}else a||n.onmousemove(e);return a||!r.hasCartesianSeries}};i.onmousemove=a,Zt(i,"mouseleave",n.hideTooltipOnMouseLeave),Zt(U,"mousemove",n.hideTooltipOnMouseMove),i.ontouchstart=function(e){(n.zoomX||n.zoomY)&&i.onmousedown(e),a(e)},i.ontouchmove=a,i.ontouchend=function(){s&&n.resetTracker()},i.onclick=function(t){var i=r.hoverPoint,s,o,t=n.normalizeMouseEvent(t);t.cancelBubble=!0,r.cancelClick||(i&&(c(t.target,"isTracker")||c(t.target.parentNode,"isTracker"))?(s=i.plotX,o=i.plotY,e(i,{pageX:n.chartPosition.left+r.plotLeft+(r.inverted?r.plotWidth-o:s),pageY:n.chartPosition.top+r.plotTop+(r.inverted?r.plotHeight-s:o)}),tn(i.series,"click",e(t,{point:i})),i.firePointEvent("click",t)):(e(t,n.getMouseCoordinates(t)),r.isInsidePlot(t.chartX-r.plotLeft,t.chartY-r.plotTop)&&tn(r,"click",t)))}},destroy:function(){var e=this.chart,t=e.container;e.trackerGroup&&(e.trackerGroup=e.trackerGroup.destroy()),en(t,"mouseleave",this.hideTooltipOnMouseLeave),en(U,"mousemove",this.hideTooltipOnMouseMove),t.onclick=t.onmousedown=t.onmousemove=t.ontouchstart=t.ontouchend=t.ontouchmove=null,clearInterval(this.tooltipInterval)},init:function(e,t){e.trackerGroup||(e.trackerGroup=e.renderer.g("tracker").attr({zIndex:9}).add()),t.enabled&&(e.tooltip=new j(e,t),this.tooltipInterval=setInterval(function(){e.tooltip.tick()},32)),this.setDOMEvents()}},I.prototype={init:function(e){var t=this,r=t.options=e.options.legend;if(r.enabled){var i=r.itemStyle,s=p(r.padding,8),o=r.itemMarginTop||0;t.baseline=n(i.fontSize)+3+o,t.itemStyle=i,t.itemHiddenStyle=Yt(i,r.itemHiddenStyle),t.itemMarginTop=o,t.padding=s,t.initialItemX=s,t.initialItemY=s-5,t.maxItemWidth=0,t.chart=e,t.itemHeight=0,t.lastLineHeight=0,t.render(),Zt(t.chart,"endResize",function(){t.positionCheckboxes()})}},colorizeItem:function(e,t){var n=this.options,r=e.legendItem,i=e.legendLine,s=e.legendSymbol,o=this.itemHiddenStyle.color,n=t?n.itemStyle.color:o,o=t?e.color:o;r&&r.css({fill:n}),i&&i.attr({stroke:o}),s&&s.attr({stroke:o,fill:o})},positionItem:function(e){var t=this.options,n=t.symbolPadding,t=!t.rtl,r=e._legendItemPos,i=r[0],r=r[1],s=e.checkbox;e.legendGroup&&e.legendGroup.translate(t?i:this.legendWidth-i-2*n-4,r),s&&(s.x=i,s.y=r)},destroyItem:function(e){var t=e.checkbox;Jt(["legendItem","legendLine","legendSymbol","legendGroup"],function(t){e[t]&&e[t].destroy()}),t&&k(e.checkbox)},destroy:function(){var e=this.group,t=this.box;t&&(this.box=t.destroy()),e&&(this.group=e.destroy())},positionCheckboxes:function(){var e=this;Jt(e.allItems,function(t){var n=t.checkbox,r=e.group.alignAttr;n&&d(n,{left:r.translateX+t.legendItemWidth+n.x-20+"px",top:r.translateY+n.y+3+"px"})})},renderItem:function(e){var t,n=this,r=n.chart,i=r.renderer,s=n.options,o=s.layout==="horizontal",u=s.symbolWidth,a=s.symbolPadding,f=n.itemStyle,l=n.itemHiddenStyle,c=n.padding,h=!s.rtl,p=s.width,d=s.itemMarginBottom||0,m=n.itemMarginTop,g=n.initialItemX,y=e.legendItem,b=e.series||e,w=b.options,E=w.showCheckbox;!y&&(e.legendGroup=i.g("legend-item").attr({zIndex:1}).add(n.scrollGroup),b.drawLegendSymbol(n,e),e.legendItem=y=i.text(s.labelFormatter.call(e),h?u+a:-a,n.baseline,s.useHTML).css(Yt(e.visible?f:l)).attr({align:h?"left":"right",zIndex:2}).add(e.legendGroup),e.legendGroup.on("mouseover",function(){e.setState("hover"),y.css(n.options.itemHoverStyle)}).on("mouseout",function(){y.css(e.visible?f:l),e.setState()}).on("click",function(t){var n=function(){e.setVisible()},t={browserEvent:t};e.firePointEvent?e.firePointEvent("legendItemClick",t,n):tn(e,"legendItemClick",t,n)}),n.colorizeItem(e,e.visible),w&&E)&&(e.checkbox=v("input",{type:"checkbox",checked:e.selected,defaultChecked:e.selected},s.itemCheckboxStyle,r.container),Zt(e.checkbox,"click",function(t){tn(e,"checkboxClick",{checked:t.target.checked},function(){e.select()})})),i=y.getBBox(),t=e.legendItemWidth=s.itemWidth||u+a+i.width+c+(E?20:0),s=t,n.itemHeight=u=i.height,o&&n.itemX-g+s>(p||r.chartWidth-2*c-g)&&(n.itemX=g,n.itemY+=m+n.lastLineHeight+d,n.lastLineHeight=0),n.maxItemWidth=J(n.maxItemWidth,s),n.lastItemY=m+n.itemY+d,n.lastLineHeight=J(u,n.lastLineHeight),e._legendItemPos=[n.itemX,n.itemY],o?n.itemX+=s:(n.itemY+=m+u+d,n.lastLineHeight=u),n.offsetWidth=p||J(o?n.itemX-g:s,n.offsetWidth)},render:function(){var t=this,n=t.chart,r=n.renderer,i=t.group,s,o,u,a,f=t.box,l=t.options,c=t.padding,h=l.borderWidth,p=l.backgroundColor;t.itemX=t.initialItemX,t.itemY=t.initialItemY,t.offsetWidth=0,t.lastItemY=0,i||(t.group=i=r.g("legend").attr({zIndex:7}).add(),t.contentGroup=r.g().attr({zIndex:1}).add(i),t.scrollGroup=r.g().add(t.contentGroup),t.clipRect=r.clipRect(0,0,9999,n.chartHeight),t.contentGroup.clip(t.clipRect)),s=[],Jt(n.series,function(e){var t=e.options;t.showInLegend&&(s=s.concat(e.legendItems||(t.legendType==="point"?e.data:e)))}),x(s,function(e,t){return(e.options.legendIndex||0)-(t.options.legendIndex||0)}),l.reversed&&s.reverse(),t.allItems=s,t.display=o=!!s.length,Jt(s,function(e){t.renderItem(e)}),u=l.width||t.offsetWidth,a=t.lastItemY+t.lastLineHeight,a=t.handleOverflow(a);if(h||p)u+=c,a+=c,f?u>0&&a>0&&(f[f.isNew?"attr":"animate"](f.crisp(null,null,null,u,a)),f.isNew=!1):(t.box=f=r.rect(0,0,u,a,l.borderRadius,h||0).attr({stroke:l.borderColor,"stroke-width":h||0,fill:p||Et}).add(i).shadow(l.shadow),f.isNew=!0),f[o?"show":"hide"]();t.legendWidth=u,t.legendHeight=a,Jt(s,function(e){t.positionItem(e)}),o&&i.align(e({width:u,height:a},l),!0,n.spacingBox),n.isResizing||this.positionCheckboxes()},handleOverflow:function(e){var t=this,n=this.chart,r=n.renderer,i=this.options,s=i.y,s=n.spacingBox.height+(i.verticalAlign==="top"?-s:s)-this.padding,o=i.maxHeight,u=this.clipRect,a=i.navigation,f=p(a.animation,!0),l=a.arrowSize||12,c=this.nav;return i.layout==="horizontal"&&(s/=2),o&&(s=K(s,o)),e>s?(this.clipHeight=n=s-20,this.pageCount=$(e/n),this.currentPage=p(this.currentPage,1),this.fullHeight=e,u.attr({height:n}),c||(this.nav=c=r.g().attr({zIndex:1}).add(this.group),this.up=r.symbol("triangle",0,0,l,l).on("click",function(){t.scroll(-1,f)}).add(c),this.pager=r.text("",15,10).css(a.style).add(c),this.down=r.symbol("triangle-down",0,0,l,l).on("click",function(){t.scroll(1,f)}).add(c)),t.scroll(0),e=s):c&&(u.attr({height:n.chartHeight}),c.hide(),this.scrollGroup.attr({translateY:1})),e},scroll:function(e,t){var n=this.pageCount,r=this.currentPage+e,i=this.clipHeight,s=this.options.navigation,o=s.activeColor,s=s.inactiveColor,u=this.pager,a=this.padding;r>n&&(r=n),r>0&&(t!==R&&O(t,this.chart),this.nav.attr({translateX:a,translateY:i+7,visibility:"visible"}),this.up.attr({fill:r===1?s:o}).css({cursor:r===1?"default":"pointer"}),u.attr({text:r+"/"+this.pageCount}),this.down.attr({x:18+this.pager.getBBox().width,fill:r===n?s:o}).css({cursor:r===n?"default":"pointer"}),this.scrollGroup.animate({translateY:-K(i*(r-1),this.fullHeight-i+a)+1}),u.attr({text:r+"/"+n}),this.currentPage=r)}},q.prototype={initSeries:function(e){var t=this.options.chart,t=new zt[e.type||t.type||t.defaultSeriesType];return t.init(this,e),t},addSeries:function(e,t,n){var r=this;e&&(O(n,r),t=p(t,!0),tn(r,"addSeries",{options:e},function(){r.initSeries(e),r.isDirtyLegend=!0,t&&r.redraw()}))},isInsidePlot:function(e,t){return e>=0&&e<=this.plotWidth&&t>=0&&t<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&Jt(this.axes,function(e){e.adjustTickAmount()}),this.maxTicks=null},redraw:function(e){var t=this.axes,n=this.series,r=this.tracker,i=this.legend,s=this.isDirtyLegend,o,u=this.isDirtyBox,a=n.length,f=a,l=this .clipRect,c=this.renderer,h=c.isHidden();O(e,this);for(h&&this.cloneRenderTo();f--;)if(e=n[f],e.isDirty&&e.options.stacking){o=!0;break}if(o)for(f=a;f--;)if(e=n[f],e.options.stacking)e.isDirty=!0;Jt(n,function(e){e.isDirty&&e.options.legendType==="point"&&(s=!0)}),s&&i.options.enabled&&(i.render(),this.isDirtyLegend=!1),this.hasCartesianSeries&&(this.isResizing||(this.maxTicks=null,Jt(t,function(e){e.setScale()})),this.adjustTickAmounts(),this.getMargins(),Jt(t,function(e){e.isDirtyExtremes&&(e.isDirtyExtremes=!1,tn(e,"afterSetExtremes",e.getExtremes()));if(e.isDirty||u||o)e.redraw(),u=!0})),u&&(this.drawChartBox(),l&&(sn(l),l.animate({width:this.plotSizeX,height:this.plotSizeY+1}))),Jt(n,function(e){e.isDirty&&e.visible&&(!e.isCartesian||e.xAxis)&&e.redraw()}),r&&r.resetTracker&&r.resetTracker(!0),c.draw(),tn(this,"redraw"),h&&this.cloneRenderTo(!0)},showLoading:function(t){var n=this.options,r=this.loadingDiv,i=n.loading;r||(this.loadingDiv=r=v(wt,{className:"highcharts-loading"},e(i.style,{left:this.plotLeft+"px",top:this.plotTop+"px",width:this.plotWidth+"px",height:this.plotHeight+"px",zIndex:10,display:Et}),this.container),this.loadingSpan=v("span",null,i.labelStyle,r)),this.loadingSpan.innerHTML=t||n.lang.loading,this.loadingShown||(d(r,{opacity:0,display:""}),rn(r,{opacity:i.style.opacity},{duration:i.showDuration||0}),this.loadingShown=!0)},hideLoading:function(){var e=this.options,t=this.loadingDiv;t&&rn(t,{opacity:0},{duration:e.loading.hideDuration||100,complete:function(){d(t,{display:Et})}}),this.loadingShown=!1},get:function(e){var t=this.axes,n=this.series,r,i;for(r=0;rK(i.dataMin,i.min)&&n19?this.containerHeight:400)},cloneRenderTo:function(e){var t=this.renderToClone,n=this.container;e?t&&(this.renderTo.appendChild(n),k(t),delete this.renderToClone):(n&&this.renderTo.removeChild(n),this.renderToClone=t=this.renderTo.cloneNode(0),d(t,{position:"absolute",top:"-9999px",display:"block"}),U.body.appendChild(t),n&&t.appendChild(n))},getContainer:function(){var t,n=this.options.chart,i,s,o;this.renderTo=t=n.renderTo,o="highcharts-"+ht++,r(t)&&(this.renderTo=t=U.getElementById(t)),t||L(13,!0),t.innerHTML="",t.offsetWidth||this.cloneRenderTo(),this.getChartSize(),i=this.chartWidth,s=this.chartHeight,this.container=t=v(wt,{className:"highcharts-container"+(n.className?" "+n.className:""),id:o},e({position:"relative",overflow:"hidden",width:i+"px",height:s+"px",textAlign:"left",lineHeight:"normal"},n.style),this.renderToClone||t),this.renderer=n.forExport?new cn(t,i,s,!0):new ft(t,i,s),at&&this.renderer.create(this,t,i,s)},getMargins:function(){var e=this.options.chart,t=e.spacingTop,n=e.spacingRight,r=e.spacingBottom,e=e.spacingLeft,i,s=this.legend,o=this.optionsMarginTop,u=this.optionsMarginLeft,a=this.optionsMarginRight,f=this.optionsMarginBottom,c=this.chartTitleOptions,h=this.chartSubtitleOptions,d=this.options.legend,v=p(d.margin,10),m=d.x,g=d.y,y=d.align,b=d.verticalAlign;this.resetMargins(),i=this.axisOffset,(this.title||this.subtitle)&&!l(this.optionsMarginTop)&&(h=J(this.title&&!c.floating&&!c.verticalAlign&&c.y||0,this.subtitle&&!h.floating&&!h.verticalAlign&&h.y||0))&&(this.plotTop=J(this.plotTop,h+p(c.margin,15)+t)),s.display&&!d.floating&&(y==="right"?l(a)||(this.marginRight=J(this.marginRight,s.legendWidth-m+v+n)):y==="left"?l(u)||(this.plotLeft=J(this.plotLeft,s.legendWidth+m+v+e)):b==="top"?l(o)||(this.plotTop=J(this.plotTop,s.legendHeight+g+v+t)):b==="bottom"&&!l(f)&&(this.marginBottom=J(this.marginBottom,s.legendHeight-g+v+r))),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),this.hasCartesianSeries&&Jt(this.axes,function(e){e.getOffset()}),l(u)||(this.plotLeft+=i[3]),l(o)||(this.plotTop+=i[0]),l(f)||(this.marginBottom+=i[2]),l(a)||(this.marginRight+=i[1]),this.setChartSize()},initReflow:function(){function e(e){var s=n.width||Vt(r,"width"),o=n.height||Vt(r,"height"),e=e?e.target:z;if(s&&o&&(e===z||e===U)){if(s!==t.containerWidth||o!==t.containerHeight)clearTimeout(i),i=setTimeout(function(){t.resize(s,o,!1)},100);t.containerWidth=s,t.containerHeight=o}}var t=this,n=t.options.chart,r=t.renderTo,i;Zt(z,"resize",e),Zt(t,"destroy",function(){en(z,"resize",e)})},fireEndResize:function(){var e=this;e&&tn(e,"endResize",null,function(){e.isResizing-=1})},resize:function(e,t,n){var r,i,s=this.title,o=this.subtitle;this.isResizing+=1,O(n,this),this.oldChartHeight=this.chartHeight,this.oldChartWidth=this.chartWidth,l(e)&&(this.chartWidth=r=X(e)),l(t)&&(this.chartHeight=i=X(t)),d(this.container,{width:r+"px",height:i+"px"}),this.renderer.setSize(r,i,n),this.plotWidth=r-this.plotLeft-this.marginRight,this.plotHeight=i-this.plotTop-this.marginBottom,this.maxTicks=null,Jt(this.axes,function(e){e.isDirty=!0,e.setScale()}),Jt(this.series,function(e){e.isDirty=!0}),this.isDirtyBox=this.isDirtyLegend=!0,this.getMargins(),e=this.spacingBox,s&&s.align(null,null,e),o&&o.align(null,null,e),this.redraw(n),this.oldChartHeight=null,tn(this,"resize"),mt===!1?this.fireEndResize():setTimeout(this.fireEndResize,mt&&mt.duration||500)},setChartSize:function(){var e=this.inverted,t=this.chartWidth,n=this.chartHeight,r=this.options.chart,i=r.spacingTop,s=r.spacingRight,o=r.spacingBottom,r=r.spacingLeft;this.plotLeft=X(this.plotLeft),this.plotTop=X(this.plotTop),this.plotWidth=X(t-this.plotLeft-this.marginRight),this.plotHeight=X(n-this.plotTop-this.marginBottom),this.plotSizeX=e?this.plotHeight:this.plotWidth,this.plotSizeY=e?this.plotWidth:this.plotHeight,this.spacingBox={x:r,y:i,width:t-r-s,height:n-i-o},Jt(this.axes,function(e){e.setAxisSize(),e.setAxisTranslation()})},resetMargins:function(){var e=this.options.chart,t=e.spacingRight,n=e.spacingBottom,r=e.spacingLeft;this.plotTop=p(this.optionsMarginTop,e.spacingTop),this.marginRight=p(this.optionsMarginRight,t),this.marginBottom=p(this.optionsMarginBottom,n),this.plotLeft=p(this.optionsMarginLeft,r),this.axisOffset=[0,0,0,0]},drawChartBox:function(){var e=this.options.chart,t=this.renderer,n=this.chartWidth,r=this.chartHeight,i=this.chartBackground,s=this.plotBackground,o=this.plotBorder,u=this.plotBGImage,a=e.borderWidth||0,f=e.backgroundColor,l=e.plotBackgroundColor,c=e.plotBackgroundImage,h,p={x:this.plotLeft,y:this.plotTop,width:this.plotWidth,height:this.plotHeight};h=a+(e.shadow?8:0);if(a||f)i?i.animate(i.crisp(null,null,null,n-h,r-h)):(i={fill:f||Et},a&&(i.stroke=e.borderColor,i["stroke-width"]=a),this.chartBackground=t.rect(h/2,h/2,n-h,r-h,e.borderRadius,a).attr(i).add().shadow(e.shadow));l&&(s?s.animate(p):this.plotBackground=t.rect(this.plotLeft,this.plotTop,this.plotWidth,this.plotHeight,0).attr({fill:l}).add().shadow(e.plotShadow)),c&&(u?u.animate(p):this.plotBGImage=t.image(c,this.plotLeft,this.plotTop,this.plotWidth,this.plotHeight).add()),e.plotBorderWidth&&(o?o.animate(o.crisp(null,this.plotLeft,this.plotTop,this.plotWidth,this.plotHeight)):this.plotBorder=t.rect(this.plotLeft,this.plotTop,this.plotWidth,this.plotHeight,0,e.plotBorderWidth).attr({stroke:e.plotBorderColor,"stroke-width":e.plotBorderWidth,zIndex:4}).add()),this.isDirtyBox=!1},propFromSeries:function(){var e=this,t=e.options.chart,n,r=e.options.series,i,s;Jt(["inverted","angular","polar"],function(o){n=zt[t.type||t.defaultSeriesType],s=e[o]||t[o]||n&&n.prototype[o];for(i=r&&r.length;!s&&i--;)(n=zt[r[i].type])&&n.prototype[o]&&(s=!0);e[o]=s})},render:function(){var t=this,r=t.axes,i=t.renderer,s=t.options,o=s.labels,s=s.credits,u;t.setTitle(),t.legend=new I(t),Jt(r,function(e){e.setScale()}),t.getMargins(),t.maxTicks=null,Jt(r,function(e){e.setTickPositions(!0),e.setMaxTicks()}),t.adjustTickAmounts(),t.getMargins(),t.drawChartBox(),t.hasCartesianSeries&&Jt(r,function(e){e.render()}),t.seriesGroup||(t.seriesGroup=i.g("series-group").attr({zIndex:3}).add()),Jt(t.series,function(e){e.translate(),e.setTooltipPoints(),e.render()}),o.items&&Jt(o.items,function(){var r=e(o.style,this.style),s=n(r.left)+t.plotLeft,u=n(r.top)+t.plotTop+12;delete r.left,delete r.top,i.text(this.html,s,u).attr({zIndex:2}).css(r).add()}),s.enabled&&!t.credits&&(u=s.href,t.credits=i.text(s.text,0,0).on("click",function(){u&&(location.href=u)}).attr({align:s.position.align,zIndex:8}).css(s.style).add().align(s.position)),t.hasRendered=!0},destroy:function(){var e=this,t=e.axes,n=e.series,r=e.container,i,s=r&&r.parentNode;if(e!==null){tn(e,"destroy"),en(e);for(i=t.length;i--;)t[i]=t[i].destroy();for(i=n.length;i--;)n[i]=n[i].destroy();Jt("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,tracker,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(t){var n=e[t];n&&(e[t]=n.destroy())}),r&&(r.innerHTML="",en(r),s&&k(r),r=null);for(i in e)delete e[i];e=e.options=null}},firstRender:function(){var e=this,t=e.options,n=e.callback;!ot&&z==z.top&&U.readyState!=="complete"||at&&!z.canvg?at?vn.push(function(){e.firstRender()},t.global.canvasToolsURL):U.attachEvent("onreadystatechange",function(){U.detachEvent("onreadystatechange",e.firstRender),U.readyState==="complete"&&e.firstRender()}):(e.getContainer(),tn(e,"init"),Highcharts.RangeSelector&&t.rangeSelector.enabled&&(e.rangeSelector=new Highcharts.RangeSelector(e)),e.resetMargins(),e.setChartSize(),e.propFromSeries(),e.getAxes(),Jt(t.series||[],function(t){e.initSeries(t)}),Highcharts.Scroller&&(t.navigator.enabled||t.scrollbar.enabled)&&(e.scroller=new Highcharts.Scroller(e)),e.tracker=new F(e,t),e.render(),e.renderer.draw(),n&&n.apply(e,[e]),Jt(e.callbacks,function(t){t.apply(e,[e])}),e.cloneRenderTo(!0),tn(e,"load"))},init:function(e){var t=this.options.chart,n;t.reflow!==!1&&Zt(this,"load",this.initReflow);if(e)for(n in e)Zt(this,n,e[n]);this.xAxis=[],this.yAxis=[],this.animation=at?!1:p(t.animation,!0),this.setSize=this.resize,this.pointCount=0,this.counters=new S,this.firstRender()}},q.prototype.callbacks=[];var mn=function(){};mn.prototype={init:function(e,t,n){var r=e.chart.counters;return this.series=e,this.applyOptions(t,n),this.pointAttr={},e.options.colorByPoint&&(t=e.chart.options.colors,this.options||(this.options={}),this.color=this.options.color=this.color||t[r.color++],r.wrapColor(t.length)),e.chart.pointCount++,this},applyOptions:function(t,n){var r=this.series,i=typeof t;this.config=t;if(i==="number"||t===null)this.y=t;else if(typeof t[0]=="number")this.x=t[0],this.y=t[1];else if(i==="object"&&typeof t.length!="number"){if(e(this,t),this.options=t,t.dataLabels)r._hasPointLabels=!0}else typeof t[0]=="string"&&(this.name=t[0],this.y=t[1]);this.x===R&&(this.x=n===R?r.autoIncrement():n)},destroy:function(){var e=this.series.chart,t=e.hoverPoints,n;e.pointCount--,t&&(this.setState(),f(t,this),!t.length)&&(e.hoverPoints=null),this===e.hoverPoint&&this.onMouseOut();if(this.graphic||this.dataLabel)en(this),this.destroyElements();this.legendItem&&e.legend.destroyItem(this);for(n in this)this[n]=null},destroyElements:function(){for(var e="graphic,tracker,dataLabel,group,connector,shadowGroup".split(","),t,n=6;n--;)t=e[n],this[t]&&(this[t]=this[t].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(e,t){var n=this,r=n.series.chart,e=p(e,!n.selected);n.firePointEvent(e?"select":"unselect",{accumulate:t},function(){n.selected=e,n.setState(e&&"select"),t||Jt(r.getSelectedPoints(),function(e){e.selected&&e!==n&&(e.selected=!1,e.setState(""),e.firePointEvent("unselect"))})})},onMouseOver:function(){var e=this.series,t=e.chart,n=t.tooltip,r=t.hoverPoint;r&&r!==this&&r.onMouseOut(),this.firePointEvent("mouseOver"),n&&(!n.shared||e.noSharedTooltip)&&n.refresh(this),this.setState("hover"),t.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut"),this.setState(),this.series.chart.hoverPoint=null},tooltipFormatter:function(e){var t=this.series,n=t.tooltipOptions,i=e.match(/\{(series|point)\.[a-zA-Z]+\}/g),s=/[{\.}]/,o,u,a,f,l={y:0,open:0,high:0,low:0,close:0,percentage:1,total:1};n.valuePrefix=n.valuePrefix||n.yPrefix,n.valueDecimals=n.valueDecimals||n.yDecimals,n.valueSuffix=n.valueSuffix||n.ySuffix;for(f in i)u=i[f],r(u)&&u!==e&&(a=(" "+u).split(s),o={point:this,series:t}[a[1]],a=a[2],o===this&&l.hasOwnProperty(a)?(o=l[a]?a:"value",o=(n[o+"Prefix"]||"")+g(this[a],p(n[o+"Decimals"],-1))+(n[o+"Suffix"]||"")):o=o[a],e=e.replace(u,o));return e},update:function(e,t,n){var r=this,s=r.series,o=r.graphic,u,a=s.data,f=a.length,l=s.chart,t=p(t,!0);r.firePointEvent("update",{options:e},function(){r.applyOptions(e),i(e)&&(s.getAttribs(),o&&o.attr(r.pointAttr[s.state]));for(u=0;ue+1&&t.push(r.slice(e+1,s)),e=s):s===i-1&&t.push(r.slice(e+1,s+1))});this.segments=t},setOptions:function(e){var t=this.chart.options,n=t.plotOptions,r=e.data;return e.data=null,n=Yt(n[this.type],n.series,e),n.data=e.data=r,this.tooltipOptions=Yt(t.tooltip,n.tooltip),n},getColor:function(){var e=this.options,t=this.chart.options.colors,n=this.chart.counters;this.color=e.color||!e.colorByPoint&&t[n.color++]||"gray",n.wrapColor(t.length)},getSymbol:function(){var e=this.options.marker,t=this.chart,n=t.options.symbols,t=t.counters;this.symbol=e.symbol||n[t.symbol++],/^url/.test(this.symbol)&&(e.radius=0),t.wrapSymbol(n.length)},drawLegendSymbol:function(e){var t=this.options,n=t.marker,r=e.options.symbolWidth,i=this.chart.renderer,s=this.legendGroup,e=e.baseline,o;t.lineWidth&&(o={"stroke-width":t.lineWidth},t.dashStyle&&(o.dashstyle=t.dashStyle),this.legendLine=i.path(["M",0,e-4,"L",r,e-4]).attr(o).add(s)),n&&n.enabled&&(t=n.radius,this.legendSymbol=i.symbol(this.symbol,r/2-t,e-4-t,2*t,2*t).attr(this.pointAttr[""]).add(s))},addPoint:function(e,t,n,r){var i=this.data,s=this.graph,o=this.area,u=this.chart,a=this.xData,f=this.yData,l=s&&s.shift||0,c=this.options.data;O(r,u),s&&n&&(s.shift=l+1),o&&(n&&(o.shift=l+1),o.isArea=!0),t=p(t,!0),r={series:this},this.pointClass.prototype.applyOptions.apply(r,[e]),a.push(r.x),f.push(this.valueCount===4?[r.open,r.high,r.low,r.close]:r.y),c.push(e),n&&(i[0]&&i[0].remove?i[0].remove(!1):(i.shift(),a.shift(),f.shift(),c.shift())),this.getAttribs(),this.isDirtyData=this.isDirty=!0,t&&u.redraw()},setData:function(e,t){var n=this.points,r=this.options,i=this.initialColor,u=this.chart,a=null,f=this.xAxis,c=this.pointClass.prototype;this.xIncrement=null,this.pointRange=f&&f.categories&&1||r.pointRange,l(i)&&(u.counters.color=i);var h=[],d=[],v=e?e.length:[],m=this.valueCount;if(v>(r.turboThreshold||1e3)){for(i=0;a===null&&il||this.forceCrop))if(e=a.getExtremes(),a=e.min,l=e.max,t[r-1]l)t=[],n=[];else if(t[0]l){for(e=0;e=a){i=J(0,e-1);break}for(;el){s=e+1;break}t=t.slice(i,s),n=n.slice(i,s),o=!0}for(e=t.length-1;e>0;e--)if(r=t[e]-t[e-1],r>0&&(u===R||r=0&&r<=i;)u[r++]=s}this.tooltipPoints=u}},tooltipHeaderFormatter:function(e){var t=this.tooltipOptions,n=t.xDateFormat,r=this.xAxis,i=r&&r.options.type==="datetime",s;if(i&&!n)for(s in yt)if(yt[s]>=r.closestPointRange){n=t.dateTimeLabelFormats[s];break}return t.headerFormat.replace("{point.key}",i?vt(n,e):e).replace("{series.name}",this.name).replace("{series.color}",this.color)},onMouseOver:function(){var e=this.chart,t=e.hoverSeries;if(lt||!e.mouseIsDown)t&&t!==this&&t.onMouseOut(),this.options.events.mouseOver&&tn(this,"mouseOver"),this.setState("hover"),e.hoverSeries=this},onMouseOut:function(){var e=this.options,t=this.chart,n=t.tooltip,r=t.hoverPoint;r&&r.onMouseOut(),this&&e.events.mouseOut&&tn(this,"mouseOut"),n&&!e.stickyTracking&&!n.shared&&n.hide(),this.setState(),t.hoverSeries=null},animate:function(e){var t=this.chart,n=this.clipRect,r=this.options.animation;r&&!i(r)&&(r={}),e?n.isAnimating||(n.attr("width",0),n.isAnimating=!0):(n.animate({width:t.plotSizeX},r),this.animate=null)},drawPoints:function(){var t,n=this.points,r=this.chart,i,s,o,u,a,f,l,c;if(this.options.marker.enabled)for(o=n.length;o--;)if(u=n[o],i=u.plotX,s=u.plotY,c=u.graphic,s!==R&&!isNaN(s))if(t=u.pointAttr[u.selected?"select":""],a=t.r,f=p(u.marker&&u.marker.symbol,this.symbol),l=f.indexOf("url")===0,c)c.animate(e({x:i-a,y:s-a},c.symbolName?{width:2*a,height:2*a}:{}));else if(a>0||l)u.graphic=r.renderer.symbol(f,i-a,s-a,2*a,2*a).attr(t).add(this.group)},convertAttribs:function(e,t,n,r){var i=this.pointAttrToOptions,s,o,u={},e=e||{},t=t||{},n=n||{},r=r||{};for(s in i)o=i[s],u[s]=p(e[o],t[s],n[s],r[s]);return u},getAttribs:function(){var e=this,t=fn[e.type].marker?e.options.marker:e.options,n=t.states,r=n.hover,i,s=e.color,o={stroke:s,fill:s},u=e.points||[],a=[],f,c=e.pointAttrToOptions,h;e.options.marker?(r.radius=r.radius||t.radius+2,r.lineWidth=r.lineWidth||t.lineWidth+1):r.color=r.color||ln(r.color||s).brighten(r.brightness).get(),a[""]=e.convertAttribs(t,o),Jt(["hover","select"],function(t){a[t]=e.convertAttribs(n[t],a[""])}),e.pointAttr=a;for(s=u.length;s--;){o=u[s],(t=o.options&&o.options.marker||o.options)&&t.enabled===!1&&(t.radius=0),i=!1;if(o.options)for(h in c)l(t[c[h]])&&(i=!0);i?(f=[],n=t.states||{},i=n.hover=n.hover||{},e.options.marker||(i.color=ln(i.color||o.options.color).brighten(i.brightness||r.brightness).get()),f[""]=e.convertAttribs(t,a[""]),f.hover=e.convertAttribs(n.hover,a.hover,f[""]),f.select=e.convertAttribs(n.select,a.select,f[""])):f=a,o.pointAttr=f}},destroy:function(){var e=this,t=e.chart,n=e.clipRect,r=/AppleWebKit\/533/.test(tt),i,s,o=e.data||[],u,a,l;tn(e,"destroy"),en(e),Jt(["xAxis","yAxis"],function(t){if(l=e[t])f(l.series,e),l.isDirty=!0}),e.legendItem&&e.chart.legend.destroyItem(e);for(s=o.length;s--;)(u=o[s])&&u.destroy&&u.destroy();e.points=null,n&&n!==t.clipRect&&(e.clipRect=n.destroy()),Jt("area,graph,dataLabelsGroup,group,tracker,trackerGroup".split(","),function(t){e[t]&&(i=r&&t==="group"?"hide":"destroy",e[t][i]())}),t.hoverSeries===e&&(t.hoverSeries=null),f(t.series,e);for(a in e)delete e[a]},drawDataLabels:function(){var e=this,t=e.options,n=t.dataLabels;if(n.enabled||e._hasPointLabels){var r,i,s=e.points,o,u,a,f=e.dataLabelsGroup,c=e.chart,h=e.xAxis,h=h?h.left:c.plotLeft,d=e.yAxis,d=d?d.top:c.plotTop,v=c.renderer,m=c.inverted,g=e.type,y=t.stacking,b=g==="column"||g==="bar",w=n.verticalAlign===null,E=n.y===null,S=v.fontMetrics(n.style.fontSize),x=S.h,T=S.b,N,C;b&&(S={top:T,middle:T-x/2,bottom:-x+T},y?(w&&(n=Yt(n,{verticalAlign:"middle"})),E&&(n=Yt(n,{y:S[n.verticalAlign]}))):w?n=Yt(n,{verticalAlign:"top"}):E&&(n=Yt(n,{y:S[n.verticalAlign]}))),f?f.translate(h,d):f=e.dataLabelsGroup=v.g("data-labels").attr({visibility:e.visible?"visible":"hidden",zIndex:6}).translate(h,d).add(),u=n,Jt(s,function(s){N=s.dataLabel,n=u,(o=s.options)&&o.dataLabels&&(n=Yt(n,o.dataLabels));if(C=n.enabled){var h=s.barX&&s.barX+s.barW/2||p(s.plotX,-999),d=p(s.plotY,-999),w=n.y===null?s.y>=t.threshold?-x+T:T:n.y;r=(m?c.plotWidth-d:h)+n.x,i=X((m?c.plotHeight-h:d)+w)}if(N&&e.isCartesian&&(!c.isInsidePlot(r,i)||!C))s.dataLabel=N.destroy();else if(C){var h=n.align,E;a=n.formatter.call(s.getLabelConfig(),n),g==="column"&&(r+={left:-1,right:1}[h]*s.barW/2||0),!y&&m&&s.y<0&&(h="right",r-=10),n.style.color=p(n.color,n.style.color,e.color,"black");if(N)N.attr({text:a}).animate({x:r,y:i});else if(l(a)){h={align:h,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth,r:n.borderRadius||0,rotation:n.rotation,padding:n.padding,zIndex:1};for(E in h)h[E]===R&&delete h[E];N=s.dataLabel=v[n.rotation?"text":"label"](a,r,i,null,null,null,n.useHTML,!0).attr(h).css(n.style).add(f).shadow(n.shadow)}b&&t.stacking&&N&&(E=s.barX,h=s.barY,d=s.barW,s=s.barH,N.align(n,null,{x:m?c.plotWidth-h-s:E,y:m?c.plotHeight-E-d:h,width:m?s:d,height:m?d:s}))}})}},getSegmentPath:function(e){var t=this,n=[];return Jt(e,function(r,i){t.getPointSpline?n.push.apply(n,t.getPointSpline(e,r,i)):(n.push(i?"L":"M"),i&&t.options.step&&n.push(r.plotX,e[i-1].plotY),n.push(r.plotX,r.plotY))}),n},drawGraph:function(){var e=this,t=e.options,n=e.graph,r=[],i=e.group,s=t.lineColor||e.color,o=t.lineWidth,u=t.dashStyle,a,f=e.chart.renderer,l=[];Jt(e.segments,function(t){a=e.getSegmentPath(t),t.length>1?r=r.concat(a):l.push(t[0])}),e.graphPath=r,e.singlePoints=l,n?(sn(n),n.animate({d:r})):o&&(n={stroke:s,"stroke-width":o},u&&(n.dashstyle=u),e.graph=f.path(r).attr(n).add(i).shadow(t.shadow))},invertGroups:function(){function e(){var e={width:t.yAxis.len,height:t.xAxis.len};n.attr(e).invert(),r&&r.attr(e).invert()}var t=this,n=t.group,r=t.trackerGroup,i=t.chart;Zt(i,"resize",e),Zt(t,"destroy",function(){en(i,"resize",e)}),e(),t.invertGroups=e},createGroup:function(){var e=this.chart;(this.group=e.renderer.g("series")).attr({visibility:this.visible?"visible":"hidden",zIndex:this.options.zIndex}).translate(this.xAxis.left,this.yAxis.top).add(e.seriesGroup),this.createGroup=bt},render:function(){var e=this,t=e.chart,n,r=e.options,i=r.clip!==!1,s=r.animation,s=(r=s&&e.animate)?s&&s.duration||500:0,o=e.clipRect,u=t.renderer;!o&&(o=e.clipRect=!t.hasRendered&&t.clipRect?t.clipRect:u.clipRect(0,0,t.plotSizeX,t.plotSizeY+1),!t.clipRect)&&(t.clipRect=o),e.createGroup(),n=e.group,e.drawDataLabels(),r&&e.animate(!0),e.getAttribs(),e.drawGraph&&e.drawGraph(),e.drawPoints(),e.options.enableMouseTracking!==!1&&e.drawTracker(),t.inverted&&e.invertGroups(),i&&!e.hasRendered&&(n.clip(o),e.trackerGroup&&e.trackerGroup.clip(t.clipRect)),r&&e.animate(),setTimeout(function(){o.isAnimating=!1,(n=e.group)&&o!==t.clipRect&&o.renderer&&(i&&n.clip(e.clipRect=t.clipRect),o.destroy())},s),e.isDirty=e.isDirtyData=!1,e.hasRendered=!0},redraw:function(){var e=this.chart,t=this.isDirtyData,n=this.group;n&&(e.inverted&&n.attr({width:e.plotWidth,height:e.plotHeight}),n.animate({translateX:this.xAxis.left,translateY:this.yAxis.top})),this.translate(),this.setTooltipPoints(!0),this.render(),t&&tn(this,"updatedData")},setState:function(e){var t=this.options,n=this.graph,r=t.states,t=t.lineWidth,e=e||"";this.state!==e&&(this.state=e,r[e]&&r[e].enabled===!1||(e&&(t=r[e].lineWidth||t+1),n&&!n.dashstyle&&n.attr({"stroke-width":t},e?0:500)))},setVisible:function(e,t){var n=this.chart,r=this.legendItem,i=this.group,s=this.tracker,o=this.dataLabelsGroup,u,a=this.points,f=n.options.chart.ignoreHiddenSeries;u=this.visible,u=(this.visible=e=e===R?!u:e)?"show":"hide",i&&i[u]();if(s)s[u]();else if(a)for(i=a.length;i--;)(s=a[i],s.tracker)&&s.tracker[u]();o&&o[u](),r&&n.legend.colorizeItem(this,e),this.isDirty=!0,this.options.stacking&&Jt(n.series,function(e){e.options.stacking&&e.visible&&(e.isDirty=!0)}),f&&(n.isDirtyBox=!0),t!==!1&&n.redraw(),tn(this,u)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(e){this.selected=e=e===R?!this.selected:e,this.checkbox&&(this.checkbox.checked=e),tn(this,e?"select":"unselect")},drawTrackerGroup:function(){var e=this.trackerGroup,t=this.chart;return this.isCartesian&&(e||(this.trackerGroup=e=t.renderer.g().attr({zIndex:this.options.zIndex||1}).add(t.trackerGroup)),e.translate(this.xAxis.left,this.yAxis.top)),e},drawTracker:function(){var e=this,t=e.options,n=t.trackByArea,r=[].concat(n?e.areaPath:e.graphPath),i=r.length,s=e.chart,o=s.renderer,u=s.options.tooltip.snap,a=e.tracker,f=t.cursor,f=f&&{cursor:f},l=e.singlePoints,c=e.drawTrackerGroup(),h;if(i&&!n)for(h=i+1;h--;)r[h]==="M"&&r.splice(h+1,0,r[h+1]-u,r[h+2],"L"),(h&&r[h]==="M"||h===i)&&r.splice(h,0,"L",r[h-2]+u,r[h-1]);for(h=0;h=0;r--)re&&a>i?(a=J(e,i),l=2*i-a):ao&&l>i?(l=J(o,i),a=2*i-l):lx?u-x:S-(o<=S?x:0)),e(r,{barX:a,barY:f,barW:w,barH:l,pointWidth:b}),r.shapeType="rect",r.shapeArgs=o=n.renderer.Element.prototype.crisp.call(0,s,a,f,w,l),s%2&&(o.y-=1,o.height+=1),r.trackerArgs=Q(l)<3&&Yt(r.shapeArgs,{height:6,y:f-3})})},getSymbol:function(){},drawLegendSymbol:Xt.prototype.drawLegendSymbol,drawGraph:function(){},drawPoints:function(){var e=this,t=e.options,n=e.chart.renderer,r,i;Jt(e.points,function(s){var o=s.plotY;o!==R&&!isNaN(o)&&s.y!==null&&(r=s.graphic,i=s.shapeArgs,r?(sn(r),r.animate(Yt(i))):s.graphic=r=n[s.shapeType](i).attr(s.pointAttr[s.selected?"select":""]).add(e.group).shadow(t.shadow,null,t.stacking&&!t.borderRadius))})},drawTracker:function(){var e=this,t=e.chart,n=t.renderer,r,i,s=+(new Date),o=e.options,u=o.cursor,a=u&&{cursor:u},f=e.drawTrackerGroup(),l,h,p;Jt(e.points,function(u){i=u.tracker,r=u.trackerArgs||u.shapeArgs,h=u.plotY,p=!e.isCartesian||h!==R&&!isNaN(h),delete r.strokeWidth,u.y!==null&&p&&(i?i.attr(r):u.tracker=n[u.shapeType](r).attr({isTracker:s,fill:St,visibility:e.visible?"visible":"hidden"}).on(lt?"touchstart":"mouseover",function(n){l=n.relatedTarget||n.fromElement,t.hoverSeries!==e&&c(l,"isTracker")!==s&&e.onMouseOver(),u.onMouseOver()}).on("mouseout",function(t){!o.stickyTracking&&(l=t.relatedTarget||t.toElement,c(l,"isTracker")!==s)&&e.onMouseOut()}).css(a).add(u.group||f))})},animate:function(e){var t=this,n=t.points,r=t.options;e||(Jt(n,function(e){var n=e.graphic,e=e.shapeArgs,i=t.yAxis,s=r.threshold;n&&(n.attr({height:0,y:l(s)?i.getThreshold(s):i.translate(i.getExtremes().min,0,1,0,1)}),n.animate({height:e.height,y:e.y},r.animation))}),t.animate=null)},remove:function(){var e=this,t=e.chart;t.hasRendered&&Jt(t.series,function(t){t.type===e.type&&(t.isDirty=!0)}),gn.prototype.remove.apply(e,arguments)}}),zt.column=pn,fn.bar=Yt(fn.column,{dataLabels:{align:"left",x:5,y:null,verticalAlign:"middle"}}),yn=m(pn,{type:"bar",inverted:!0}),zt.bar=yn,fn.scatter=Yt(Wt,{lineWidth:0,states:{hover:{lineWidth:0}},tooltip:{headerFormat:'{series.name}
    ',pointFormat:"x: {point.x}
    y: {point.y}
    "}}),yn=m(gn,{type:"scatter",sorted:!1,translate:function(){var e=this;gn.prototype.translate.apply(e),Jt(e.points,function(t){t.shapeType="circle",t.shapeArgs={x:t.plotX,y:t.plotY,r:e.chart.options.tooltip.snap}})},drawTracker:function(){for(var e=this,t=e.options.cursor,t=t&&{cursor:t},n=e.points,r=n.length,i;r--;)if(i=n[r].graphic)i.element._i=r;e._hasTracking?e._hasTracking=!0:e.group.attr({isTracker:!0}).on(lt?"touchstart":"mouseover",function(t){e.onMouseOver(),t.target._i!==R&&n[t.target._i].onMouseOver()}).on("mouseout",function(){e.options.stickyTracking||e.onMouseOut()}).css(t)}}),zt.scatter=yn,fn.pie=Yt(Wt,{borderColor:"#FFFFFF",borderWidth:1,center:["50%","50%"],colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}}}),Wt={type:"pie",isCartesian:!1,pointClass:m(mn,{init:function(){mn.prototype.init.apply(this,arguments);var t=this,n;return e(t,{visible:t.visible!==!1,name:p(t.name,"Slice")}),n=function(){t.slice()},Zt(t,"select",n),Zt(t,"unselect",n),t},setVisible:function(e){var t=this.series.chart,n=this.tracker,r=this.dataLabel,i=this.connector,s=this.shadowGroup,o;o=(this.visible=e=e===R?!this.visible:e)?"show":"hide",this.group[o](),n&&n[o](),r&&r[o](),i&&i[o](),s&&s[o](),this.legendItem&&t.legend.colorizeItem(this,e)},slice:function(e,t,n){var r=this.series.chart,i=this.slicedTranslation;O(n,r),p(t,!0),e=this.sliced=l(e)?e:!this.sliced,e={translateX:e?i[0]:r.plotLeft,translateY:e?i[1]:r.plotTop},this.group.animate(e),this.shadowGroup&&this.shadowGroup.animate(e)}}),pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=this.chart.counters.color},animate:function(){var e=this;Jt(e.points,function(t){var n=t.graphic,t=t.shapeArgs,r=-Z/2;n&&(n.attr({r:0,start:r,end:r}),n.animate({r:t.r,start:t.start,end:t.end},e.options.animation))}),e.animate=null},setData:function(e,t){gn.prototype.setData.call(this,e,!1),this.processData(),this.generatePoints(),p(t,!0)&&this.chart.redraw()},getCenter:function(){var e=this.options,t=this.chart,r=t.plotWidth,i=t.plotHeight,e=e.center.concat([e.size,e.innerSize||0]),s=K(r,i),o;return Gt(e,function(e,t){return(o=/%$/.test(e))?[r,i,s,s][t]*n(e)/100:e})},translate:function(){this.generatePoints();var e=0,t=-0.25,n=this.options,r=n.slicedOffset,i=r+n.borderWidth,s,o=this.chart,u,a,f,l=this.points,c=2*Z,h,p,d,v=n.dataLabels.distance;this.center=s=this.getCenter(),this.getX=function(e,t){return f=W.asin((e-s[1])/(s[2]/2+v)),s[0]+(t?-1:1)*G(f)*(s[2]/2+v)},Jt(l,function(t){e+=t.y}),Jt(l,function(n){h=e?n.y/e:0,u=X(t*c*1e3)/1e3,t+=h,a=X(t*c*1e3)/1e3,n.shapeType="arc",n.shapeArgs={x:s[0],y:s[1],r:s[2]/2,innerR:s[3]/2,start:u,end:a},f=(a+u)/2,n.slicedTranslation=Gt([G(f)*r+o.plotLeft,Y(f)*r+o.plotTop],X),p=G(f)*s[2]/2,d=Y(f)*s[2]/2,n.tooltipPos=[s[0]+p*.7,s[1]+d*.7],n.labelPos=[s[0]+p+G(f)*v,s[1]+d+Y(f)*v,s[0]+p+G(f)*i,s[1]+d+Y(f)*i,s[0]+p,s[1]+d,v<0?"center":f0,v=[[],[]],m,g,y,b,w=2,E;if(r.enabled){gn.prototype.drawDataLabels.apply(this),Jt(e,function(e){e.dataLabel&&v[e.labelPos[7]0){for(E=h-c-f;E<=h+c+f;E+=e)S.push(E);y=S.length;if(N>y){u=[].concat(T),u.sort(b);for(E=N;E--;)u[E].rank=E;for(E=N;E--;)T[E].rank>=y&&T.splice(E,1);N=T.length}for(E=0;E0){if(g=x.pop(),C=g.i,g=g.y,m>g&&S[C+1]!==null||m>>0;if(n===0)return-1;var r=0;arguments.length>0&&(r=Number(arguments[1]),r!==r?r=0:r!==0&&r!==Infinity&&r!==-Infinity&&(r=(r>0||-1)*Math.floor(Math.abs(r))));if(r>=n)return-1;var i=r>=0?r:Math.max(n-Math.abs(r),0);for(;i0)o=e.shift(),s=s[o];if(!s){if(I18n.fallbacks){var u=this.getFallbacks(i);for(var a=0;a11?1:0,l=e.getSeconds(),c=e.getMinutes(),h=e.getTimezoneOffset(),p=Math.floor(Math.abs(h/60)),d=Math.abs(h)-p*60,v=(h>0?"-":"+")+(p.toString().length<2?"0"+p:p)+(d.toString().length<2?"0"+d:d);a>12?a-=12:a===0&&(a=12);var m=function(e){var t="0"+e.toString();return t.substr(t.length-2)},g=t;return g=g.replace("%a",n.abbr_day_names[r]),g=g.replace("%A",n.day_names[r]),g=g.replace("%b",n.abbr_month_names[o]),g=g.replace("%B",n.month_names[o]),g=g.replace("%d",m(i)),g=g.replace("%e",i),g=g.replace("%-d",i),g=g.replace("%H",m(u)),g=g.replace("%-H",u),g=g.replace("%I",m(a)),g=g.replace("%-I",a),g=g.replace("%m",m(o)),g=g.replace("%-m",o),g=g.replace("%M",m(c)),g=g.replace("%-M",c),g=g.replace("%p",n.meridian[f]),g=g.replace("%S",m(l)),g=g.replace("%-S",l),g=g.replace("%w",r),g=g.replace("%y",m(s)),g=g.replace("%-y",m(s).replace(/^0+/,"")),g=g.replace("%Y",s),g=g.replace("%z",v),g},I18n.toNumber=function(e,t){t=this.prepareOptions(t,this.lookup("number.format"),{precision:3,separator:".",delimiter:",",strip_insignificant_zeros:!1});var n=e<0,r=Math.abs(e).toFixed(t.precision).toString(),i=r.split("."),s,o=[],u;e=i[0],s=i[1];while(e.length>0)o.unshift(e.substr(Math.max(0,e.length-3),3)),e=e.substr(0,e.length-3);u=o.join(t.delimiter),t.precision>0&&(u+=t.separator+i[1]),n&&(u="-"+u);if(t.strip_insignificant_zeros){var a={separator:new RegExp(t.separator.replace(/\./,"\\.")+"$"),zeros:/0+$/};u=u.replace(a.zeros,"").replace(a.separator,"")}return u},I18n.toCurrency=function(e,t){return t=this.prepareOptions(t,this.lookup("number.currency.format"),this.lookup("number.format"),{unit:"$",precision:2,format:"%u%n",delimiter:",",separator:"."}),e=this.toNumber(e,t),e=t.format.replace("%u",t.unit).replace("%n",e),e},I18n.toHumanSize=function(e,t){var n=1024,r=e,i=0,s,o;while(r>=n&&i<4)r/=n,i+=1;return i===0?(s=this.t("number.human.storage_units.units.byte",{count:r}),o=0):(s=this.t("number.human.storage_units.units."+[null,"kb","mb","gb","tb"][i]),o=r-Math.floor(r)===0?0:1),t=this.prepareOptions(t,{precision:o,format:"%n%u",delimiter:""}),e=this.toNumber(r,t),e=t.format.replace("%u",s).replace("%n",e),e},I18n.toPercentage=function(e,t){return t=this.prepareOptions(t,this.lookup("number.percentage.format"),this.lookup("number.format"),{precision:3,separator:".",delimiter:""}),e=this.toNumber(e,t),e+"%"},I18n.pluralizer=function(e){return pluralizer=this.pluralizationRules[e],pluralizer!==undefined?pluralizer:this.pluralizationRules.en},I18n.findAndTranslateValidNode=function(e,t){for(i=0;ie?n():r!==!0&&(u=setTimeout(s?o:n,s===t?e-l:e))}var u,a=0;return typeof r!="boolean"&&(s=i,i=r,r=t),n.guid&&(o.guid=i.guid=i.guid||n.guid++),o},n.debounce=function(e,n,i){return i===t?r(e,n,!1):r(e,i,n!==!1)}}(this),function(e){function t(t){return t=e(t),(!t.data("timeago")||t.data("timeago").title!=t.attr("title"))&&t.data("timeago",{datetime:i.parse(t.attr("title")),title:t.attr("title")}),t.data("timeago")}function n(e){return i.inWords(r(e))}function r(e){return i.distance(e)}e.timeago=function(t){return t instanceof Date?n(t):typeof t=="string"?n(e.timeago.parse(t)):n(e.timeago.datetime(t))};var i=e.timeago;e.extend(e.timeago,{settings:{refreshMillis:3e3,allowFuture:!0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",numbers:[]}},distanceInWords:function(t){if(!t)return;return typeof t=="string"&&(t=e.timeago.parse(t)),e.timeago.inWords(e.timeago.distance(t))},inWords:function(t){function n(n,i){var s=e.isFunction(n)?n(i,t):n,o=r.numbers&&r.numbers[i]||i;return s.replace(/%d/i,o)}var r=this.settings.strings,i=r.prefixAgo,s=r.suffixAgo;this.settings.allowFuture&&(t<0&&(i=r.prefixFromNow,s=r.suffixFromNow),t=Math.abs(t));var o=t/1e3,u=o/60,a=u/60,f=a/24,l=f/365,c=o<45&&n(r.seconds,Math.round(o))||o<90&&n(r.minute,1)||u<45&&n(r.minutes,Math.round(u))||u<90&&n(r.hour,1)||a<24&&n(r.hours,Math.round(a))||a<48&&n(r.day,1)||f<30&&n(r.days,Math.floor(f))||f<60&&n(r.month,1)||f<365&&n(r.months,Math.floor(f/30))||l<2&&n(r.year,1)||n(r.years,Math.floor(l));return e.trim([i,c,s].join(" "))},distance:function(e){return this.now()-e.getTime()},now:function(){return(new Date).getTime()},parse:function(t){var n=e.trim(t);return n=n.replace(/\.\d\d\d+/,""),n=n.replace(/-/,"/").replace(/-/,"/"),n=n.replace(/T/," ").replace(/Z/," UTC"),n=n.replace(/([\+-]\d\d)\:?(\d\d)/," $1$2"),new Date(n)}}),e.fn.timeago=function(){return this.each(function(){var r=t(this);isNaN(r.datetime)||e(this).text(n(r.datetime))}),this},document.createElement("abbr"),document.createElement("time")}(jQuery),function(){Function.prototype.scopedTo===void 0&&(Function.prototype.scopedTo=function(e,t){var n=this;return function(){return n.apply(e,Array.prototype.slice.call(t||[]).concat(Array.prototype.slice.call(arguments)))}});var e=function(t,n){this.options=n||{},this.key=t,this.channels=new e.Channels,this.global_emitter=new e.EventsDispatcher;var r=this;this.checkAppKey(),this.connection=new e.Connection(this.key,this.options),this.connection.bind("connected",function(){r.subscribeAll()}).bind("message",function(e){var t=e.event.indexOf("pusher_internal:")===0;if(e.channel){var n;(n=r.channel(e.channel))&&n.emit(e.event,e.data)}t||r.global_emitter.emit(e.event,e.data)}).bind("disconnected",function(){r.channels.disconnect()}).bind("error",function(t){e.warn("Error",t)}),e.instances.push(this),e.isReady&&r.connect()};e.instances=[],e.prototype={channel:function(e){return this.channels.find(e)},connect:function(){this.connection.connect()},disconnect:function(){this.connection.disconnect()},bind:function(e,t){return this.global_emitter.bind(e,t),this},bind_all:function(e){return this.global_emitter.bind_all(e),this},subscribeAll:function(){for(channelName in this.channels.channels)this.channels.channels.hasOwnProperty(channelName)&&this.subscribe(channelName)},subscribe:function(e){var t=this,n=this.channels.add(e,this);return this.connection.state==="connected"&&n.authorize(this.connection.socket_id,this.options,function(r,i){r?n.emit("pusher:subscription_error",i):t.send_event("pusher:subscribe",{channel:e,auth:i.auth,channel_data:i.channel_data})}),n},unsubscribe:function(e){this.channels.remove(e),this.connection.state==="connected"&&this.send_event("pusher:unsubscribe",{channel:e})},send_event:function(e,t,n){return this.connection.send_event(e,t,n)},checkAppKey:function(){(this.key===null||this.key===void 0)&&e.warn("Warning","You must pass your app key when you instantiate Pusher.")}},e.Util={extend:function t(e,n){for(var r in n)e[r]=n[r]&&n[r].constructor&&n[r].constructor===Object?t(e[r]||{},n[r]):n[r];return e},stringify:function(){for(var e=["Pusher"],t=0;t "+e),S.emit("state_change",{previous:r,current:e}),S.emit(e,t))}var S=this;n.EventsDispatcher.call(this),this.options=n.Util.extend({encrypted:!1},l),this.netInfo=new n.NetInfo,this.netInfo.bind("online",function(){S._machine.is("waiting")&&(S._machine.transition("connecting"),E("connecting"))}),this.netInfo.bind("offline",function(){S._machine.is("connected")&&(S.socket.onclose=void 0,S.socket.onmessage=void 0,S.socket.onerror=void 0,S.socket.onopen=void 0,S.socket.close(),S.socket=void 0,S._machine.transition("waiting"))}),this._machine=new n.Machine("initialized",r,{initializedPre:function(){S.compulsorySecure=S.options.encrypted,S.key=t,S.socket=null,S.socket_id=null,S.state="initialized"},waitingPre:function(){S.connectionWait>0&&S.emit("connecting_in",S.connectionWait),S.netInfo.isOnLine()&&S.connectionAttempts<=4?E("connecting"):E("unavailable"),S.netInfo.isOnLine()&&(S._waitingTimer=setTimeout(function(){S._machine.transition("connecting")},d()))},waitingExit:function(){clearTimeout(S._waitingTimer)},connectingPre:function(){if(S.netInfo.isOnLine()===!1)S._machine.transition("waiting"),E("unavailable");else{var e;e=n.ws_port;var t="ws://";if(S.connectionSecure||document.location.protocol==="https:")e=n.wss_port,t="wss://";e=t+n.host+":"+e+"/app/"+S.key+"?protocol=5&client=js&version="+n.VERSION+"&flash="+(n.TransportType==="flash"?"true":"false"),n.debug("Connecting",e),S.socket=new n.Transport(e),S.socket.onopen=v,S.socket.onclose=b,S.socket.onerror=w,S._connectingTimer=setTimeout(h,S.openTimeout)}},connectingExit:function(){clearTimeout(S._connectingTimer),S.socket.onopen=void 0},connectingToWaiting:function(){c()},connectingToImpermanentlyClosing:function(){c()},openPre:function(){S.socket.onmessage=m,S.socket.onerror=w,S.socket.onclose=b,S._openTimer=setTimeout(h,S.connectedTimeout)},openExit:function(){clearTimeout(S._openTimer),S.socket.onmessage=void 0},openToWaiting:function(){c()},openToImpermanentlyClosing:function(){c()},connectedPre:function(t){S.socket_id=t,S.socket.onmessage=g,S.socket.onerror=w,S.socket.onclose=b,e(S),S.connectedAt=(new Date).getTime(),p()},connectedPost:function(){E("connected")},connectedExit:function(){S._activityTimer&&clearTimeout(S._activityTimer),E("disconnected")},impermanentlyClosingPost:function(){S.socket&&(S.socket.onclose=b,S.socket.close())},permanentlyClosingPost:function(){S.socket?(S.socket.onclose=function(){e(S),S._machine.transition("permanentlyClosed")},S.socket.close()):(e(S),S._machine.transition("permanentlyClosed"))},failedPre:function(){E("failed"),n.debug("WebSockets are not available in this browser.")},permanentlyClosedPost:function(){E("disconnected")}})}var n=this.Pusher,r={initialized:["waiting","failed"],waiting:["connecting","permanentlyClosed"],connecting:["open","permanentlyClosing","impermanentlyClosing","waiting"],open:["connected","permanentlyClosing","impermanentlyClosing","waiting"],connected:["permanentlyClosing","waiting"],impermanentlyClosing:["waiting","permanentlyClosing"],permanentlyClosing:["permanentlyClosed"],permanentlyClosed:["waiting","failed"],failed:["permanentlyClosed"]},i=2e3,s=2e3,o=2e3,u=5*i,a=5*s,f=5*o;t.prototype.connect=function(){!this._machine.is("failed")&&!n.Transport?this._machine.transition("failed"):this._machine.is("initialized")?(e(this),this._machine.transition("waiting")):this._machine.is("waiting")&&this.netInfo.isOnLine()===!0?this._machine.transition("connecting"):this._machine.is("permanentlyClosed")&&(e(this),this._machine.transition("waiting"))},t.prototype.send=function(e){if(this._machine.is("connected")){var t=this;return setTimeout(function(){t.socket.send(e)},0),!0}return!1},t.prototype.send_event=function(e,t,r){return e={event:e,data:t},r&&(e.channel=r),n.debug("Event sent",e),this.send(JSON.stringify(e))},t.prototype.disconnect=function(){this._machine.is("permanentlyClosed")||(this._machine.is("waiting")||this._machine.is("failed")?this._machine.transition("permanentlyClosed"):this._machine.transition("permanentlyClosing"))},n.Util.extend(t.prototype,n.EventsDispatcher.prototype),this.Pusher.Connection=t}.call(this),function(){Pusher.Channels=function(){this.channels={}},Pusher.Channels.prototype={add:function(e,t){var n=this.find(e);return n||(n=Pusher.Channel.factory(e,t),this.channels[e]=n),n},find:function(e){return this.channels[e]},remove:function(e){delete this.channels[e]},disconnect:function(){for(var e in this.channels)this.channels[e].disconnect()}},Pusher.Channel=function(e,t){var n=this;Pusher.EventsDispatcher.call(this,function(t){Pusher.debug("No callbacks on "+e+" for "+t)}),this.pusher=t,this.name=e,this.subscribed=!1,this.bind("pusher_internal:subscription_succeeded",function(e){n.onSubscriptionSucceeded(e)})},Pusher.Channel.prototype={init:function(){},disconnect:function(){this.subscribed=!1,this.emit("pusher_internal:disconnected")},onSubscriptionSucceeded:function(){this.subscribed=!0,this.emit("pusher:subscription_succeeded")},authorize:function(e,t,n){return n(!1,{})},trigger:function(e,t){return this.pusher.send_event(e,t,this.name)}},Pusher.Util.extend(Pusher.Channel.prototype,Pusher.EventsDispatcher.prototype),Pusher.Channel.PrivateChannel={authorize:function(e,t,n){var r=this;return(new Pusher.Channel.Authorizer(this,Pusher.channel_auth_transport,t)).authorize(e,function(e,t){e||r.emit("pusher_internal:authorized",t),n(e,t)})}},Pusher.Channel.PresenceChannel= -{init:function(){this.members=new e(this)},onSubscriptionSucceeded:function(){this.subscribed=!0}};var e=function(e){var t=this,n=function(){this._members_map={},this.count=0,this.me=null};n.call(this),e.bind("pusher_internal:authorized",function(n){var r=JSON.parse(n.channel_data);e.bind("pusher_internal:subscription_succeeded",function(n){t._members_map=n.presence.hash,t.count=n.presence.count,t.me=t.get(r.user_id),e.emit("pusher:subscription_succeeded",t)})}),e.bind("pusher_internal:member_added",function(n){t.get(n.user_id)===null&&t.count++,t._members_map[n.user_id]=n.user_info,e.emit("pusher:member_added",t.get(n.user_id))}),e.bind("pusher_internal:member_removed",function(n){var r=t.get(n.user_id);r&&(delete t._members_map[n.user_id],t.count--,e.emit("pusher:member_removed",r))}),e.bind("pusher_internal:disconnected",function(){n.call(t)})};e.prototype={each:function(e){for(var t in this._members_map)e(this.get(t))},get:function(e){return this._members_map.hasOwnProperty(e)?{id:e,info:this._members_map[e]}:null}},Pusher.Channel.factory=function(e,t){var n=new Pusher.Channel(e,t);return e.indexOf("private-")===0?Pusher.Util.extend(n,Pusher.Channel.PrivateChannel):e.indexOf("presence-")===0&&(Pusher.Util.extend(n,Pusher.Channel.PrivateChannel),Pusher.Util.extend(n,Pusher.Channel.PresenceChannel)),n.init(),n}}.call(this),function(){Pusher.Channel.Authorizer=function(e,t,n){this.channel=e,this.type=t,this.authOptions=(n||{}).auth||{}},Pusher.Channel.Authorizer.prototype={composeQuery:function(e){var e="&socket_id="+encodeURIComponent(e)+"&channel_name="+encodeURIComponent(this.channel.name),t;for(t in this.authOptions.params)e+="&"+encodeURIComponent(t)+"="+encodeURIComponent(this.authOptions.params[t]);return e},authorize:function(e,t){return Pusher.authorizers[this.type].call(this,e,t)}},Pusher.auth_callbacks={},Pusher.authorizers={ajax:function(e,t){var n;n=Pusher.XHR?new Pusher.XHR:window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),n.open("POST",Pusher.channel_auth_endpoint,!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var r in this.authOptions.headers)n.setRequestHeader(r,this.authOptions.headers[r]);return n.onreadystatechange=function(){if(n.readyState==4)if(n.status==200){var e,r=!1;try{e=JSON.parse(n.responseText),r=!0}catch(i){t(!0,"JSON returned from webapp was invalid, yet status code was 200. Data was: "+n.responseText)}r&&t(!1,e)}else Pusher.warn("Couldn't get auth info from your webapp",n.status),t(!0,n.status)},n.send(this.composeQuery(e)),n},jsonp:function(e,t){this.authOptions.headers!==void 0&&Pusher.warn("Warn","To send headers with the auth request, you must use AJAX, rather than JSONP.");var n=document.createElement("script");Pusher.auth_callbacks[this.channel.name]=function(e){t(!1,e)},n.src=Pusher.channel_auth_endpoint+"?callback="+encodeURIComponent("Pusher.auth_callbacks['"+this.channel.name+"']")+this.composeQuery(e);var r=document.getElementsByTagName("head")[0]||document.documentElement;r.insertBefore(n,r.firstChild)}}}.call(this);var _require=function(){function e(e,t){document.addEventListener?e.addEventListener("load",t,!1):e.attachEvent("onreadystatechange",function(){(e.readyState=="loaded"||e.readyState=="complete")&&t()})}function t(t,n){var r=document.getElementsByTagName("head")[0],i=document.createElement("script");i.setAttribute("src",t),i.setAttribute("type","text/javascript"),i.setAttribute("async",!0),e(i,function(){n()}),r.appendChild(i)}return function(e,n){for(var r=0,i=0;i0?_require(t,i):i()})(),minispade.register("app","(function() {(function() {\nminispade.require('auth');\nminispade.require('controllers');\nminispade.require('helpers');\nminispade.require('models');\nminispade.require('pusher');\nminispade.require('routes');\nminispade.require('slider');\nminispade.require('store');\nminispade.require('tailing');\nminispade.require('templates');\nminispade.require('views');\nminispade.require('config/locales');\nminispade.require('data/sponsors');\n\n Travis.reopen({\n App: Em.Application.extend({\n autoinit: false,\n currentUserBinding: 'auth.user',\n authStateBinding: 'auth.state',\n init: function() {\n this._super.apply(this, arguments);\n this.store = Travis.Store.create();\n this.store.loadMany(Travis.Sponsor, Travis.SPONSORS);\n this.slider = new Travis.Slider();\n this.pusher = new Travis.Pusher(Travis.config.pusher_key);\n this.tailing = new Travis.Tailing();\n return this.set('auth', Travis.Auth.create({\n app: this,\n endpoint: Travis.config.api_endpoint\n }));\n },\n storeAfterSignInPath: function(path) {\n return this.get('auth').storeAfterSignInPath(path);\n },\n autoSignIn: function(path) {\n return this.get('auth').autoSignIn(path);\n },\n signIn: function() {\n return this.get('auth').signIn();\n },\n signOut: function() {\n this.get('auth').signOut();\n return this.get('router').send('afterSignOut');\n },\n receive: function() {\n return this.store.receive.apply(this.store, arguments);\n },\n toggleSidebar: function() {\n var element;\n $('body').toggleClass('maximized');\n element = $('');\n $('#top .profile').append(element);\n Em.run.later((function() {\n return element.remove();\n }), 10);\n element = $('');\n $('#repo').append(element);\n return Em.run.later((function() {\n return element.remove();\n }), 10);\n }\n })\n });\n\n}).call(this);\n\n})();\n//@ sourceURL=app"),minispade.register("auth",function(){(function(){this.Travis.Auth=Ember.Object.extend({iframe:$('