text: function FastClick(a){"use strict";var b,c=this;this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.layer=a;if(!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){FastClick.prototype.onClick.apply(c,arguments)},this.onTouchStart=function(){FastClick.prototype.onTouchStart.apply(c,arguments)},this.onTouchMove=function(){FastClick.prototype.onTouchMove.apply(c,arguments)},this.onTouchEnd=function(){FastClick.prototype.onTouchEnd.apply(c,arguments)},this.onTouchCancel=function(){FastClick.prototype.onTouchCancel.apply(c,arguments)};if(typeof window.ontouchstart=="undefined")return;a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),typeof a.onclick=="function"&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null)}function defineNetwork(a){var b=function(a,b,c){this.container=a,this.width=b,this.height=c,this.loaderInterval=null,this.loaderOffset=0,this.ctx=this.initCanvas(a,b,c),this.startLoader("Loading graph data"),this.loadMeta()};return b.prototype={initCanvas:function(b,c,d){var e=a(b).find("canvas")[0];e.style.zIndex="0";var f=e.width,g=e.height,h=e.getContext("2d"),i=window.devicePixelRatio||1,j=h.webkitBackingStorePixelRatio||h.mozBackingStorePixelRatio||h.msBackingStorePixelRatio||h.oBackingStorePixelRatio||h.backingStorePixelRatio||1,k=i/j;return k===1?h:(e.width=f*k,e.height=g*k,e.style.width=f+"px",e.style.height=g+"px",h.scale(k,k),h)},startLoader:function(a){this.ctx.save(),this.ctx.font="14px Monaco, monospace",this.ctx.fillStyle="#cacaca",this.ctx.textAlign="center",this.ctx.fillText(a,this.width/2,155),this.ctx.restore();var b=this;this.displayLoader()},stopLoader:function(){a(".large-loading-area").hide()},displayLoader:function(){a(".large-loading-area").show()},waitForCurrent:function(b){var c=this;if(c.current){b({current:!0});return}a(".js-network-poll").each(function(){var d=a(this).attr("rel");a.ajaxPoll({url:"/cache/network_current/"+d,dataType:"json",success:function(a){a&&a.current?(console.log("network is current:",a),c.current=!0,b(a)):(console.log("network is not current, retrying:",a),this.resume())}})})},loadMeta:function(){var b=this;b.loaded=!1;var c=a.ajaxPoll({url:"network_meta",dataType:"json",success:function(d){d&&d.nethash?(b.loaded=!0,b.init(d)):b.waitForCurrent(function(){a(".js-network-poll").hide(),a(".js-network-current").show(),b.loaded||c.resume()})}})},init:function(a){this.focus=a.focus,this.nethash=a.nethash,this.spaceMap=a.spacemap,this.userBlocks=a.blocks,this.commits=[];for(var c=0;c<a.dates.length;c++)this.commits.push(new b.Commit(c,a.dates[c]));this.users={};for(var c=0;c<a.users.length;c++){var d=a.users[c];this.users[d.name]=d}this.chrome=new b.Chrome(this,this.ctx,this.width,this.height,this.focus,this.commits,this.userBlocks,this.users),this.graph=new b.Graph(this,this.ctx,this.width,this.height,this.focus,this.commits,this.users,this.spaceMap,this.userBlocks,this.nethash),this.mouseDriver=new b.MouseDriver(this.container,this.chrome,this.graph),this.keyDriver=new b.KeyDriver(this.container,this.chrome,this.graph),this.stopLoader(),this.graph.drawBackground(),this.chrome.draw(),this.graph.requestInitialChunk()},initError:function(){this.stopLoader(),this.ctx.clearRect(0,0,this.width,this.height),this.startLoader("Graph could not be drawn due to a network IO problem.")}},b.Commit=function(a,b){this.time=a,this.date=moment(b,"YYYY-MM-DD HH:mm:ss"),this.requested=null,this.populated=null},b.Commit.prototype={populate:function(a,b,c){this.user=b,this.author=a.author,this.date=moment(a.date,"YYYY-MM-DD HH:mm:ss"),this.gravatar=a.gravatar,this.id=a.id,this.login=a.login,this.message=a.message,this.space=a.space,this.time=a.time,this.parents=this.populateParents(a.parents,c),this.requested=!0,this.populated=new Date},populateParents:function(a,b){var c=[];for(var d=0;d<a.length;d++){var e=a[d],f=b[e[1]];f.id=e[0],f.space=e[2],c.push(f)}return c}},b.Chrome=function(a,b,c,d,e,f,g,h){this.namesWidth=100,this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.userBgColors=["#EBEBFF","#E0E0FF"],this.network=a,this.ctx=b,this.width=c,this.height=d,this.commits=f,this.userBlocks=g,this.users=h,this.offsetX=this.namesWidth+(c-this.namesWidth)/2-e*20,this.offsetY=0,this.contentHeight=this.calcContentHeight(),this.graphMidpoint=this.namesWidth+(c-this.namesWidth)/2,this.activeUser=null},b.Chrome.prototype={moveX:function(a){this.offsetX+=a,this.offsetX>this.graphMidpoint?this.offsetX=this.graphMidpoint:this.offsetX<this.graphMidpoint-this.commits.length*20&&(this.offsetX=this.graphMidpoint-this.commits.length*20)},moveY:function(a){this.offsetY+=a,this.offsetY>0||this.contentHeight<this.height-40?this.offsetY=0:this.offsetY<-this.contentHeight+this.height/2&&(this.offsetY=-this.contentHeight+this.height/2)},calcContentHeight:function(){var a=0;for(var b=0;b<this.userBlocks.length;b++){var c=this.userBlocks[b];a+=c.count}return a*20},hover:function(a,b){for(var c=0;c<this.userBlocks.length;c++){var d=this.userBlocks[c];if(a>0&&a<this.namesWidth&&b>40+this.offsetY+d.start*20&&b<40+this.offsetY+(d.start+d.count)*20)return this.users[d.name]}return null},draw:function(){this.drawTimeline(this.ctx),this.drawUsers(this.ctx),this.drawFooter(this.ctx)},drawTimeline:function(a){a.fillStyle="#111111",a.fillRect(0,0,this.width,20),a.fillStyle="#333333",a.fillRect(0,20,this.width,20);var b=parseInt((0-this.offsetX)/20);b<0&&(b=0);var c=b+parseInt(this.width/20);c>this.commits.length&&(c=this.commits.length),a.save(),a.translate(this.offsetX,0),a.font="10px Helvetica, sans-serif";var d=null,e=null;for(var f=b;f<c;f++){var g=this.commits[f],h=this.months[g.date.month()];h!=d&&(a.fillStyle="#ffffff",a.fillText(h,f*20-3,14),d=h);var i=parseInt(g.date.date());i!=e&&(a.fillStyle="#ffffff",a.fillText(i,f*20-3,33),e=i)}a.restore()},drawUsers:function(a){a.fillStyle="#FFFFFF",a.fillRect(0,0,this.namesWidth,this.height),a.save(),a.translate(0,40+this.offsetY);for(var b=0;b<this.userBlocks.length;b++){var c=this.userBlocks[b];a.fillStyle=this.userBgColors[b%2],a.fillRect(0,c.start*20,this.namesWidth,c.count*20),this.activeUser&&this.activeUser.name==c.name&&(a.fillStyle="rgba(0, 0, 0, 0.05)",a.fillRect(0,c.start*20,this.namesWidth,c.count*20)),a.fillStyle="#DDDDDD",a.fillRect(0,c.start*20,1,c.count*20),a.fillRect(this.namesWidth-1,c.start*20,1,c.count*20),a.fillRect(this.width-1,c.start*20,1,c.count*20),a.fillRect(0,(c.start+c.count)*20-1,this.namesWidth,1);var d=a.measureText(c.name).width,e=(c.start+c.count/2)*20+3;a.fillStyle="#000000",a.font="12px Monaco, monospace",a.textAlign="center",a.fillText(c.name,this.namesWidth/2,e,96)}a.restore(),a.fillStyle="#111111",a.fillRect(0,0,this.namesWidth,20),a.fillStyle="#333333",a.fillRect(0,20,this.namesWidth,20)},drawFooter:function(a){a.fillStyle="#F4F4F4",a.fillRect(0,this.height-20,this.width,20),a.fillStyle="#CCCCCC",a.fillRect(0,this.height-20,this.width,1),a.fillStyle="#000000",a.font="11px Monaco, monospace",a.fillText("GitHub Network Graph Viewer v4.0.0",5,this.height-5)}},b.Graph=function(a,b,c,d,e,f,g,h,i,j){this.namesWidth=100,this.spaceColors=[],this.bgColors=["#F5F5FF","#F0F0FF"],this.spaceColors.push("#FF0000"),this.spaceColors.push("#0000FF"),this.spaceColors.push("#00FF00"),this.spaceColors.push("#FF00FF"),this.spaceColors.push("#E2EB00"),this.spaceColors.push("#FFA600"),this.spaceColors.push("#00FFFC"),this.spaceColors.push("#DD458E"),this.spaceColors.push("#AD7331"),this.spaceColors.push("#97AD31"),this.spaceColors.push("#51829D"),this.spaceColors.push("#70387F"),this.spaceColors.push("#740000"),this.spaceColors.push("#745C00"),this.spaceColors.push("#419411"),this.spaceColors.push("#37BE8C"),this.spaceColors.push("#6C5BBD"),this.spaceColors.push("#F300AA"),this.spaceColors.push("#586D41"),this.spaceColors.push("#3B4E31"),this.network=a,this.ctx=b,this.width=c,this.height=d,this.focus=e,this.commits=f,this.users=g,this.spaceMap=h,this.userBlocks=i,this.nethash=j,this.offsetX=this.namesWidth+(c-this.namesWidth)/2-e*20,this.offsetY=0,this.bgCycle=0,this.marginMap={},this.gravatars={},this.activeCommit=null,this.contentHeight=this.calcContentHeight(),this.graphMidpoint=this.namesWidth+(c-this.namesWidth)/2,this.showRefs=!0,this.lastHotLoadCenterIndex=null,this.connectionMap={},this.spaceUserMap={};for(var k=0;k<i.length;k++){var l=i[k];for(var m=l.start;m<l.start+l.count;m++)this.spaceUserMap[m]=g[l.name]}this.headsMap={};for(var k=0;k<i.length;k++){var l=i[k],n=g[l.name];for(var m=0;m<n.heads.length;m++){var o=n.heads[m];this.headsMap[o.id]||(this.headsMap[o.id]=[]);var p={name:n.name,head:o};this.headsMap[o.id].push(p)}}},b.Graph.prototype={moveX:function(a){this.offsetX+=a,this.offsetX>this.graphMidpoint?this.offsetX=this.graphMidpoint:this.offsetX<this.graphMidpoint-this.commits.length*20&&(this.offsetX=this.graphMidpoint-this.commits.length*20),this.hotLoadCommits()},moveY:function(a){this.offsetY+=a,this.offsetY>0||this.contentHeight<this.height-40?this.offsetY=0:this.offsetY<-this.contentHeight+this.height/2&&(this.offsetY=-this.contentHeight+this.height/2)},toggleRefs:function(){this.showRefs=!this.showRefs},calcContentHeight:function(){var a=0;for(var b=0;b<this.userBlocks.length;b++){var c=this.userBlocks[b];a+=c.count}return a*20},hover:function(a,b){var c=this.timeWindow();for(var d=c.min;d<=c.max;d++){var e=this.commits[d],f=this.offsetX+e.time*20,g=this.offsetY+50+e.space*20;if(a>f-5&&a<f+5&&b>g-5&&b<g+5)return e}return null},hotLoadCommits:function(){var a=200,b=parseInt((-this.offsetX+this.graphMidpoint)/20);b<0&&(b=0),b>this.commits.length-1&&(b=this.commits.length-1);if(this.lastHotLoadCenterIndex&&Math.abs(this.lastHotLoadCenterIndex-b)<10)return;this.lastHotLoadCenterIndex=b;var c=this.backSpan(b,a),d=this.frontSpan(b,a);if(c||d){var e=c?c[0]:d[0],f=d?d[1]:c[1];this.requestChunk(e,f)}},backSpan:function(a,b){var c=null;for(var d=a;d>=0&&d>a-b;d--)if(!this.commits[d].requested){c=d;break}if(c!=null){var e=null,f=null;for(var d=c;d>=0&&d>c-b;d--)if(this.commits[d].requested){e=d;break}return e?f=e+1:(f=c-b,f<0&&(f=0)),[f,c]}return null},frontSpan:function(a,b){var c=null;for(var d=a;d<this.commits.length&&d<a+b;d++)if(!this.commits[d].requested){c=d;break}if(c!=null){var e=null,f=null;for(var d=c;d<this.commits.length&&d<c+b;d++)if(this.commits[d].requested){e=d;break}return e?f=e-1:c+b>=this.commits.length?f=this.commits.length-1:f=c+b,[c,f]}return null},requestInitialChunk:function(){var b=this;a.getJSON("network_data_chunk?nethash="+this.nethash,function(a){b.importChunk(a),b.draw(),b.network.chrome.draw()})},requestChunk:function(b,c){for(var d=b;d<=c;d++)this.commits[d].requested=new Date;var e=this,f="network_data_chunk?nethash="+this.nethash+"&start="+b+"&end="+c;a.getJSON(f,function(a){e.importChunk(a),e.draw(),e.network.chrome.draw(),e.lastHotLoadCenterIndex=this.focus})},importChunk:function(a){for(var b=0;b<a.commits.length;b++){var c=a.commits[b],d=this.spaceUserMap[c.space],e=this.commits[c.time];e.populate(c,d,this.commits);for(var f=0;f<e.parents.length;f++){var g=e.parents[f];for(var h=g.time+1;h<e.time;h++)this.connectionMap[h]=this.connectionMap[h]||[],this.connectionMap[h].push(e)}}},timeWindow:function(){var a=parseInt((this.namesWidth-this.offsetX+20)/20);a<0&&(a=0);var b=a+parseInt((this.width-this.namesWidth)/20);return b>this.commits.length-1&&(b=this.commits.length-1),{min:a,max:b}},draw:function(){this.drawBackground();var a=this.timeWindow(),b=a.min,c=a.max;this.ctx.save(),this.ctx.translate(this.offsetX,this.offsetY+50);var d={};for(var e=0;e<this.spaceMap.length;e++){var f=this.spaceMap.length-e-1;for(var g=b;g<=c;g++){var h=this.commits[g];h.populated&&h.space==f&&(this.drawConnection(h),d[h.id]=!0)}}for(var e=b;e<=c;e++){var i=this.connectionMap[e];if(i)for(var g=0;g<i.length;g++){var h=i[g];d[h.id]||(this.drawConnection(h),d[h.id]=!0)}}for(var e=0;e<this.spaceMap.length;e++){var f=this.spaceMap.length-e-1;for(var g=b;g<=c;g++){var h=this.commits[g];h.populated&&h.space==f&&(h==this.activeCommit?this.drawActiveCommit(h):this.drawCommit(h))}}if(this.showRefs)for(var g=b;g<=c;g++){var h=this.commits[g];if(h.populated){var j=this.headsMap[h.id];if(j){var k=0;for(var l=0;l<j.length;l++){var m=j[l];if(this.spaceUserMap[h.space].name==m.name){var n=this.drawHead(h,m.head,k);k+=n}}}}}this.ctx.restore(),this.activeCommit&&this.drawCommitInfo(this.activeCommit)},drawBackground:function(){this.ctx.clearRect(0,0,this.width,this.height),this.ctx.save(),this.ctx.translate(0,this.offsetY+50),this.ctx.clearRect(0,-10,this.width,this.height);for(var a=0;a<this.userBlocks.length;a++){var b=this.userBlocks[a];this.ctx.fillStyle=this.bgColors[a%2],this.ctx.fillRect(0,b.start*20-10,this.width,b.count*20),this.ctx.fillStyle="#DDDDDD",this.ctx.fillRect(0,(b.start+b.count)*20-11,this.width,1)}this.ctx.restore()},drawCommit:function(a){var b=a.time*20,c=a.space*20;this.ctx.strokeStyle="#F7F7FF",this.ctx.lineWidth=1.5,this.ctx.fillStyle=this.spaceColor(a.space),this.ctx.beginPath(),this.ctx.arc(b,c,4,0,Math.PI*2,!1),this.ctx.fill(),this.ctx.stroke()},drawActiveCommit:function(a){var b=a.time*20,c=a.space*20;this.ctx.strokeStyle="#F7F7FF",this.ctx.lineWidth=1.5,this.ctx.fillStyle=this.spaceColor(a.space),this.ctx.beginPath(),this.ctx.arc(b,c,6,0,Math.PI*2,!1),this.ctx.fill(),this.ctx.stroke()},drawCommitInfo:function(a){var b=this.splitLines(a.message,54),c=80+15*b.length,d=this.offsetX+a.time*20,e=50+this.offsetY+a.space*20,f=0,g=0;d<this.graphMidpoint?f=d+10:f=d-410,e<40+(this.height-40)/2?g=e+10:g=e-c-10,this.ctx.save(),this.ctx.translate(f,g),this.ctx.fillStyle="#FFFFFF",this.ctx.strokeStyle="#000000",this.ctx.lineWidth="2",this.ctx.beginPath(),this.ctx.moveTo(0,5),this.ctx.quadraticCurveTo(0,0,5,0),this.ctx.lineTo(395,0),this.ctx.quadraticCurveTo(400,0,400,5),this.ctx.lineTo(400,c-5),this.ctx.quadraticCurveTo(400,c,395,c),this.ctx.lineTo(5,c),this.ctx.quadraticCurveTo(0,c,0,c-5),this.ctx.lineTo(0,5),this.ctx.fill(),this.ctx.stroke();var h=this.gravatars[a.gravatar];if(h)this.drawGravatar(h,10,10);else{var i=this,j=window.location.protocol;h=new Image,h.src="https://secure.gravatar.com/avatar/"+a.gravatar+"?s=32&d=https%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-32.png",h.onload=function(){i.activeCommit==a&&(i.drawGravatar(h,f+10,g+10),i.gravatars[a.gravatar]=h)}}this.ctx.fillStyle="#000000",this.ctx.font="bold 14px Helvetica, sans-serif",this.ctx.fillText(a.author,55,32),this.ctx.fillStyle="#888888",this.ctx.font="12px Monaco, monospace",this.ctx.fillText(a.id,12,65),this.drawMessage(b,12,85),this.ctx.restore()},drawGravatar:function(a,b,c){this.ctx.strokeStyle="#AAAAAA",this.ctx.lineWidth=1,this.ctx.beginPath(),this.ctx.strokeRect(b+.5,c+.5,35,35),this.ctx.drawImage(a,b+2,c+2)},drawMessage:function(a,b,c){this.ctx.font="12px Monaco, monospace",this.ctx.fillStyle="#000000";for(var d=0;d<a.length;d++){var e=a[d];this.ctx.fillText(e,b,c+d*15)}},splitLines:function(a,b){var c=a.split(" "),d=[],e="";for(var f=0;f<c.length;f++){var g=c[f];e.length+1+g.length<b?e=e==""?g:e+" "+g:(d.push(e),e=g)}return d.push(e),d},drawHead:function(a,b,c){this.ctx.font="10.25px Monaco, monospace",this.ctx.save();var d=this.ctx.measureText(b.name).width;this.ctx.restore();var e=a.time*20,f=a.space*20+5+c;return this.ctx.save(),this.ctx.translate(e,f),this.ctx.fillStyle="rgba(0, 0, 0, 0.8)",this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(-4,10),this.ctx.quadraticCurveTo(-9,10,-9,15),this.ctx.lineTo(-9,15+d),this.ctx.quadraticCurveTo(-9,15+d+5,-4,15+d+5),this.ctx.lineTo(4,15+d+5),this.ctx.quadraticCurveTo(9,15+d+5,9,15+d),this.ctx.lineTo(9,15),this.ctx.quadraticCurveTo(9,10,4,10),this.ctx.lineTo(0,0),this.ctx.fill(),this.ctx.fillStyle="#FFFFFF",this.ctx.font="12px Monaco, monospace",this.ctx.textBaseline="middle",this.ctx.scale(.85,.85),this.ctx.rotate(Math.PI/2),this.ctx.fillText(b.name,17,-1),this.ctx.restore(),d+20},drawConnection:function(a){for(var b=0;b<a.parents.length;b++){var c=a.parents[b];b==0?c.space==a.space?this.drawBasicConnection(c,a):this.drawBranchConnection(c,a):this.drawMergeConnection(c,a)}},drawBasicConnection:function(a,b){var c=this.spaceColor(b.space);this.ctx.strokeStyle=c,this.ctx.lineWidth=2,this.ctx.beginPath(),this.ctx.moveTo(a.time*20,b.space*20),this.ctx.lineTo(b.time*20,b.space*20),this.ctx.stroke()},drawBranchConnection:function(a,b){var c=this.spaceColor(b.space);this.ctx.strokeStyle=c,this.ctx.lineWidth=2,this.ctx.beginPath(),this.ctx.moveTo(a.time*20,a.space*20),this.ctx.lineTo(a.time*20,b.space*20),this.ctx.lineTo(b.time*20-14,b.space*20),this.ctx.stroke(),this.threeClockArrow(c,b.time*20,b.space*20)},drawMergeConnection:function(a,b){var c=this.spaceColor(a.space);this.ctx.strokeStyle=c,this.ctx.lineWidth=2,this.ctx.beginPath();if(a.space>b.space){this.ctx.moveTo(a.time*20,a.space*20);var d=this.safePath(a.time,b.time,a.space);if(d)this.ctx.lineTo(b.time*20-10,a.space*20),this.ctx.lineTo(b.time*20-10,b.space*20+15),this.ctx.lineTo(b.time*20-7.7,b.space*20+9.5),this.ctx.stroke(),this.oneClockArrow(c,b.time*20,b.space*20);else{var e=this.closestMargin(a.time,b.time,a.space,-1);a.space==b.space+1&&a.space==e+1?(this.ctx.lineTo(a.time*20,e*20+10),this.ctx.lineTo(b.time*20-15,e*20+10),this.ctx.lineTo(b.time*20-9.5,e*20+7.7),this.ctx.stroke(),this.twoClockArrow(c,b.time*20,e*20),this.addMargin(a.time,b.time,e)):a.time+1==b.time?(e=this.closestMargin(a.time,b.time,b.space,0),this.ctx.lineTo(a.time*20,e*20+10),this.ctx.lineTo(b.time*20-15,e*20+10),this.ctx.lineTo(b.time*20-15,b.space*20+10),this.ctx.lineTo(b.time*20-9.5,b.space*20+7.7),this.ctx.stroke(),this.twoClockArrow(c,b.time*20,b.space*20),this.addMargin(a.time,b.time,e)):(this.ctx.lineTo(a.time*20+10,a.space*20-10),this.ctx.lineTo(a.time*20+10,e*20+10),this.ctx.lineTo(b.time*20-10,e*20+10),this.ctx.lineTo(b.time*20-10,b.space*20+15),this.ctx.lineTo(b.time*20-7.7,b.space*20+9.5),this.ctx.stroke(),this.oneClockArrow(c,b.time*20,b.space*20),this.addMargin(a.time,b.time,e))}}else{var e=this.closestMargin(a.time,b.time,b.space,-1);e<b.space?(this.ctx.moveTo(a.time*20,a.space*20),this.ctx.lineTo(a.time*20,e*20+10),this.ctx.lineTo(b.time*20-12.7,e*20+10),this.ctx.lineTo(b.time*20-12.7,b.space*20-10),this.ctx.lineTo(b.time*20-9.4,b.space*20-7.7),this.ctx.stroke(),this.fourClockArrow(c,b.time*20,b.space*20),this.addMargin(a.time,b.time,e)):(this.ctx.moveTo(a.time*20,a.space*20),this.ctx.lineTo(a.time*20,e*20+10),this.ctx.lineTo(b.time*20-12.7,e*20+10),this.ctx.lineTo(b.time*20-12.7,b.space*20+10),this.ctx.lineTo(b.time*20-9.4,b.space*20+7.7),this.ctx.stroke(),this.twoClockArrow(c,b.time*20,b.space*20),this.addMargin(a.time,b.time,e))}},addMargin:function(a,b,c){var d=c;this.marginMap[d]||(this.marginMap[d]=[]),this.marginMap[d].push([a,b])},oneClockArrow:function(a,b,c){this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.moveTo(b-6.3,c+13.1),this.ctx.lineTo(b-10.8,c+9.7),this.ctx.lineTo(b-2.6,c+3.5),this.ctx.fill()},twoClockArrow:function(a,b,c){this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.moveTo(b-12.4,c+6.6),this.ctx.lineTo(b-9.3,c+10.6),this.ctx.lineTo(b-3.2,c+2.4),this.ctx.fill()},threeClockArrow:function(a,b,c){this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.moveTo(b-14,c-2.5),this.ctx.lineTo(b-14,c+2.5),this.ctx.lineTo(b-4,c),this.ctx.fill()},fourClockArrow:function(a,b,c){this.ctx.fillStyle=a,this.ctx.beginPath(),this.ctx.moveTo(b-12.4,c-6.6),this.ctx.lineTo(b-9.3,c-10.6),this.ctx.lineTo(b-3.2,c-2.4),this.ctx.fill()},safePath:function(a,b,c){for(var d=0;d<this.spaceMap[c].length;d++){var e=this.spaceMap[c][d];if(this.timeInPath(a,e))return e[1]==b}return!1},closestMargin:function(a,b,c,d){var e=this.spaceMap.length,f=d,g=!1,h=!1,i=!1;while(!h||!g){if(c+f>=0&&this.safeMargin(a,b,c+f))return c+f;c+f<0&&(g=!0),c+f>e&&(h=!0),i==0&&f==0?(f=-1,i=!0):f<0?f=-f-1:f=-f-2}return c>0?c-1:0},safeMargin:function(a,b,c){var d=c;if(!this.marginMap[d])return!0;var e=this.marginMap[d];for(var f=0;f<e.length;f++){var g=e[f];if(this.pathsCollide([a,b],g))return!1}return!0},pathsCollide:function(a,b){return this.timeWithinPath(a[0],b)||this.timeWithinPath(a[1],b)||this.timeWithinPath(b[0],a)||this.timeWithinPath(b[1],a)},timeInPath:function(a,b){return a>=b[0]&&a<=b[1]},timeWithinPath:function(a,b){return a>b[0]&&a<b[1]},spaceColor:function(a){return a==0?"#000000":this.spaceColors[a%this.spaceColors.length]}},b.MouseDriver=function(b,c,d){this.container=b,this.chrome=c,this.graph=d,this.dragging=!1,this.lastPoint={x:0,y:0},this.lastHoverCommit=null,this.lastHoverUser=null,this.pressedCommit=null,this.pressedUser=null;var e=a(b).eq(0),f=a("canvas",e)[0],g=a(f).offset();f.style.cursor="move";var h=this;this.up=function(a){h.dragging=!1,h.pressedCommit&&h.graph.activeCommit==h.pressedCommit?window.open("/"+h.graph.activeCommit.user.name+"/"+h.graph.activeCommit.user.repo+"/commit/"+h.graph.activeCommit.id):h.pressedUser&&h.chrome.activeUser==h.pressedUser&&(window.location="/"+h.chrome.activeUser.name+"/"+h.chrome.activeUser.repo+"/network"),h.pressedCommit=null,h.pressedUser=null},this.down=function(a){h.graph.activeCommit?h.pressedCommit=h.graph.activeCommit:h.chrome.activeUser?h.pressedUser=h.chrome.activeUser:h.dragging=!0},this.docmove=function(a){var b=a.pageX,c=a.pageY;h.dragging&&(h.graph.moveX(b-h.lastPoint.x),h.graph.moveY(c-h.lastPoint.y),h.graph.draw(),h.chrome.moveX(b-h.lastPoint.x),h.chrome.moveY(c-h.lastPoint.y),h.chrome.draw()),h.lastPoint.x=b,h.lastPoint.y=c},this.move=function(a){var b=a.pageX,c=a.pageY;if(h.dragging)h.graph.moveX(b-h.lastPoint.x),h.graph.moveY(c-h.lastPoint.y),h.graph.draw(),h.chrome.moveX(b-h.lastPoint.x),h.chrome.moveY(c-h.lastPoint.y),h.chrome.draw();else{var d=h.chrome.hover(b-g.left,c-g.top);if(d!=h.lastHoverUser)d?f.style.cursor="pointer":f.style.cursor="move",h.chrome.activeUser=d,h.chrome.draw(),h.lastHoverUser=d;else{var e=h.graph.hover(b-g.left,c-g.top);e!=h.lastHoverCommit&&(e?f.style.cursor="pointer":f.style.cursor="move",h.graph.activeCommit=e,h.graph.draw(),h.chrome.draw(),h.lastHoverCommit=e)}}h.lastPoint.x=b,h.lastPoint.y=c},this.out=function(a){h.graph.activeCommit=null,h.chrome.activeUser=null,h.graph.draw(),h.chrome.draw(),h.lastHoverCommit=null,h.lastHoverUser=null},a("body")[0].onmouseup=this.up,a("body")[0].onmousemove=this.docmove,f.onmousedown=this.down,f.onmousemove=this.move,f.onmouseout=this.out},b.KeyDriver=function(b,c,d){this.container=b,this.chrome=c,this.graph=d,this.dirty=!1,this.moveBothX=function(a){this.graph.moveX(a),this.chrome.moveX(a),this.graph.activeCommit=null,this.dirty=!0},this.moveBothY=function(a){this.graph.moveY(a),this.chrome.moveY(a),this.graph.activeCommit=null,this.dirty=!0},this.toggleRefs=function(){this.graph.toggleRefs(),this.dirty=!0},this.redraw=function(){this.dirty&&(this.graph.draw(),this.chrome.draw()),this.dirty=!1};var e=this;this.down=function(a){var b=!1;if(a.shiftKey)switch(a.which){case 37:case 72:e.moveBothX(999999),b=!0;break;case 38:case 75:e.moveBothY(999999),b=!0;break;case 39:case 76:e.moveBothX(-999999),b=!0;break;case 40:case 74:e.moveBothY(-999999),b=!0}else switch(a.which){case 37:case 72:e.moveBothX(100),b=!0;break;case 38:case 75:e.moveBothY(20),b=!0;break;case 39:case 76:e.moveBothX(-100),b=!0;break;case 40:case 74:e.moveBothY(-20),b=!0;break;case 84:e.toggleRefs(),b=!0}b&&e.redraw()},this.press=function(b){(a.browser.mozilla||a.browser.opera)&&e.down({shiftKey:!1,which:b.keyCode})},a(document).keydown(this.down),a(document).keypress(this.press)},b}(function(){if(navigator.userAgent.match("Propane"))return;top!=window&&(alert("For security reasons, framing is not allowed."),top.location.replace(document.location))}).call(this),function(){if(location.host!=="github.com")return;location.protocol!=="https:"&&(alert("SSL is required to view this page."),location.protocol="https:")}.call(this),function(){var a,b,c;$.fn.simulateClick=function(){var a,b,c;for(b=0,c=this.length;b<c;b++)a=this[b],$.event.simulateClick(a);return this},a=navigator.userAgent.match(/Macintosh/)?"metaKey":"ctrlKey",$.event.simulateClick=function(d,e){var f;return f=c(e),$.extend(f,{currentTarget:null,target:d,srcElement:d,toElement:d,fromElement:null}),$.event.trigger(f,[],d,!f.bubbles),f.isDefaultPrevented()||b(d,f[a]),e&&(e.result=f.result,f.isDefaultPrevented()&&e.preventDefault(),f.isPropagationStopped()&&e.stopPropagation()),f.result},c=function(a){var b,c,d,e;(a!=null?a.originalEvent:void 0)?b=$.event.fix(a.originalEvent):a?b=$.extend(new $.Event,a):b=$.Event("click"),(c=b.type)==null&&(b.type="click"),(d=b.bubbles)==null&&(b.bubbles=!0),(e=b.cancelable)==null&&(b.cancelable=!0);if(b.type!=="click")throw"only 'click' events can be simulated";return b.isSimulated=!0,b.result=null,b},b=function(a,b){var c,d;switch(a.nodeName.toUpperCase()){case"A":b?(window.open(a.href,"_blank"),window.focus()):window.location.href=a.href;break;case"INPUT":case"TEXTAREA":a.focus();break;case"LABEL":c=(d=a.control)!=null?d:a.ownerDocument.getElementById(a.getAttribute("for")),c.focus()}}}.call(this),function(){$(document).on("click",".js-activate-link",function(a){var b,c;b=$(a.target);if(b.is("a"))return;if(!(c=b.find("a:first")[0]))return;return $.event.simulateClick(c,a)})}.call(this),function(){$(document).on("change","form[data-autosubmit]",function(){return $(this).submit()})}.call(this),function(){$.fn.fire=function(a){var b,c,d,e,f,g,h,i;if(b=arguments[1])$.isPlainObject(b)?f=b:$.isArray(b)?c=b:$.isFunction(b)&&(d=b);if(b=arguments[2])$.isArray(b)?c=b:$.isFunction(b)&&(d=b);(b=arguments[3])&&$.isFunction(b)&&(d=b),e=this[0],f==null&&(f={}),(h=f.cancelable)==null&&(f.cancelable=!!d),(i=f.bubbles)==null&&(f.bubbles=!0),c==null&&(c=[]),g=function(){var b;return b=$.Event(a,f),$.event.trigger(b,c,e,!b.bubbles),d&&!b.isDefaultPrevented()&&d.call(e,b),b};if(!f.async)return g();delete f.async,setTimeout(g,0)}}.call(this),function(){var a,b;$.fuzzyScore=function(a,c){var d;return d=b(a,c),d&&!/\//.test(c)&&(d+=b(a.replace(/^.*\//,""),c)),d},$.fuzzySort=function(b,c){var d,e,f,g,h,i;b=function(){var a,d,g;g=[];for(a=0,d=b.length;a<d;a++)f=b[a],(e=$.fuzzyScore(f,c))&&g.push([f,e]);return g}(),b.sort(a),i=[];for(g=0,h=b.length;g<h;g++)d=b[g],i.push(d[0]);return i},a=function(a,b){var c,d,e,f;return d=a[0],f=b[0],c=a[1],e=b[1],c>e?-1:c<e?1:d<f?-1:d>f?1:0},$.fuzzyRegexp=function(a){var b,c,d;return d=a.toLowerCase(),b="+.*?[]{}()^$|\\".replace(/(.)/g,"\\$1"),c=new RegExp("\\((["+b+"])\\)","g"),a=d.replace(/(.)/g,"($1)(.*?)").replace(c,"(\\$1)"),new RegExp("(.*)"+a+"$","i")},$.fuzzyHighlight=function(a,b,c){var d,e,f,g,h,i,j,k;c==null&&(c=null),e=$.trim(a.innerHTML);if(b){c==null&&(c=$.fuzzyRegexp(b));if(!(h=e.match(c)))return;i=!1,e=[];for(f=j=1,k=h.length;1<=k?j<k:j>k;f=1<=k?++j:--j){g=h[f];if(!g)continue;f%2===0?i||(e.push("<mark>"),i=!0):i&&(e.push("</mark>"),i=!1),e.push(""+g)}a.innerHTML=e.join("")}else d=e.replace(/<\/?mark>/g,""),e!==d&&(a.innerHTML=d)},b=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;if(a===b)return 1;n=a.length,o=0,m=0;for(h=p=0,q=b.length;p<q;h=++p){e=b[h],i=a.indexOf(e.toLowerCase()),j=a.indexOf(e.toUpperCase()),l=Math.min(i,j),k=l>-1?l:Math.max(i,j);if(k===-1)return 0;f=.1,a[k]===e&&(f+=.1),k===0&&(f+=.8,h===0&&(m=1)),a.charAt(k-1)===" "&&(f+=.8),a=a.substring(k+1,n),o+=f}return c=b.length,d=o/c,g=(d*(c/n)+d)/2,m&&g+.1<1&&(g+=.1),g}}.call(this),function(){var a,b,c,d;$.fn.fuzzyFilterSortList=function(e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G;f==null&&(f={});if(!(n=this[0]))return;e=e.toLowerCase(),j=(D=f.content)!=null?D:a,s=(E=f.text)!=null?E:c,m=f.limit,f.mark===!0?o=b:((F=f.mark)!=null?F.call:void 0)!=null&&(o=f.mark),(g=$(n).data("fuzzy-sort-items"))?i=$(n).children():(i=g=$(n).children(),$(n).data("fuzzy-sort-items",g.slice(0)));for(v=0,z=i.length;v<z;v++)k=i[v],n.removeChild(k),k.style.display="";q=document.createDocumentFragment(),t=0,u=0;if(!e)for(w=0,A=g.length;w<A;w++){k=g[w];if(!m||t<m)u++,o&&o(j(k)),q.appendChild(k);t++}else{l=g.slice(0);for(x=0,B=l.length;x<B;x++)k=l[x],(G=k.fuzzyFilterTextCache)==null&&(k.fuzzyFilterTextCache=s(j(k))),r=$.fuzzyScore(k.fuzzyFilterTextCache,e),k.fuzzyFilterScoreCache=r;l.sort(d),p=$.fuzzyRegexp(e);for(y=0,C=l.length;y<C;y++)k=l[y],(!m||t<m)&&k.fuzzyFilterScoreCache>0&&(u++,o&&(h=j(k),o(h),o(h,e,p)),q.appendChild(k)),t++}return n.appendChild(q),u},d=function(a,b){var c,d,e,f;return c=a.fuzzyFilterScoreCache,e=b.fuzzyFilterScoreCache,d=a.fuzzyFilterTextCache,f=b.fuzzyFilterTextCache,c>e?-1:c<e?1:d<f?-1:d>f?1:0},a=function(a){return a},c=function(a){return $.trim(a.textContent.toLowerCase())},b=$.fuzzyHighlight}.call(this),function(){var a,b;$.fn.prefixFilterList=function(c,d){var e,f,g,h,i,j,k,l,m,n,o;d==null&&(d={});if(!(h=this[0]))return;c=c.toLowerCase(),j=(n=d.text)!=null?n:b,f=$(h).children(),g=d.limit,d.mark===!0?i=a:((o=d.mark)!=null?o.call:void 0)!=null&&(i=d.mark),k=0;for(l=0,m=f.length;l<m;l++)e=f[l],j(e).indexOf(c)===0?g&&k>=g?e.style.display="none":(k++,e.style.display="",i&&(i(e),i(e,c))):e.style.display="none";return k},b=function(a){return $.trim(a.textContent.toLowerCase())},a=function(a,b){var c,d,e;d=a.innerHTML,b?(e=new RegExp(b,"i"),a.innerHTML=d.replace(e,"<mark>$&</mark>")):(c=d.replace(/<\/?mark>/g,""),d!==c&&(a.innerHTML=c))}}.call(this),function(){var a,b;$.fn.substringFilterList=function(c,d){var e,f,g,h,i,j,k,l,m,n,o;d==null&&(d={});if(!(h=this[0]))return;c=c.toLowerCase(),j=(n=d.text)!=null?n:b,g=d.limit,f=$(h).children(),d.mark===!0?i=a:((o=d.mark)!=null?o.call:void 0)!=null&&(i=d.mark),k=0;for(l=0,m=f.length;l<m;l++)e=f[l],j(e).indexOf(c)!==-1?g&&k>=g?e.style.display="none":(k++,e.style.display="",i&&(i(e),i(e,c))):e.style.display="none";return k},b=function(a){return $.trim(a.textContent.toLowerCase())},a=function(a,b){var c,d,e;d=a.innerHTML,b?(e=new RegExp(b,"i"),a.innerHTML=d.replace(e,"<mark>$&</mark>")):(c=d.replace(/<\/?mark>/g,""),d!==c&&(a.innerHTML=c))}}.call(this),function(){var a,b;a=function(){var a,b,c,d,e,f=this;return c=!1,b=!1,e=null,a=100,d=function(b){e&&clearTimeout(e),e=setTimeout(function(){var a;e=null,a=new $.Event("throttled:input",{target:b}),$.event.trigger(a,null,f,!0)},a)},$(this).on("keydown.throttledInput",function(){c=!0,b=!1,e&&clearTimeout(e)}),$(this).on("keyup.throttledInput",function(a){c=!1,b&&d(a.target),b=!1}),$(this).on("input.throttledInput",function(a){b=!0,c||d(a.target)})},b=function(){return $(this).off("keydown.throttledInput"),$(this).off("keyup.throttledInput"),$(this).off("input.throttledInput")},$.event.special["throttled:input"]={setup:a,teardown:b}}.call(this),function(){var a;a="oninput"in document.createElement("input"),!a&&document.attachEvent!=null&&$(document).on("focus","input, textarea",function(a){var b,c,d;b=a.currentTarget,d=function(){$(b).trigger("input")},c=function(){b.detachEvent("onpropertychange",d),b.detachEvent("onblur",c)},b.attachEvent("onpropertychange",d),b.attachEvent("onblur",c)})}.call(this),function(){var a;$(document).on("focusin",".js-filterable-field",function(){var a;a=$(this).val(),$(this).on("throttled:input.filterable",function(){if(a===$(this).val())return;return a=$(this).val(),$(this).fire("filterable:change",{async:!0})}),$(this).on("blur.filterable",function(){return $(this).off(".filterable")}),$(this).fire("filterable:change",{async:!0})}),$(document).on("filterable:change",".js-filterable-field",function(){var b,c,d,e,f,g;d=$.trim($(this).val().toLowerCase()),g=$("[data-filterable-for="+this.id+"]");for(e=0,f=g.length;e<f;e++)c=g[e],b=$(c),a(b,d),b.fire("filterable:change",{relatedTarget:this})}),a=function(a,b){var c,d,e,f;a.find(".js-filterable-text:first")[0]&&(c=function(a){return $(a).find(".js-filterable-text:first")[0]}),e=a.attr("data-filterable-highlight")!==void 0,d=a.attr("data-filterable-limit"),f=function(){switch(a.attr("data-filterable-type")){case"fuzzy":return a.fuzzyFilterSortList(b,{content:c,mark:e,limit:d});case"substring":return a.substringFilterList(b,{content:c,mark:e,limit:d});default:return a.prefixFilterList(b,{content:c,mark:e,limit:d})}}(),a.toggleClass("filterable-active",b.length>0),a.toggleClass("filterable-empty",f===0)}}.call(this),function(){var a,b,c,d;c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78
  :"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",91:"meta",93:"meta",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a=function(a){var b,e,f;return b=c[a.which],e="",a.ctrlKey&&b!=="ctrl"&&(e+="ctrl+"),a.altKey&&b!=="alt"&&(e+="alt+"),a.metaKey&&!a.ctrlKey&&b!=="meta"&&(e+="meta+"),a.shiftKey?(f=d[a.which])?""+e+f:b==="shift"?""+e+"shift":b?""+e+"shift+"+b:null:b?""+e+b:null},b=function(b){var c;return(c=b.hotkey)==null&&(b.hotkey=a(b)),b.handleObj.handler.apply(this,arguments)},$.event.special.keydown={handle:b},$.event.special.keyup={handle:b}}.call(this),function(){$.pageUpdate=function(a){return $(document).pageUpdate(a)},$.fn.pageUpdate=function(a){return a?(this.on("pageUpdate",function(b){return a.apply(b.target,arguments)}),this):this.trigger("pageUpdate")},$(document).ready(function(){return $(document.body).pageUpdate()}),$(document).on("pjax:complete",function(a){return $(a.target).pageUpdate()})}.call(this),function(){var a,b;a={},$(document).on("keydown",function(b){var c;if($(b.target).is(":input"))return;if(c=a[b.hotkey])$(c).fire("hotkey:activate",{originalEvent:b},function(){$(this).simulateClick()}),b.preventDefault()}),$.pageUpdate(b=function(){var b,c,d,e,f,g,h,i;a={},i=$("[data-hotkey]");for(e=0,g=i.length;e<g;e++){b=i[e],c=$(b).attr("data-hotkey").split(" ");for(f=0,h=c.length;f<h;f++)d=c[f],a[d]=b}})}.call(this),function(){var a,b,c,d;$.fn.performTransition=function(c){var e,f,g,h,i,j,k,l;if(!b){c.apply(this);return}g=this.find(".js-transitionable"),g=g.add(this.filter(".js-transitionable"));for(i=0,k=g.length;i<k;i++)f=g[i],e=$(f),h=a(f),e.one(b,function(){f.style.display=null,f.style.visibility=null;if(h)return d(f,function(){return f.style.height=null})}),f.style.display="block",f.style.visibility="visible",h&&d(f,function(){return f.style.height=""+e.height()+"px"}),f.offsetHeight;c.apply(this);for(j=0,l=g.length;j<l;j++)f=g[j],a(f)&&($(f).height()===0?f.style.height=""+f.scrollHeight+"px":f.style.height="0px");return this},c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"},b=c[Modernizr.prefixed("transition")],a=function(a){var b;return b=Modernizr.prefixed("transitionProperty"),$(a).css(b)==="height"},d=function(a,b){a.style.webkitTransition="none",b(a),a.offsetHeight,a.style.webkitTransition=null}}.call(this),function(){var a,b,c=this,d=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a=function(){function a(){var b=this;this.onClose=function(c){return a.prototype.onClose.apply(b,arguments)},this.onContainerClick=function(c){return a.prototype.onContainerClick.apply(b,arguments)},this.onKeyDown=function(c){return a.prototype.onKeyDown.apply(b,arguments)},this.onClick=function(c){return a.prototype.onClick.apply(b,arguments)},$(document).on("click",".js-menu-container",this.onContainerClick)}return a.prototype.activate=function(a){var b=this;this.activeContainer&&this.deactivate(this.activeContainer),$(a).fire("menu:activate",function(){return $(document).on("keydown.menu",b.onKeyDown),$(document).on("click.menu",b.onClick),$(a).on("click.menu",".js-menu-close",b.onClose),b.activeContainer=a,$(a).performTransition(function(){return $(document.body).addClass("menu-active"),$(a).addClass("active")}),$(a).fire("menu:activated",{async:!0})})},a.prototype.deactivate=function(a){var b=this;$(a).fire("menu:deactivate",function(){return $(document).off("keydown.menu",b.onKeyDown),$(document).off("click.menu",b.onClick),$(a).off("click.menu",".js-menu-close",b.onClose),b.activeContainer=null,$(a).performTransition(function(){return $(document.body).removeClass("menu-active"),$(a).removeClass("active")}),$(a).fire("menu:deactivated",{async:!0})})},a.prototype.onClick=function(a){if(!this.activeContainer)return;$(a.target).closest(this.activeContainer)[0]||(a.preventDefault(),this.deactivate(this.activeContainer))},a.prototype.onKeyDown=function(a){var b;if(!this.activeContainer)return;a.keyCode===27&&((b=this.activeContainer,d.call($(document.activeElement).parents(),b)>=0)&&document.activeElement.blur(),a.preventDefault(),this.deactivate(this.activeContainer))},a.prototype.onContainerClick=function(a){var b,c,d;b=a.currentTarget,(d=$(a.target).closest(".js-menu-target")[0])?(a.preventDefault(),b===this.activeContainer?this.deactivate(b):this.activate(b)):(c=$(a.target).closest(".js-menu-content")[0])||(a.preventDefault(),this.deactivate(b))},a.prototype.onClose=function(a){this.deactivate($(a.target).closest(".js-menu-container")[0]),a.preventDefault()},a}(),b=new a,$.fn.menu=function(a){var c,d,e=this;return c=$(this).closest(".js-menu-container")[0],d={activate:function(){return b.activate(c)},deactivate:function(){return b.deactivate(c)}},typeof d[a]=="function"?d[a]():void 0}}.call(this),function(){var a;$.fn.positionedOffset=function(a){var b,c,d,e,f,g,h,i,j;if(!(c=this[0]))return;if(a!=null?a.jquery:void 0)a=a[0];i=0,e=0,d=c.offsetHeight,j=c.offsetWidth;while(!!c&&c!==a)i+=c.offsetTop||0,e+=c.offsetLeft||0,c=c.offsetParent;return!a||!a.offsetParent?(g=$(document).height(),h=$(document).width()):(g=a.scrollHeight,h=a.scrollWidth),b=g-(i+d),f=h-(e+j),{top:i,left:e,bottom:b,right:f}},a=function(a){var b;return $.isWindow(a)||a.nodeType===9||((b=a.nodeName)!=null?b.match(/body|html/i):void 0)}}.call(this),function(){$.fn.overflowOffset=function(a){var b,c,d,e,f,g,h,i,j;return a==null&&(a=document.body),(c=this[0])?(f=$(c).positionedOffset(a),a.offsetParent?h={top:$(a).scrollTop(),left:$(a).scrollLeft()}:(h={top:$(window).scrollTop(),left:$(window).scrollLeft()},a=document.documentElement),i=f.top-h.top,e=f.left-h.left,d=a.clientHeight,j=a.clientWidth,b=d-(i+c.offsetHeight),g=j-(e+c.offsetWidth),{top:i,left:e,bottom:b,right:g,height:d,width:j}):null}}.call(this),function(){$.fn.overflowParent=function(){var a,b,c;if(!(a=this[0]))return this;while(a!==document.body){c=$(a).css("overflow-y"),b=$(a).css("overflow-x");if(c==="auto"||b==="auto"||c==="scroll"||b==="scroll")break;a=a.parentElement}return $(a)}}.call(this),function(){var a,b=[].slice;$.fn.scrollTo=function(){var c,d,e,f,g,h,i,j;return c=1<=arguments.length?b.call(arguments,0):[],(d=this[0])?(f={},$.isPlainObject(c[0])?(f=c[0],$.isFunction(c[1])&&(h=f.complete)==null&&(f.complete=c[1])):c[0]!=null&&(f.target=c[0]),f.top==null&&f.left==null&&(f.target?(i=$(f.target).positionedOffset(d),g=i.top,e=i.left,f.top=g,f.left=e):(j=$(d).positionedOffset(),g=j.top,e=j.left,f.top=g,f.left=e,d=document)),d.offsetParent?f.duration?a(d,f):(f.top!=null&&(d.scrollTop=f.top),f.left!=null&&(d.scrollLeft=f.left),typeof f.complete=="function"&&f.complete()):f.duration?a("html, body",f):(f.top!=null&&$(document).scrollTop(f.top),f.left!=null&&$(document).scrollLeft(f.left),typeof f.complete=="function"&&f.complete()),this):this},a=function(a,b){var c,d,e;return e={},b.top!=null&&(e.scrollTop=b.top),b.left!=null&&(e.scrollLeft=b.left),d={duration:b.duration,queue:!1},b.complete&&(c=$(a).length,d.complete=function(){if(--c===0)return setTimeout(b.complete,0)}),$(a).animate(e,d)}}.call(this),function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;d=navigator.userAgent.match(/Macintosh/),n=navigator.userAgent.match(/Macintosh/)?"meta":"ctrl",h=!1,o={x:0,y:0},$.pageUpdate(function(){var a,b,c,d,e;e=$(".js-navigation-container");for(c=0,d=e.length;c<d;c++){b=e[c],a=$(b);if(a.data("navigation-installed"))continue;a.attr("data-navigation-disable-mouse")===void 0&&(a.on("mousemove",p),a.on("mouseover",q)),a.data("navigation-installed",!0)}}),p=function(a){if(o.x!==a.clientX||o.y!==a.clientY)h=!1;o={x:a.clientX,y:a.clientY}},q=function(a){if(h)return;$(a.target).trigger("navigation:mouseover")},$(document).on("keydown",function(a){var b,c,d;if(!(b=k()))return;h=!0;if($(a.target).is(":input")&&!$(a.target).is(".js-navigation-enable"))return;return d=$(b).find(".js-navigation-item.navigation-focus")[0]||b,c=$(d).fire("navigation:keydown",{originalEvent:a,hotkey:a.hotkey,relatedTarget:b}),c.result}),$(document).on("navigation:keydown",".js-active-navigation-container .js-navigation-item",function(a){var b,c;c=a.currentTarget,b=a.relatedTarget;if($(a.originalEvent.target).is(":input")){if(d)switch(a.hotkey){case"ctrl+n":return e(c,b);case"ctrl+p":return f(c,b)}switch(a.hotkey){case"up":return f(c,b);case"down":return e(c,b);case"enter":return r(c);case""+n+"+enter":return r(c,!0)}}else{if(d)switch(a.hotkey){case"ctrl+n":return e(c,b);case"ctrl+p":return f(c,b);case"alt+v":return t(c,b);case"ctrl+v":return s(c,b)}switch(a.hotkey){case"j":return e(c,b);case"k":return f(c,b);case"o":return r(c);case"enter":return r(c);case""+n+"+enter":return r(c,!0)}}}),$(document).on("navigation:keydown",".js-active-navigation-container",function(a){var b,c;b=a.currentTarget,c=l(b)[0];if($(a.originalEvent.target).is(":input")){if(d)switch(a.hotkey){case"ctrl+n":return j(c,b)}switch(a.hotkey){case"down":return j(c,b)}}else{if(d)switch(a.hotkey){case"ctrl+n":return j(c,b);case"ctrl+v":return j(c,b)}switch(a.hotkey){case"j":return j(c,b)}}}),$(document).on("navigation:mouseover",".js-active-navigation-container .js-navigation-item",function(a){var b;b=$(a.currentTarget).closest(".js-navigation-container")[0],j(a.currentTarget,b)}),$(document).on("click",".js-active-navigation-container .js-navigation-target",function(a){if(a.altKey||a.ctrlKey||a.metaKey)return;if($(a.target).is("a[href]"))return;return r(a.currentTarget)}),a=function(a){var b,c=this;b=k();if(a!==b)return $(a).fire("navigation:activate",function(){return b&&$(b).removeClass("js-active-navigation-container"),$(a).addClass("js-active-navigation-container"),$(a).fire("navigation:activated",{async:!0})})},g=function(a){var b=this;return $(a).fire("navigation:deactivate",function(){return $(a).removeClass("js-active-navigation-container"),$(a).fire("navigation:deactivated",{async:!0})})},c=[],v=function(b){var d;(d=k())&&c.push(d),a(b)},u=function(d){var e;g(d),b(d),(e=c.pop())&&a(e)},i=function(b,c){var d,e,f;d=l(c)[0],f=$(b).closest(".js-navigation-item")[0]||d,a(c),e=j(f,c);if(e)return;f&&y($(f).overflowParent()[0],f)},b=function(a){$(a).find(".navigation-focus.js-navigation-item").removeClass("navigation-focus")},w=function(a,c){b(c),i(a,c)},r=function(a,b){var c,d;return b==null&&(b=!1),(c=$(a).find(".js-navigation-open")[0])?(d=$.Event("click"),d[""+n+"Key"]=b,$.event.simulateClick(c,d)):$(a).fire("navigation:open",{modifierKey:b},function(){return $(a).fire("navigation:opened",{modifierKey:b,async:!0})}),!1},f=function(a,b){var c,d,e,f;e=l(b),d=$.inArray(a,e);if(f=e[d-1]){c=j(f,b);if(c)return;b=$(f).overflowParent()[0],m(b)==="page"?y(b,f):x(b,f)}return!1},e=function(a,b){var c,d,e,f;e=l(b),d=$.inArray(a,e);if(f=e[d+1]){c=j(f,b);if(c)return;b=$(f).overflowParent()[0],m(b)==="page"?y(b,f):x(b,f)}return!1},t=function(a,b){var c,d,e,f;e=l(b),d=$.inArray(a,e),b=$(a).overflowParent()[0];while((f=e[d-1])&&$(f).overflowOffset(b).top>=0)d--;if(f){c=j(f,b);if(c)return;return y(b,f)}},s=function(a,b){var c,d,e,f;e=l(b),d=$.inArray(a,e),b=$(a).overflowParent()[0];while((f=e[d+1])&&$(f).overflowOffset(b).bottom>=0)d++;if(f){c=j(f,b);if(c)return;y(b,f)}return!1},j=function(a,c){var d;return d=$(a).fire("navigation:focus",function(){return b(c),$(a).addClass("navigation-focus"),$(a).fire("navigation:focused",{async:!0})}),d.isDefaultPrevented()},k=function(){return $(".js-active-navigation-container")[0]},l=function(a){return $(a).find(".js-navigation-item:visible")},m=function(a){var b;return(b=$(a).attr("data-navigation-scroll"))!=null?b:"item"},y=function(a,b){var c,d,e,f;d=$(b).positionedOffset(a),c=$(b).overflowOffset(a);if(c.bottom<=0)return $(a).scrollTo({top:d.top-30,duration:200});if(c.top<=0)return e=a.offsetParent!=null?a.scrollHeight:$(document).height(),f=e-(d.bottom+c.height),$(a).scrollTo({top:f+30,duration:200})},x=function(a,b){var c,d,e,f;d=$(b).positionedOffset(a),c=$(b).overflowOffset(a);if(c.bottom<=0)return e=a.offsetParent!=null?a.scrollHeight:$(document).height(),f=e-(d.bottom+c.height),$(a).scrollTo({top:f});if(c.top<=0)return $(a).scrollTo({top:d.top})},$.fn.navigation=function(c){var d,e,f=this;if(c==="active")return k();if(!(d=$(this).closest(".js-navigation-container")[0]))return;return e={activate:function(){return a(d)},deactivate:function(){return g(d)},push:function(){return v(d)},pop:function(){return u(d)},focus:function(){return i(f,d)},clear:function(){return b(d)},refocus:function(){return w(f,d)}},typeof e[c]=="function"?e[c]():void 0}}.call(this),function(){var a;if(window.getSelection==null)return;a=function(b,c){var d,e,f,g;if(b===c)return!0;g=b.childNodes;for(e=0,f=g.length;e<f;e++){d=g[e];if(a(d,c))return!0}return!1},$(document).on("click",".js-selectable-text",function(){var b,c;c=window.getSelection(),c.rangeCount&&(b=c.getRangeAt(0).commonAncestorContainer,a(this,b)||c.selectAllChildren(this))})}.call(this),function(){var a,b;a=["position:absolute;","overflow:auto;","white-space:pre-wrap;","word-wrap:break-word;","top:0px;","left:-9999px;"],b=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","padding-bottom","padding-left","padding-right","padding-top","text-decoration","text-indent","text-transform","width","word-spacing"],$.fn.textareaMirror=function(c){var d,e,f,g,h,i,j,k,l,m,n;if(!(l=this[0]))return;if(l.nodeName.toLowerCase()!=="textarea")return;j=window.getComputedStyle(l),g=$(l).next()[0],g&&$(g).is("div.js-textarea-mirror")?g.innerHTML="":(g=document.createElement("div"),g.className="js-textarea-mirror"),i=a.slice(0);for(m=0,n=b.length;m<n;m++)h=b[m],i.push(""+h+":"+j[h]+";");g.style.cssText=i.join(" ");if(c!=null){if(k=l.value.substring(0,c))e=document.createTextNode(k);if(k=l.value.substring(c))d=document.createTextNode(k)}else if(k=l.value)e=document.createTextNode(k);return f=document.createElement("span"),f.className="js-marker",f.innerHTML="&nbsp;",e&&g.appendChild(e),g.appendChild(f),d&&g.appendChild(d),g.parentElement||$(l).after(g),g.scrollTop=l.scrollTop,g}}.call(this),function(){$.fn.textareaContentsHeight=function(){var a,b,c;if(!(c=this[0]))return;if(!(b=$(c).textareaMirror()))return;return b.style.height="",a=$(b).height(),setTimeout(function(){return $(b).remove()},5e3),a}}.call(this),function(){var a;a=function(a){var b,c,d,e,f,g;b=$(a);if(b.data("size-to-fit-installed"))return;return g=!1,c=b.height(),d=a.style.height,f=function(e){b.height(e),c=b.height(),d=a.style.height},e=function(){if(!b.is(":visible"))return;f(b.textareaContentsHeight())},b.closest("form").on("reset",function(){return setTimeout(e,100)}),b.on("focus",function(){return setTimeout(e,0)}),b.on("input",function(){var e;if(g)return;if(d!==a.style.height){g=!0;return}e=b.textareaContentsHeight();if(e>c&&b.overflowOffset().bottom<=100)return;f(e)}),e(),b.data("size-to-fit-installed",!0)},$.pageUpdate(function(){var b,c,d,e;e=$(this).find(".js-size-to-fit");for(c=0,d=e.length;c<d;c++)b=e[c],a(b)})}.call(this),function(){var a,b=this,c=[].slice;if(!Modernizr.eventsource)return;if(navigator.userAgent.match(/iPhone/))return;a=function(){function a(b){var c=this;this.base=b,this.flush=function(){return a.prototype.flush.apply(c,arguments)},this.setup=function(){return a.prototype.setup.apply(c,arguments)},this.readyState=this.CONNECTING,this.listeners={},setTimeout(this.setup,0)}return a.prototype.CONNECTING=0,a.prototype.OPEN=1,a.prototype.CLOSED=2,a.prototype.setup=function(){var a,b,c=this;if(b=this.popMessages())a={message:b};$.ajax({type:"POST",url:this.base,data:a,success:function(a,b,d){c.url=d.getResponseHeader("Location");if(!c.url)return c.close();c.readyState=c.OPEN,c.fire("open");if(c.readyState!==c.OPEN)return;return c.flush(),c.start()},error:function(){return c.close()}})},a.prototype.start=function(){var a=this;this.source=new EventSource(this.url),this.source.addEventListener("message",function(b){var c;c=JSON.parse(b.data),a.fire("message",c)}),this.source.addEventListener("reopen",function(b){a.fire("reopen")}),this.source.addEventListener("error",function(b){a.source.readyState===EventSource.CLOSED&&a.close()})},a.prototype.on=function(a,b){var c,d;return(d=(c=this.listeners)[a])==null&&(c[a]=[]),this.listeners[a].push(b),this},a.prototype.fire=function(){var a,b,d,e,f,g;e=arguments[0],a=2<=arguments.length?c.call(arguments,1):[];if(!(d=this.listeners[e]))return;for(f=0,g=d.length;f<g;f++)b=d[f],b.apply(this,a)},a.prototype.close=function(){var a;this.readyState=this.CLOSED,(a=this.source)!=null&&a.close(),this.source=null,this.url=null,this.fire("close")},a.prototype.send=function(a){var b,c;(b=this.outbox)==null&&(this.outbox=[]),this.outbox.push(a),this.fire("send",a),this.readyState===this.OPEN&&(c=this.flushTimeout)==null&&(this.flushTimeout=setTimeout(this.flush,0))},a.prototype.flush=function(){var a,b=this;if(!this.url)return;this.flushTimeout=null,(a=this.popMessages())&&$.ajax({type:"POST",url:""+this.url+"/message",data:{message:a},error:function(){return b.close()}})},a.prototype.popMessages=function(){var a;if(!this.outbox)return;return a=this.outbox,this.outbox=null,a},a}(),$.fn.socket=function(){var b,c;if(!(b=this[0]))return;if(!$(b).is("link[rel=xhr-socket]"))return;return c=$(b).data("socket"),c&&c.readyState!==a.CLOSED?c:(c=new a(b.href),c.on("open",function(){return $(b).trigger("socket:open",[this])}),c.on("close",function(){return $(b).trigger("socket:close",[this])}),c.on("close",function(){return $(b).trigger("socket:reopen",[this])}),c.on("send",function(a){return $(b).trigger("socket:send",[a,this])}),c.on("message",function(a){return $(b).trigger("socket:message",[a,this])}),$(b).data("socket",c),c)}}.call(this),function(){var a,b,c,d;if(!$.fn.socket)return;d={},a={},c=function(b,c){var e,f,g,h,i,j,k;g=$(b).socket();if(!(f=$(c).attr("data-channel")))return;j=f.split(" ");for(h=0,i=j.length;h<i;h++)e=j[h],d[e]||(g.send({subscribe:e}),d[e]=!0),(k=a[e])==null&&(a[e]=[]),a[e].push(c)},$(document).on("socket:reopen","link[rel=xhr-socket]",function(a,b){var c,e;for(c in d)e=d[c],b.send({subscribe:c})}),$(document).on("socket:message","link[rel=xhr-socket]",function(b,c){var d,e;e=c[0],d=c[1];if(!e||!d)return;$(a[e]).trigger("socket:message",[d,e])}),b=null,$.pageUpdate(function(){var d,e,f,g;if(!(b!=null?b:b=$(document.head).find("link[rel=xhr-socket]")[0]))return;a={},g=$(".js-socket-channel");for(e=0,f=g.length;e<f;e++)d=g[e],c(b,d)})}.call(this),function(){$.fn.onFocusedInput=function(a,b){return this.on("focusin",a,function(a){var c,d;d="focusInput"+Math.floor(Math.random()*1e3),(c=b.call(this,a,d))&&$(this).on("input."+d,c),$(this).on("blur."+d,function(){$(this).off("."+d)})}),this}}.call(this),function(){$.fn.onFocusedKeydown=function(a,b){return this.on("focusin",a,function(a){var c,d;d="focusKeydown"+Math.floor(Math.random()*1e3),(c=b.call(this,a,d))&&$(this).on("keydown."+d,c),$(this).on("blur."+d,function(){$(this).off("."+d)})}),this}}.call(this),function(){$.fn.preservingScrollPosition=function(a){var b,c,d,e;return b=this.overflowParent(),b[0].offsetParent==null&&(b=$(window)),d=this.positionedOffset(b),e=b.scrollTop()-d.top,c=b.scrollLeft()-d.left,a.call(this),d=this.positionedOffset(b),b.scrollTo({top:e+d.top,left:c+d.left}),this}}.call(this),function(){$.fn.textareaSelectionPosition=function(){var a,b,c;if(!(c=this[0]))return;if(c.selectionEnd==null)return;if(!(a=$(c).textareaMirror(c.selectionEnd)))return;return b=$(a).find(".js-marker").position(),setTimeout(function(){return $(a).remove()},5e3),b}}.call(this),function(){$.fn.touch=function(a){var b,c,d,e,f;if(a)for(c=0,e=this.length;c<e;c++)b=this[c],b.offsetHeight;else for(d=0,f=this.length;d<f;d++)b=this[d],b.className=b.className;return this}}.call(this),function(){$(document).on("focusin.delay",function(a){var b;b=a.target,$.data(b,"focus-delay-active")||$(b).fire("focusin:delay",function(){$.data(b,"focus-delay-active",!0),$(b).trigger("focusin:delayed")})}),$(document).on("focusout.delay",function(a){return setTimeout(function(){var b;b=a.target,b!==document.activeElement&&$(b).fire("focusout:delay",function(){$.removeData(a.target,"focus-delay-active"),$(b).trigger("focusout:delayed")})},200)})}.call(this),function(){$.pageChange=function(a){return $(document).pageChange(a)},$.fn.pageChange=function(a){return a?(this.on("pageChange",function(b){return a.apply(b.target,arguments)}),this):this.trigger("pageChange")},$(document).ready(function(){return $(document.body).pageChange()}),$(document).on("pjax:end",function(a){return $(a.target).pageChange()})}.call(this),function(){var a,b;a=function(a){var b,c,d;b=$(a),b.data("previousValue",b.val()),c=function(){var a,c;c=b.val(),a=b.data("previousValue"),a!==c&&(b.data("previousValue",c),b.trigger("textchange",[c,a]))},d=function(){b.off(".textchange")},b.on("input.textchange",c),b.on("change.textchange",c),b.on("blur.textchange",d)},$(document).on("focusin","input, textarea",function(b){a(b.currentTarget)}),b=function(a,b){var c,d;c=$(a),d=c.val(),d!==b&&(c.data("previousValue",b),setTimeout(function(){return c.trigger("textchange",[b,d])},0))},$.valHooks.input={set:b},$.valHooks.textarea={set:b}}.call(this),function(){var a,b=this;$.ajaxPoll=function(b){return new a(b)},$.ajaxPoll.version="1",a=function(){function a(b){var c=this;this.onAjaxStop=function(){return a.prototype.onAjaxStop.apply(c,arguments)},this.onAjaxStart=function(){return a.prototype.onAjaxStart.apply(c,arguments)},this.onComplete=function(){return a.prototype.onComplete.apply(c,arguments)},this.onError=function(){return a.prototype.onError.apply(c,arguments)},this.onSuccess=function(b,d,e){return a.prototype.onSuccess.apply(c,arguments)},this.onBeforeSend=function(b){return a.prototype.onBeforeSend.apply(c,arguments)},this.poll=function(){return a.prototype.poll.apply(c,arguments)},this.pause=function(){return a.prototype.pause.apply(c,arguments)},this.resume=function(b){return b==null&&(b=!1),a.prototype.resume.apply(c,arguments)},this.stop=function(){return a.prototype.stop.apply(c,arguments)},this.start=function(){return a.prototype.start.apply(c,arguments)},this.original=$.extend({},$.ajaxSettings,b),this.options=$.extend({},b,{beforeSend:this.onBeforeSend,success:this.onSuccess,error:this.onError,complete:this.onComplete,cache:!1,poller:this}),b.interval!=null&&(this.interval=b.interval,delete b.interval),b.decay!=null&&(this.decay=b.decay,delete b.decay),b.timeout!=null&&(this.timeout=b.timeout,delete b.timeout),this.interval=this.interval*1e3,this.timeout=this.timeout*1e3,this.start()}return a.prototype.interval=1,a.prototype.timeout=600,a.prototype.decay=1.1,a.prototype.start=function(){$(document).on("ajaxStart",this.onAjaxStart),$(document).on("ajaxStop",this.onAjaxStop),this.started=new Date,this.count=0,this.resume(!0)},a.prototype.stop=function(){$(document).off("ajaxStart",this.onAjaxStart),$(document).off("ajaxStop",this.onAjaxStop),this.pause(),this.started=null},a.prototype.resume=function(a){var b;a==null&&(a=!1);if(!this.started)return;this.paused=!1;if(this.timer)return;if(((b=this.xhr)!=null?b.readyState:void 0)<4)return;return a?this.poll():this.timer=setTimeout(this.poll,this.interval)},a.prototype.pause=function(){var a;if(!this.started||this.paused)return;this.paused=!0,this.timer&&clearTimeout(this.timer),((a=this.xhr)!=null?a.readyState:void 0)<4&&this.xhr.abort(),this.timer=this.xhr=null},a.prototype.poll=function(){var a;if(!this.started||this.paused)return;a=new Date-this.started;if(a>this.timeout){this.stop();return}if(this.ajaxStart){this.timer=setTimeout(this.poll,this.interval);return}return this.timer=null,this.count++,this.xhr=$.ajax(this.options)},a.prototype.onBeforeSend=function(a){a.setRequestHeader("X-Poller-Version",$.ajaxPoll.version);if(this.original.beforeSend)return this.original.beforeSend.apply(this,arguments)},a.prototype.onSuccess=function(a,b,c){c.status===202?(this.interval=this.interval*this.decay,this.resume()):this.pause();if(this.original.success)return this.original.success.apply(this,arguments)},a.prototype.onError=function(){this.pause();if(this.original.error)return this.original.error.apply(this,arguments)},a.prototype.onComplete=function(){return this.original.complete&&this.original.complete.apply(this,arguments),this.paused&&this.stop(),this.xhr=null},a.prototype.onAjaxStart=function(){this.ajaxStart=!0},a.prototype.onAjaxStop=function(){this.ajaxStart=!1},a}()}.call(this),function(){var a;a=function(a){var b;b=$(a);if(b.data("deferred-content-loading"))return;$.ajaxPoll({url:b.attr("data-url"),success:function(a,c,d){var e;if(d.status===202)return;return e=$($.parseHTML(a)),b.replaceWith(e),e.pageUpdate(),e.trigger("deferredContent:loaded")},error:function(){return b.addClass("error")}}),b.data("deferred-content-loading",!0)},$.pageUpdate(function(){var b,c,d,e;e=$(this).find(".js-deferred-content");for(c=0,d=e.length;c<d;c++)b=e[c],a(b)})}.call(this),function(){var a,b;b=function(a){var b,c,d,e,f,g;a==null&&(a=document),g=$(a).find(".js-relative-date");for(e=0,f=g.length;e<f;e++){c=g[e];if(b=moment($(c).attr("datetime"),"YYYY-MM-DDTHH:mm:ssZ"))d=b.fromNow(),d==="a few seconds ago"&&(d="just now"),c.textContent=d}},$.pageUpdate(a=function(){return b(this)}),setInterval(b,6e4)}.call(this),function(){$.escapeHTML=function(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/\//g,"&#x2F;")}}.call(this),function(){var a;$.pageUpdate(a=function(){var a,b,c,d,e,f,g,h,i,j;j=$(this).find(".js-obfuscate-email");for(h=0,i=j.length;h<i;h++){c=j[h],a=$(c);if(a.data("obfuscate-email-setup"))continue;if(g=a.attr("data-email")){d=decodeURIComponent(g),f=a.text().replace(/{email}/,d),a.html(f);if(e=a.attr("href"))b=$.escapeHTML($("<div>").html(d).text()),a.attr("href",e.replace(/{email}/,b));a.data("obfuscate-email-setup",!0)}}})}.call(this),function(){$.capitalize=function(a){return a.replace(/\w+/g,function(a){return""+a[0].toUpperCase()+a.slice(1).toLowerCase()})}}.call(this),function(){$.commafy=function(a){return(""+a).replace(/(^|[^\w.])(\d{4,})/g,function(a,b,c){return b+c.replace(/\d(?=(?:\d\d\d)+(?!\d))/g,"$&,")})}}.call(this),function(){$.pluralize=function(a,b){return b+(a>1||a===0?"s":"")}}.call(this),function(){var a;if(Modernizr.csspositionsticky)return;a=function(a){var b,c,d,e,f;b=$(a);if(b.data("sticky-installed"))return;f=b.offset().top;if(!(c=a.offsetParent))return;return e=$(c).offset().top,d=$(c).height(),document.addEventListener("scroll",function(){var a,c;c=window.scrollY,a=e+d-b.height(),a>f&&c>f?(b.addClass("stick"),a<c?b.addClass("stick-bottom"):b.removeClass("stick-bottom")):b.removeClass("stick stick-bottom")}),b.data("sticky-installed",!0)},$.pageUpdate(function(){var b,c,d,e;e=$(".sticky");for(c=0,d=e.length;c<d;c++)b=e[c],a(b)})}.call(this),function(){$(document).on("click:prepare",".minibutton.disabled",function(a){a.preventDefault(),a.stopPropagation()})}.call(this),window.GitHub||(window.GitHub={}),window.GitHub.debug=!1,FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"label":case"video":return!0;default:return/\bneedsclick\b/.test(a.className)}},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":case"select":return!0;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!0;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.maybeSendClick=function(a,b){"use strict";var c,d;return this.needsClick(a)?!1:(document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent("click",!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c),!0)},FastClick.prototype.onTouchStart=function(a){"use strict";var b=a.targetTouches[0];return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=a.target,this.touchStartX=b.pageX,this.touchStartY=b.pageY,a.timeStamp-this.lastClickTime<200&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.targetTouches[0];return Math.abs(b.pageX-this.touchStartX)>10||Math.abs(b.pageY-this.touchStartY)>10?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";if(!this.trackingClick)return!0;if(this.targetElement!==a.target||this.touchHasMoved(a))this.trackingClick=!1,this.targetElement=null;return!0},FastClick.prototype.findControl=function(a){return"use strict",a.control!==undefined?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0;if(d.nodeName.toLowerCase()==="label"){b=this.findControl(d);if(b)return d.focus(),this.deviceIsAndroid?!1:(this.maybeSendClick(b,a)&&a.preventDefault(),!1)}else if(this.needsFocus(d))return a.timeStamp-c>100?(this.targetElement=null,!0):(d.focus(),d.tagName.toLowerCase()!=="select"&&a.preventDefault(),!1);return this.maybeSendClick(d,a)?(a.preventDefault(),!1):!1},FastClick.prototype.onTouchCancel=function(){"use strict",this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onClick=function(a){"use strict";var b;return a.forwardedTouchEvent?!0:this.targetElement?(b=this.targetElement,this.targetElement=null,a.cancelable?a.target.type==="submit"&&a.detail===0?!0:!this.needsClick(b)||this.cancelNextClick?(this.cancelNextClick=!1,a.stopImmediatePropagation&&a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault(),!1):!0:!0):!0},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},typeof define=="function"&&define.amd&&define(function(){return"use strict",FastClick}),typeof module!="undefined"&&module.exports&&(module.exports=function(a){return"use strict",new FastClick(a)},module.exports.FastClick=FastClick),function(a){a.fn.autocompleteField=function(b){var c=a.extend({searchVar:"q",url:null,delay:250,useCache:!1,extraParams:{},autoClearResults:!0,dataType:"html",minLength:1},b);return a(this).each(function(){function h(e){d&&d.readyState<4&&d.abort();if(c.useCache&&g.hasOwnProperty(e))b.trigger("autocomplete:finish",g[e]);else{var f={};f[c.searchVar]=e,f=a.extend(!0,c.extraParams,f),b.trigger("autocomplete:beforesend"),d=a.get(c.url,f,function(a){c.useCache&&(g[e]=a),b.val()===e&&b.trigger("autocomplete:finish",a)},c.dataType)}}function i(a){a.length>=c.minLength?f!=a&&(h(a),f=a):b.trigger("autocomplete:clear")}var b=a(this),d,e,f,g={};c.url!=null&&(b.attr("autocomplete","off"),b.keyup(function(a){a.preventDefault(),clearTimeout(e),e=setTimeout(function(){clearTimeout(e),i(b.val())},c.delay)}),b.blur(function(){f=null}))})}}(jQuery),function(a){a.fn.autosaveField=function(b){var c=a.extend({},a.fn.autosaveField.defaults,b);return this.each(function(){var b=a(this);if(b.data("autosaved-init"))return;var d=b.attr("data-field-type")||":text",e=b.find(d),f=b.attr("data-action"),g=b.attr("data-name"),h=e.val(),i=function(){b.removeClass("errored"),b.removeClass("successful"),b.addClass("loading"),a.ajax({url:f,type:"POST",data:{_method:c.method,field:g,value:e.val()},success:function(){b.addClass("successful"),h=e.val()},error:function(a,c){b.attr("data-reset-on-error")&&e.val(h),a.status==422&&b.find(".error").text
  (a.responseText),b.addClass("errored")},complete:function(){b.removeClass("loading")}})};d==":text"?(e.blur(function(){a(this).val()!=h&&i()}),e.keyup(function(){b.removeClass("successful"),b.removeClass("errored")})):d=="input[type=checkbox]"&&e.change(function(){b.removeClass("successful"),b.removeClass("errored"),i()}),b.data("autosaved-init",!0)})},a.fn.autosaveField.defaults={method:"put"}}(jQuery),function(a){a.fn.caret=function(a){return typeof a=="undefined"?this[0].selectionStart:(this[0].focus(),this[0].setSelectionRange(a,a))},a.fn.caretSelection=function(a,b){return typeof a=="undefined"&&typeof b=="undefined"?[this[0].selectionStart,this[0].selectionEnd]:(this[0].focus(),this[0].setSelectionRange(a,b))}}(jQuery),jQuery.cookie=function(a,b,c){if(typeof b=="undefined"){var i=null;if(document.cookie&&document.cookie!=""){var j=document.cookie.split(";");for(var k=0;k<j.length;k++){var l=jQuery.trim(j[k]);if(l.substring(0,a.length+1)==a+"="){i=decodeURIComponent(l.substring(a.length+1));break}}}return i}c=c||{},b===null&&(b="",c.expires=-1);var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){var e;typeof c.expires=="number"?(e=new Date,e.setTime(e.getTime()+c.expires*24*60*60*1e3)):e=c.expires,d="; expires="+e.toUTCString()}var f=c.path?"; path="+c.path:"",g=c.domain?"; domain="+c.domain:"",h=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,f,g,h].join("")},DateInput=function(a){function b(c,d){typeof d!="object"&&(d={}),a.extend(this,b.DEFAULT_OPTS,d),this.input=a(c),this.bindMethodsToObj("show","hide","hideIfClickOutside","keydownHandler","selectDate"),this.build(),this.selectDate(),this.hide(),this.input.data("datePicker",this)}return b.DEFAULT_OPTS={month_names:["January","February","March","April","May","June","July","August","September","October","November","December"],short_month_names:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],short_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],start_of_week:1},b.prototype={build:function(){var b=a('<p class="month_nav"><span class="button prev" title="[Page-Up]">&#171;</span> <span class="month_name"></span> <span class="button next" title="[Page-Down]">&#187;</span></p>');this.monthNameSpan=a(".month_name",b),a(".prev",b).click(this.bindToObj(function(){this.moveMonthBy(-1)})),a(".next",b).click(this.bindToObj(function(){this.moveMonthBy(1)}));var c=a('<p class="year_nav"><span class="button prev" title="[Ctrl+Page-Up]">&#171;</span> <span class="year_name"></span> <span class="button next" title="[Ctrl+Page-Down]">&#187;</span></p>');this.yearNameSpan=a(".year_name",c),a(".prev",c).click(this.bindToObj(function(){this.moveMonthBy(-12)})),a(".next",c).click(this.bindToObj(function(){this.moveMonthBy(12)}));var d=a('<div class="nav"></div>').append(b,c),e="<table><thead><tr>";a(this.adjustDays(this.short_day_names)).each(function(){e+="<th>"+this+"</th>"}),e+="</tr></thead><tbody></tbody></table>",this.dateSelector=this.rootLayers=a('<div class="date_selector"></div>').append(d,e).insertAfter(this.input),this.tbody=a("tbody",this.dateSelector),this.input.change(this.bindToObj(function(){this.selectDate()})),this.selectDate()},selectMonth:function(b){var c=new Date(b.getFullYear(),b.getMonth(),1);if(!this.currentMonth||this.currentMonth.getFullYear()!=c.getFullYear()||this.currentMonth.getMonth()!=c.getMonth()){this.currentMonth=c;var d=this.rangeStart(b),e=this.rangeEnd(b),f=this.daysBetween(d,e),g="";for(var h=0;h<=f;h++){var i=new Date(d.getFullYear(),d.getMonth(),d.getDate()+h,12,0);this.isFirstDayOfWeek(i)&&(g+="<tr>"),i.getMonth()==b.getMonth()?g+='<td class="selectable_day" date="'+this.dateToString(i)+'">'+i.getDate()+"</td>":g+='<td class="unselected_month" date="'+this.dateToString(i)+'">'+i.getDate()+"</td>",this.isLastDayOfWeek(i)&&(g+="</tr>")}this.tbody.empty().append(g),this.monthNameSpan.empty().append(this.monthName(b)),this.yearNameSpan.empty().append(this.currentMonth.getFullYear()),a(".selectable_day",this.tbody).click(this.bindToObj(function(b){this.changeInput(a(b.target).attr("date"))})),a("td[date='"+this.dateToString(new Date)+"']",this.tbody).addClass("today"),a("td.selectable_day",this.tbody).mouseover(function(){a(this).addClass("hover")}),a("td.selectable_day",this.tbody).mouseout(function(){a(this).removeClass("hover")})}a(".selected",this.tbody).removeClass("selected"),a('td[date="'+this.selectedDateString+'"]',this.tbody).addClass("selected")},selectDate:function(a){typeof a=="undefined"&&(a=this.stringToDate(this.input.val())),a||(a=new Date),this.selectedDate=a,this.selectedDateString=this.dateToString(this.selectedDate),this.selectMonth(this.selectedDate)},changeInput:function(a){this.input.val(a).change(),this.hide()},show:function(){this.rootLayers.css("display","block"),a([window,document.body]).click(this.hideIfClickOutside),this.input.unbind("focus",this.show),this.rootLayers.keydown(this.keydownHandler),this.setPosition()},hide:function(){this.rootLayers.css("display","none"),a([window,document.body]).unbind("click",this.hideIfClickOutside),this.input.focus(this.show),this.rootLayers.unbind("keydown",this.keydownHandler)},hideIfClickOutside:function(a){a.target!=this.input[0]&&!this.insideSelector(a)&&this.hide()},insideSelector:function(b){$target=a(b.target);return $target.parents(".date_selector").length||$target.is(".date_selector");var c},keydownHandler:function(a){switch(a.keyCode){case 9:case 27:this.hide();return;case 13:this.changeInput(this.selectedDateString);break;case 33:this.moveDateMonthBy(a.ctrlKey?-12:-1);break;case 34:this.moveDateMonthBy(a.ctrlKey?12:1);break;case 38:this.moveDateBy(-7);break;case 40:this.moveDateBy(7);break;case 37:this.moveDateBy(-1);break;case 39:this.moveDateBy(1);break;default:return}a.preventDefault()},stringToDate:function(a){var b;return(b=a.match(/^(\d{1,2}) ([^\s]+) (\d{4,4})$/))?new Date(b[3],this.shortMonthNum(b[2]),b[1],12,0):null},dateToString:function(a){return a.getDate()+" "+this.short_month_names[a.getMonth()]+" "+a.getFullYear()},setPosition:function(){var a=this.input.offset();this.rootLayers.css({top:a.top+this.input.outerHeight(),left:a.left}),this.ieframe&&this.ieframe.css({width:this.dateSelector.outerWidth(),height:this.dateSelector.outerHeight()})},moveDateBy:function(a){var b=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth(),this.selectedDate.getDate()+a);this.selectDate(b)},moveDateMonthBy:function(a){var b=new Date(this.selectedDate.getFullYear(),this.selectedDate.getMonth()+a,this.selectedDate.getDate());b.getMonth()==this.selectedDate.getMonth()+a+1&&b.setDate(0),this.selectDate(b)},moveMonthBy:function(a){var b=new Date(this.currentMonth.getFullYear(),this.currentMonth.getMonth()+a,this.currentMonth.getDate());this.selectMonth(b)},monthName:function(a){return this.month_names[a.getMonth()]},bindToObj:function(a){var b=this;return function(){return a.apply(b,arguments)}},bindMethodsToObj:function(){for(var a=0;a<arguments.length;a++)this[arguments[a]]=this.bindToObj(this[arguments[a]])},indexFor:function(a,b){for(var c=0;c<a.length;c++)if(b==a[c])return c},monthNum:function(a){return this.indexFor(this.month_names,a)},shortMonthNum:function(a){return this.indexFor(this.short_month_names,a)},shortDayNum:function(a){return this.indexFor(this.short_day_names,a)},daysBetween:function(a,b){return a=Date.UTC(a.getFullYear(),a.getMonth(),a.getDate()),b=Date.UTC(b.getFullYear(),b.getMonth(),b.getDate()),(b-a)/864e5},changeDayTo:function(a,b,c){var d=c*(Math.abs(b.getDay()-a-c*7)%7);return new Date(b.getFullYear(),b.getMonth(),b.getDate()+d)},rangeStart:function(a){return this.changeDayTo(this.start_of_week,new Date(a.getFullYear(),a.getMonth()),-1)},rangeEnd:function(a){return this.changeDayTo((this.start_of_week-1)%7,new Date(a.getFullYear(),a.getMonth()+1,0),1)},isFirstDayOfWeek:function(a){return a.getDay()==this.start_of_week},isLastDayOfWeek:function(a){return a.getDay()==(this.start_of_week-1)%7},adjustDays:function(a){var b=[];for(var c=0;c<a.length;c++)b[c]=a[(c+this.start_of_week)%7];return b}},a.fn.date_input=function(a){return this.each(function(){new b(this,a)})},a.date_input={initialize:function(b){a("input.date_input").date_input(b)}},b}(jQuery),function(a){function b(b){if(a.facebox.settings.inited)return!0;a.facebox.settings.inited=!0,a(document).trigger("init.facebox"),e();var c=a.facebox.settings.imageTypes.join("|");a.facebox.settings.imageTypesRegexp=new RegExp(".("+c+")$","i"),b&&a.extend(a.facebox.settings,b),a("body").append(a.facebox.settings.faceboxHtml);var d=[new Image,new Image];d[0].src=a.facebox.settings.closeImage,d[1].src=a.facebox.settings.loadingImage,a("#facebox").find(".b:first, .bl").each(function(){d.push(new Image),d.slice(-1).src=a(this).css("background-image").replace(/url\((.+)\)/,"$1")}),a("#facebox .close").click(a.facebox.close).append(a.facebox.settings.closeHTML||'<img src="'+a.facebox.settings.closeImage+'" class="close_image" title="close">')}function c(){var a,b;return self.pageYOffset?(b=self.pageYOffset,a=self.pageXOffset):document.documentElement&&document.documentElement.scrollTop?(b=document.documentElement.scrollTop,a=document.documentElement.scrollLeft):document.body&&(b=document.body.scrollTop,a=document.body.scrollLeft),new Array(a,b)}function d(){var a;return self.innerHeight?a=self.innerHeight:document.documentElement&&document.documentElement.clientHeight?a=document.documentElement.clientHeight:document.body&&(a=document.body.clientHeight),a}function e(){var b=a.facebox.settings;b.loadingImage=b.loading_image||b.loadingImage,b.closeImage=b.close_image||b.closeImage,b.imageTypes=b.image_types||b.imageTypes,b.faceboxHtml=b.facebox_html||b.faceboxHtml}function f(b,c){if(b.match(/#/)){var d=window.location.href.split("#")[0],e=b.replace(d,"");if(e=="#")return;a.facebox.reveal(a(e).html(),c)}else b.match(a.facebox.settings.imageTypesRegexp)?g(b,c):h(b,c)}function g(b,c){var d=new Image;d.onload=function(){a.facebox.reveal('<div class="image"><img src="'+d.src+'" /></div>',c)},d.src=b}function h(b,c){a.get(b,function(b){a.facebox.reveal(b,c)})}function i(){return a.facebox.settings.overlay==0||a.facebox.settings.opacity===null}function j(){if(i())return;return a("#facebox_overlay").length==0&&a("body").append('<div id="facebox_overlay" class="facebox_hide"></div>'),a("#facebox_overlay").hide().addClass("facebox_overlayBG").css("opacity",a.facebox.settings.opacity).click(function(){a(document).trigger("close.facebox")}).fadeIn(200),!1}function k(){if(i())return;return a("#facebox_overlay").fadeOut(200,function(){a("#facebox_overlay").removeClass("facebox_overlayBG"),a("#facebox_overlay").addClass("facebox_hide"),a("#facebox_overlay").remove()}),!1}a.facebox=function(b,c){a.facebox.loading(),b.ajax?h(b.ajax,c):b.image?g(b.image,c):b.div?f(b.div,c):a.isFunction(b)?b.call(a):a.facebox.reveal(b,c)},a.extend(a.facebox,{settings:{opacity:.2,overlay:!0,loadingImage:"/facebox/loading.gif",closeImage:"/facebox/closelabel.png",imageTypes:["png","jpg","jpeg","gif"],faceboxHtml:'    <div id="facebox" style="display:none;">       <div class="popup">         <div class="content">         </div>         <a href="#" class="close"></a>       </div>     </div>'},loading:function(){b();if(a("#facebox .loading").length==1)return!0;j(),a("#facebox .content").empty().append('<div class="loading"><img src="'+a.facebox.settings.loadingImage+'"/></div>'),a("#facebox").show().css({top:c()[1]+d()/10,left:a(window).width()/2-a("#facebox .popup").outerWidth()/2}),a(document).bind("keydown.facebox",function(b){return b.keyCode==27&&a.facebox.close(),!0}),a(document).trigger("loading.facebox")},reveal:function(b,c){a(document).trigger("beforeReveal.facebox"),c&&a("#facebox .content").addClass(c),a("#facebox .content").append(b),a("#facebox .loading").remove(),a("#facebox .popup").children().fadeIn("normal"),a("#facebox").css("left",a(window).width()/2-a("#facebox .popup").outerWidth()/2),a(document).trigger("reveal.facebox").trigger("afterReveal.facebox")},close:function(){return a(document).trigger("close.facebox"),!1}}),a.fn.facebox=function(c){function d(){a.facebox.loading(!0);var b=this.rel.match(/facebox\[?\.(\w+)\]?/);return b&&(b=b[1]),f(this.href,b),!1}if(a(this).length==0)return;return b(c),this.bind("click.facebox",d)},a(document).bind("close.facebox",function(){a(document).unbind("keydown.facebox"),a("#facebox").fadeOut(function(){a("#facebox .content").removeClass().addClass("content"),a("#facebox .loading").remove(),a(document).trigger("afterClose.facebox")}),k()})}(jQuery),function(a){a.fn.cardsSelect=function(b){var c=a.extend({},a.fn.cardsSelect.defaults,b);return this.each(function(){var b=a(this),d=b.next("dl.form").find("input[type=text]"),e=b.find(".card"),f=b.find("input[name='"+c.type_field+"']"),g=function(b){e.each(function(){var c=a(this);c.attr("data-name")==b?c.removeClass("disabled"):c.addClass("disabled"),f.val(b)})};d.bind("keyup blur",function(){var b=a(this).val();b.match(/^5[1-5]/)?g("master"):b.match(/^4/)?g("visa"):b.match(/^3(4|7)/)?g("american_express"):b.match(/^6011/)?g("discover"):b.match(/^(30[0-5]|36|38)/)?g("diners_club"):b.match(/^(3|2131|1800)/)?g("jcb"):(e.removeClass("disabled"),f.val(""))}).keyup()})},a.fn.cardsSelect.defaults={type_field:"billing[type]"}}(jQuery),function(a){a.fn.enticeToAction=function(b){var c=a.extend({},a.fn.enticeToAction.defaults,b);return this.each(function(){var b=a(this);b.addClass("entice"),b.attr("title",c.title);switch(c.direction){case"downwards":var d="n";case"upwards":var d="s";case"rightwards":var d="w";case"leftwards":var d="e"}b.tipsy({gravity:d}),this.onclick=function(){return!1},this.href="#"})},a.fn.enticeToAction.defaults={title:"You must be signed in to use this feature",direction:"downwards"}}(jQuery),function(a){a.fn.errorify=function(b,c){var d=a.extend({},a.fn.errorify.defaults,c);return this.each(function(){var c=a(this);c.removeClass("warn"),c.addClass("errored"),c.find("p.note").hide(),c.find("dd.error").remove(),c.find("dd.warning").remove();var d=a("<dd>").addClass("error").text(b);c.append(d)})},a.fn.errorify.defaults={},a.fn.unErrorify=function(b){var c=a.extend({},a.fn.unErrorify.defaults,b);return this.each(function(){var b=a(this);b.removeClass("errored warn"),b.find("p.note").show(),b.find("dd.error").remove(),b.find("dd.warning").remove()})},a.fn.unErrorify.defaults={}}(jQuery),function(a){a.fn.repoList=function(b){var c=a.extend({},a.fn.repoList.defaults,b);return this.each(function(){var b=a(this),d=b.find(".js-repo-list"),e=b.find(".show-more"),f=b.find(".filter_input").val(""),g=f.val(),h=e.length==0?!0:!1,i=null,j=!1;e.click(function(){if(j)return!1;var b=e.spin();return j=!0,a(c.selector).load(c.ajaxUrl,function(){h=!0,b.parents(".repos").find(".filter_selected").click(),b.stopSpin()}),b.hide(),!1});var k=function(){var b=d.children("li");i?(b.hide(),d.find("li."+i).show()):b.show(),f.val()!=""&&b.filter(function(){return a(this).text().toLowerCase().indexOf(f.val().toLowerCase())===-1}).hide()};b.find(".repo_filter").click(function(){var c=a(this);return b.find(".repo_filterer a").removeClass("filter_selected"),c.addClass("filter_selected"),i=c.attr("rel"),h?k():e.click(),!1});var l="placeholder"in document.createElement("input"),m=function(){l||(f.val()==""?f.addClass("placeholder"):f.removeClass("placeholder"))};f.bind("keyup blur click",function(){if(this.value==g)return;g=this.value,h?k():e.click(),m()}),m()})},a.fn.repoList.defaults={selector:"#repo_listing",ajaxUrl:"/dashboard/ajax_your_repos"}}(jQuery),$.fn.selectableList=function(a,b){return $(this).each(function(){var c=$(this),d=$.extend({toggleClassName:"selected",wrapperSelector:"a",mutuallyExclusive:!1,itemParentSelector:"li",enableShiftSelect:!1,ignoreLinks:!1},b);return c.delegate(a+" "+d.itemParentSelector+" "+d.wrapperSelector,"click",function(b){if(b.which>1||b.metaKey||d.ignoreLinks&&$(b.target).closest("a").length)return!0;var e=$(this),f=e.find(":checkbox, :radio"),g=c.find(a+" ."+d.toggleClassName),h=c.find(a+" *[data-last]");!e.is(":checkbox, :radio")&&b.target!=f[0]&&(f.prop("checked")&&!f.is(":radio")?f.prop("checked",!1):f.prop("checked",!0)),d.mutuallyExclusive&&g.removeClass(d.toggleClassName),e.toggleClass(d.toggleClassName),f.change();if(d.enableShiftSelect&&b.shiftKey&&g.length>0){if(h.length>0){var i=h.offset().top,j=e.offset().top,k="#"+e.attr("id"),l=$,m=$,n=$;i>j?l=h.prevUntil(k):i<j&&(l=h.nextUntil(k)),m=l.find(":checkbox"),n=l.find(":checked"),n.length==m.length?(l.removeClass(d.toggleClassName),m.prop("checked",!1)):(l.addClass(d.toggleClassName),m.prop("checked",!0))}e.trigger("selectableList:shiftClicked")}h.removeAttr("data-last"),e.attr("data-last",!0)}),c.delegate(a+" li :checkbox,"+a+" li :radio","change",function(b){var e=$(this),f=e.closest(d.wrapperSelector);d.mutuallyExclusive&&c.find(a+" ."+d.toggleClassName).removeClass(d.toggleClassName),$(this).prop("checked")?f.addClass(d.toggleClassName):f.removeClass(d.toggleClassName)}),c.find(a)})},function(){var a;a={},$(document).bind("keydown",function(b){var c;if($(b.target).is(":input"))return;if(c=a[b.hotkey])return c.apply(this,arguments)}),$.hotkeys=function(a){var b,c;for(b in a)c=a[b],$.hotkey(b,c);return this},$.hotkey=function(b,c){return a[b]=c,this}}.call(this),function(a,b,c){function j(a){var b={},d=/^jQuery\d+$/;return c.each(a.attributes,function(a,c){c.specified&&!d.test(c.name)&&(b[c.name]=c.value)}),b}function k(a,d){var e=this,f=c(e);if(e.value==f.attr("placeholder")&&f.hasClass("placeholder"))if(f.data("placeholder-password")){f=f.hide().next().show().attr("id",f.removeAttr("id").data("placeholder-id"));if(a===!0)return f[0].value=d;f.focus()}else e.value="",f.removeClass("placeholder"),e==b.activeElement&&e.select()}function l(){var a,b=this,d=c(b),e=d,f=this.id;if(b.value==""){if(b.type=="password"){if(!d.data("placeholder-textinput")){try{a=d.clone().attr({type:"text"})}catch(g){a=c("<input>").attr(c.extend(j(this),{type:"text"}))}a.removeAttr("name").data({"placeholder-password":!0,"placeholder-id":f}).bind("focus.placeholder",k),d.data({"placeholder-textinput":a,"placeholder-id":f}).before(a)}d=d.removeAttr("id").hide().prev().attr("id",f).show()}d.addClass("placeholder"),d[0].value=d.attr("placeholder")}else d.removeClass("placeholder")}var d="placeholder"in b.createElement("input"),e="placeholder"in b.createElement("textarea"),f=c.fn,g=c.valHooks,h,i;d&&e?(i=f.placeholder=function(){return this},i.input=i.textarea=!0):(i=f.placeholder=function(){var a=this;return a.filter((d?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":k,"blur.placeholder":l}).data("placeholder-enabled",!0).trigger("blur.placeholder"),a},i.input=d,i.textarea=e,h={get:function(a){var b=c(a);return b.data("placeholder-enabled")&&b.hasClass("placeholder")?"":a.value},set:function(a,d){var e=c(a);return e.data("placeholder-enabled")?(d==""?(a.value=d,a!=b.activeElement&&l.call(a)):e.hasClass("placeholder")?k.call(a,!0,d)||(a.value=d):a.value=d,e):a.value=d}},d||(g.input=h),e||(g.textarea=h),c(function(){c(b).delegate("form","submit.placeholder",function(){var a=c(".placeholder",this).each(k);setTimeout(function(){a.each(l)},10)})}),c(a).bind("beforeunload.placeholder",function(){c(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery),function(a){function b(a,b){return typeof a=="function"?a.call(b):a}function c(a){while(a=a.parentNode)if(a==document)return!0;return!1}function d(b,c){this.$element=a(b),this.options=c,this.enabled=!0,this.fixTitle()}d.prototype={show:function(){var c=this.getTitle();if(c&&this.enabled){var d=this.tip();d.find(".tipsy-inner")[this.options.html?"html":"text"](c),d[0].className="tipsy",d.detach().css({top:0,left:0,visibility:"hidden",display:"block"}),this.options.className&&d.addClass(b(this.options.className,this.$element[0])),this.options.inline?d.insertAfter(this.$element[0]):d.prependTo(document.body);var e=a.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),f=d[0].offsetWidth,g=d[0].offsetHeight,h=b(this.options.gravity,this.$element[0]),i;switch(h.charAt(0)){case"n":i={top:e.top+e.height+this.options.offset,left:e.left+e.width/2-f/2};break;case"s":i={top:e.top-g-this.options.offset,left:e.left+e.width/2-f/2};break;case"e":i={top:e.top+e.height/2-g/2,left:e.left-f-this.options.offset};break;case"w":i={top:e.top+e.height/2-g/2,left:e.left+e.width+this.options.offset}}h.length==2&&(h.charAt(1)=="w"?i.left=e.left+e.width/2-15:i.left=e.left+e.width/2-f+15),d.offset(i).addClass("tipsy-"+h),d.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+h.charAt(0),this.options.fade?d.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):d.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){a(this).remove()}):this.tip().remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("original-title")!="string")&&a.attr("original-title",a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,b=this.$element,c=this.options;return c.content?c.content:(this.fixTitle(),typeof c.title=="string"?a=b.attr(c.title=="title"?"original-title":c.title):typeof c.title=="function"&&(a=c.title.call(b[0])),a=(""+a).replace(/(^\s*|\s*$)/,""),a||c.fallback)},tip:function(){return this.$tip||(this.$tip=a('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},a.fn.tipsy=function(b){function e(c){var e=a.data(c,"tipsy");return e||(e=new d(c,a.fn.tipsy.elementOptions(c,b)),a.data(c,"tipsy",e)),e}function f(){var a=e(this);a.hoverState="in",b.delayIn==0?a.show():(a.fixTitle(),setTimeout(function(){a.hoverState=="in"&&a.show()},b.delayIn))}function g(){var a=e(this);a.hoverState="out",b.delayOut==0?a.hide():setTimeout(function(){a.hoverState=="out"&&a.hide()},b.delayOut)}if(b===!0)return this.data("tipsy");if(typeof b=="string"){var c=this.data("tipsy");return c&&c[b](),this}b=a.extend({},a.fn.tipsy.defaults,b),b.live||this.each(function(){e(this)});if(b.trigger!="manual"){var h=b.live?"live":"bind",i=b.trigger=="hover"?"mouseenter":"focus",j=b.trigger=="hover"?"mouseleave":"blur";this[h](i,f)[h](j,g)}return this},a.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,inline:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},a.fn.tipsy.revalidate=function(){a(".tipsy").each(function(){var b=a.data(this,"tipsy-pointee");(!b||!c(b))&&a(this).remove()})},a.fn.tipsy.elementOptions=function(b,c){return a.metadata?a.extend({},c,a(b).metadata()):c},a.fn.tipsy.autoNS=function(){return a(this).offset().top>a(document).scrollTop()+a(window).height()/2?"s":"n"},a.fn.tipsy.autoWE=function(){return a(this).offset().left>a(document).scrollLeft()+a(window).width()/2?"e":"w"},a.fn.tipsy.autoBounds=function(b,c){return function(){var d={ns:c[0],ew:c.length>1?c[1]:!1},e=a(document).scrollTop()+b,f=a(document).scrollLeft()+b,g=a(this);return g.offset().top<e&&(d.ns="n"),g.offset().left<f&&(d.ew="w"),a(window).width()+a(document).scrollLeft()-g.offset().left<b&&(d.ew="e"),a(window).height()+a(document).scrollTop()-g.offset().top<b&&(d.ns="s"),d.ns+(d.ew?d.ew:"")}}}(jQuery),function(a){a.fn.popover=function(a){if(a=="destroy")this.tipsy("hide").data("tipsy",null);else if(a=="show")this.tipsy("show");else if(a=="hide")this.tipsy("hide");else{tipsyOptions={inline:!0,trigger:"manual",opacity:1,className:"popover",content:a.content,html:a.html};switch(a.placement){case"left":tipsyOptions.gravity="e";break;case"right":tipsyOptions.gravity="w";break;case"up":tipsyOptions.gravity="s";break;case"down":tipsyOptions.gravity="n"}this.tipsy("hide").data("tipsy",null),this.tipsy(tipsyOptions)}return this}}(jQuery),function(a){function b(a,b){var c=a.find("a");if(c.length>1){var d=c.filter(".selected"),e=c.get().indexOf(d.get(0));return e+=b,e>=c.length?e=0:e<0&&(e=c.length-1),d.removeClass("selected"),c.eq(e).addClass("selected"),!0}}a.fn.quicksearch=function(c){var d=a.extend({url:null,delay:150,spinner:null,insertSpinner:null,loading:a(".quicksearch-loading")},c);d.insertSpinner&&!d.spinner&&(d.spinner=a('<img src="'+GitHub.Ajax.spinner+'" alt="" class="spinner" width="16" />'));var e=function(a){return d.results.html(a).show()};return d.results.delegate("a","mouseover",function(b){var c=a(this);c.hasClass("selected")||(d.results.find("a.selected").removeClass("selected"),c.addClass("selected"))}),this.each(function(){function f(){d.insertSpinner&&(d.spinner.parent().length||d.insertSpinner.call(c,d.spinner),d.spinner.show()),c.trigger("quicksearch.loading"),d.loading&&e(d.loading.html())}function g(){d.insertSpinner&&d.spinner.hide(),c.trigger("quicksearch.loaded")}var c=a(this);c.autocompleteField({url:d.url||c.attr("data-url"),dataType:d.dataType,delay:d.delay,useCache:!0,minLength:2}).bind("keyup",function(a){a.which!=13&&c.val().length>=2&&d.results.is(":empty")&&f()}).bind("autocomplete:beforesend",function(a,b){f()}).bind("autocomplete:finish",function(a,b){e(b||{}),g()}).bind("autocomplete:clear",function(a){d.results.html("").hide(),g()}).bind("focus",function(a){c.val()&&c.trigger("keyup")}).bind("blur",function(a){setTimeout(function(){c.trigger("autocomplete:clear")},250)}).bind("keydown",function(c){switch(c.hotkey){case"up":if(b(d.results,-1))return!1;break;case"down":if(b(d.results,1))return!1;break;case"esc":return a(this).blur(),!1;case"enter":var e,f=d.results.find("a.selected");if(f.length)return a(this).blur(),f.hasClass("initial")?f.closest("form").submit():window.location=f.attr("href"),!1;a(this).trigger("autocomplete:clear")}})})}}(jQuery),function(a){function e(a){return"tagName"in a?a:a.parentNode}try{window.document.createEvent("TouchEvent")}catch(b){return!1}var c={},d;a(document).ready(function(){a(document.body).bind("touchstart",function(a){var b=Date.now(),f=b-(c.last||b);c.target=e(a.originalEvent.touches[0].target),d&&clearTimeout(d),c.x1=a.originalEvent.touches[0].pageX,f>0&&f<=250&&(c.isDoubleTap=!0),c.last=b}).bind("touchmove",function(a){c.x2=a.originalEvent.touches[0].pageX}).bind("touchend",function(b){c.isDoubleTap?(a(c.target).trigger("doubleTap"),c={}):c.x2>0?(Math.abs(c.x1-c.x2)>30&&a(c.target).trigger("swipe")&&a(c.target).trigger("swipe"+(c.x1-c.x2>0?"Left":"Right")),c.x1=c.x2=c.last=0):"last"in c&&(d=setTimeout(function(){d=null,a(c.target).trigger("tap"),c={}},250))}).bind("touchcancel",function(){c={}})}),["swipe","swipeLeft","swipeRight","doubleTap","tap"].forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})}(jQuery),function(a){function o(){return window.DeviceMotionEvent!=undefined}function p(b){if((new Date).getTime()<d+c)return;if(o()){var e=b.accelerationIncludingGravity,f=e.x,g=e.y;l.xArray.length>=5&&l.xArray.shift(),l.yArray.length>=5&&l.yArray.shift(),l.xArray.push(f),l.yArray.push(g),l.xMotion=Math.round((n(l.xArray)-m(l.xArray))*1e3)/1e3,l.yMotion=Math.round((n(l.yArray)-m(l.yArray))*1e3)/1e3,(l.xMotion>1.5||l.yMotion>1.5)&&i!=10&&(i=10),l.xMotion>j||l.yMotion>j?k++:k=0,k>=5?(h=!0,a(document).unbind("mousemove.plax"),a(window).bind("devicemotion",q(b))):(h=!1,a(window).unbind("devicemotion"),a(document).bind("mousemove.plax",function(a){q(a)}))}}function q(a){if((new Date).getTime()<d+c)return;d=(new Date).getTime();var b=a.pageX,j=a.pageY;if(h==1){var k=window.orientation?(window.orientation+180)%360/90:2,l=a.accelerationIncludingGravity,m=k%2==0?-l.x:l.y,n=k%2==0?l.y:l.x;b=k>=2?m:-m,j=k>=2?n:-n,b=(b+i)/2,j=(j+i)/2,b<0?b=0:b>i&&(b=i),j<0?j=0:j>i&&(j=i)}var o=b/(h==1?i:f),p=j/(h==1?i:g),q,k;for(k=e.length;k--;)q=e[k],q.invert!=1?q.obj.css("left",q.startX+q.xRange*o).css("top",q.startY+q.yRange*p):q.obj.css("left",q.startX-q.xRange*o).css("top",q.startY-q.yRange*p)}var b=25,c=1/b*1e3,d=(new Date).getTime(),e=[],f=a(window).width(),g=a(window).height(),h=!1,i=1,j=.05,k=0,l={xArray:[0,0,0,0,0],yArray:[0,0,0,0,0],xMotion:0,yMotion:0};a(window).resize(function(){f=a(window).width(),g=a(window).height()}),a.fn.plaxify=function(b){return this.each(function(){var c={xRange:0,yRange:0,invert:!1};for(var d in b)c[d]==0&&(c[d]=b[d]);c.obj=a(this),c.startX=this.offsetLeft,c.startY=this.offsetTop,c.invert==0?(c.startX-=Math.floor(c.xRange/2),c.startY-=Math.floor(c.yRange/2)):(c.startX+=Math.floor(c.xRange/2),c.startY+=Math.floor(c.yRange/2)),e.push(c)})};var m=function(a){return Math.min.apply({},a)},n=function(a){return Math.max.apply({},a)};a.plax={enable:function(){a(document).bind("mousemove.plax",function(a){q(a)}),o()&&(window.ondevicemotion=function(a){p(a)})},disable:function(){a(document).unbind("mousemove.plax"),window.ondevicemotion=undefined}},typeof ender!="undefined"&&a.ender(a.fn,!0)}(function(){return typeof jQuery!="undefined"?jQuery:ender}()),function(){var a;a=function(a){return debug("AJAX Error",a),$("#ajax-error-message").show(function(){return $(this).addClass("visible")})},$(document).on("ajaxError","[data-remote]",function(b,c,d,e){if(e==="canceled")return;return/<html/.test(c.responseText)?(a(e),b.stopImmediatePropagation()):setTimeout(function(){if(b.isDefaultPrevented())return;return a(e)},0)}),$(document).on("ajaxBeforeSend","[data-remote]",function(a,b,c){return $("#ajax-error-message").hide().removeClass("visible")}),$(document).on("click",".ajax-error-dismiss",function(){return $("#ajax-error-message").hide().removeClass("visible"),!1})}.call(this),function(){$(document).on("ajaxSend","[data-remote]",function(a){if(a.isDefaultPrevented())return;return $(this).addClass("loading"),$(document.documentElement).addClass("ajax-loading")}),$(document).on("ajaxComplete","[data-remote]",function(){return $(document.documentElement).removeClass("ajax-loading"),$(this).removeClass("loading")})}.call(this),function(){var a;a=function(a){var b,c,d;a=$(a),b=a.val();if(!$.trim(b))return;a.addClass("is-autocheck-loading"),a.removeClass("is-autocheck-successful is-autocheck-errored"),(d=a.data("autocheck-xhr"))!=null&&d.abort(),a.trigger("autocheck:send"),c=$.ajax({type:"POST",url:a.attr("data-autocheck-url"),data:{value:b},complete:function(b,c){if(c==="abort")return;return a.removeClass("is-autocheck-loading"),a.trigger("autocheck:complete",arguments)},success:function(){return a.addClass("is-autocheck-successful"),a.closest("dl.form").unErrorify(),a.trigger("autocheck:success",arguments)},error:function(b,c){if(c==="abort")return;return a.addClass("is-autocheck-errored"),/<html/.test(b.responseText)?a.closest("dl.form").errorify("Something went wrong."):a.closest("dl.form").errorify(b.responseText),a.trigger("autocheck:error",arguments)}}),a.data("autocheck-xhr",c)},$(document).on("change","input[data-autocheck-url]",function(){return a(this)}),$(document).on("focusin","input[data-autocheck-url]",function(){return $(this).on("throttled:input.autocheck",function(){return a(this)}),$(this).on("blur.autocheck",function(){return $(this).off(".autocheck")})})}.call(this),function(){var a,b=this;a=function(){function a(){var b=this;this.onNavigationOpen=function(c){return a.prototype.onNavigationOpen.apply(b,arguments)},this.onNavigationKeyDown=function(c){return a.prototype.onNavigationKeyDown.apply(b,arguments)},this.onClick=function(c){return a.prototype.onClick.apply(b,arguments)},this.onResultsChange=function(c){return a.prototype.onResultsChange.apply(b,arguments)},this.onInputChange=function(c,d){return a.prototype.onInputChange.apply(b,arguments)},this.onResultsMouseDown=function(c){return a.prototype.onResultsMouseDown.apply(b,arguments)},this.onInputBlur=function(c){return a.prototype.onInputBlur.apply(b,arguments)},this.onInputFocus=function(c){return a.prototype.onInputFocus.apply(b,arguments)},$(document).on("focusin","input[data-autocomplete]",this.onInputFocus),$(document).on("throttled:input","input[data-autocomplete]",this.onInputChange),this.focusedInput=this.focusedResults=null,this.mouseDown=!1}return a.prototype.bindEvents=function(a,b){return $(a).on("blur",this.onInputBlur),$(b).on("mousedown",this.onResultsMouseDown),$(b).on("autocomplete:change",this.onResultsChange),$(b).on("click","[data-autocomplete-value]",this.onClick),$(b).on("navigation:open","[data-autocomplete-value]",this.onNavigationOpen),$(b).on("navigation:keydown","[data-autocomplete-value]",this.onNavigationKeyDown)},a.prototype.unbindEvents=
  function(a,b){return $(a).off("blur",this.onInputBlur),$(b).off("mousedown",this.onResultsMouseDown),$(b).off("autocomplete:change",this.onResultsChange),$(b).off("click","[data-autocomplete-value]",this.onClick),$(b).off("navigation:open","[data-autocomplete-value]",this.onNavigationOpen),$(b).off("navigation:keydown","[data-autocomplete-value]",this.onNavigationKeyDown)},a.prototype.onInputFocus=function(a){var b,c;b=a.currentTarget,c=document.getElementById($(b).attr("data-autocomplete")),this.focusedInput=b,this.focusedResults=c,this.bindEvents(b,c),$(b).trigger("autocomplete:focus"),$(b).trigger("autocomplete:search",[$(b).val()])},a.prototype.onInputBlur=function(a){var b,c;b=a.currentTarget,c=this.focusedResults,this.mouseDown||(this.hideResults(),this.inputValue=null,this.focusedInput=this.focusedResults=null,this.unbindEvents(b,c),$(b).trigger("autocomplete:blur"))},a.prototype.onResultsMouseDown=function(a){var b,c=this;this.mouseDown=!0,b=function(){return c.mouseDown=!1,$(document).off("mouseup",b)},$(document).on("mouseup",b)},a.prototype.onInputChange=function(a,b){var c;c=a.currentTarget,this.inputValue!==b&&($(c).removeAttr("data-autocompleted"),$(c).trigger("autocomplete:autocompleted:changed")),$(c).trigger("autocomplete:change",[b]),$(c).trigger("autocomplete:search",[b])},a.prototype.onResultsChange=function(a){var b,c;c=$(this.focusedInput).val(),b=$(this.focusedResults).find("[data-autocomplete-value]"),b.length===0?this.hideResults():this.inputValue!==c&&(this.inputValue=c,this.showResults(),$(this.focusedInput).is("[data-autocomplete-autofocus]")&&$(this.focusedResults).find("ul").navigation("focus"))},a.prototype.onClick=function(a){return this.onNavigationOpen(a),!1},a.prototype.onNavigationKeyDown=function(a){switch(a.hotkey){case"tab":return this.onNavigationOpen(a),!1;case"esc":return this.hideResults(),!1}},a.prototype.onNavigationOpen=function(a){var b,c;b=a.currentTarget,c=$(b).attr("data-autocomplete-value"),this.inputValue=c,$(this.focusedInput).val(c),$(this.focusedInput).attr("data-autocompleted",c),$(this.focusedInput).trigger("autocomplete:autocompleted:changed",[c]),$(this.focusedInput).trigger("autocomplete:result",[c]),$(b).removeClass("active"),this.hideResults()},a.prototype.showResults=function(a,b){var c,d,e,f,g;a==null&&(a=this.focusedInput),b==null&&(b=this.focusedResults);if($(b).is(":visible"))return;return g=$(a).offset(),e=g.top,d=g.left,c=e+$(a).innerHeight(),f=$(a).innerWidth(),$(b).css({display:"block",position:"absolute",width:f+2}),$(b).offset({top:c+5,left:d+1}),$(a).addClass("js-navigation-enable"),$(b).find("ul").navigation("push"),$(b).show()},a.prototype.hideResults=function(a,b){a==null&&(a=this.focusedInput),b==null&&(b=this.focusedResults);if(!$(b).is(":visible"))return;return $(a).removeClass("js-navigation-enable"),$(b).find("ul").navigation("pop"),$(b).hide()},a}(),new a}.call(this),function(){var a,b=this;a=function(){function a(b){var c=this;this.container=b,this.hoverEnd=function(){return a.prototype.hoverEnd.apply(c,arguments)},this.hoverStart=function(){return a.prototype.hoverStart.apply(c,arguments)},this.items=this.container.find(".avatars li"),this.items.length>1&&this.container.hover(this.hoverStart,this.hoverEnd)}return a.prototype.namespace="avatarStack",a.prototype.hoverStart=function(){return this.container.addClass("avatar-stack-focus")},a.prototype.hoverEnd=function(){return this.container.removeClass("avatar-stack-focus")},a}(),$(function(){return $(".avatar-stack").each(function(){return new a($(this))})})}.call(this),function(){var a,b=this;a=function(){function a(b){var c=this;this.container=b,this.selectTab=function(b){return a.prototype.selectTab.apply(c,arguments)},this.clearAll=function(){return a.prototype.clearAll.apply(c,arguments)},this.prevSlide=function(){return a.prototype.prevSlide.apply(c,arguments)},this.nextSlide=function(){return a.prototype.nextSlide.apply(c,arguments)},this.reset=function(){return a.prototype.reset.apply(c,arguments)},this.start=function(){return a.prototype.start.apply(c,arguments)},this.stop=function(){return a.prototype.stop.apply(c,arguments)},this.handleClick=function(b){return a.prototype.handleClick.apply(c,arguments)},this.handleKeynav=function(b){return a.prototype.handleKeynav.apply(c,arguments)},this.readState=function(){return a.prototype.readState.apply(c,arguments)},this.readState(),this.currentTab=$(this.container).find(".js-carousel-nav .selected"),this.start(),$(this.container).on("click",".js-carousel-nav a",this.handleClick),$(this.container).find(".js-carousel-slides").hover(this.stop,this.start)}return a.prototype.namespace="carousel",a.prototype.TIMEOUT=1e4,a.prototype.readState=function(){var a;a=window.location.hash;if(a)return this.selectTab($(this.container).find("[href="+a+"]").closest("li").index())},a.prototype.handleKeynav=function(a){if($(a.target).is(":input"))return;if(a.hotkey==="left"||a.keyCode===37)this.prevSlide(),this.reset(),a.preventDefault();else if(a.hotkey==="right"||a.keyCode===39)this.nextSlide(),this.reset(),a.preventDefault()},a.prototype.handleClick=function(a){return this.reset(),this.selectTab($(a.currentTarget).closest("li").index()),!1},a.prototype.stop=function(){return clearInterval(this.interval),this.interval=null},a.prototype.start=function(){return this.interval=setInterval(this.nextSlide,this.TIMEOUT)},a.prototype.reset=function(){this.stop();if(!this.interval)return this.start()},a.prototype.nextSlide=function(){var a;if(!$(".js-carousel-nav").length){this.stop(),$(document).off("keyup.carousel");return}return a=this.currentTab.index(),a+1===$(this.container).find(".js-carousel-nav li").length?a=0:a++,this.selectTab(a)},a.prototype.prevSlide=function(){var a;return a=this.currentTab.index(),a===0?a=$(this.container).find(".js-carousel-nav li").length-1:a--,this.selectTab(a)},a.prototype.clearAll=function(){return this.container.find(".selected").removeClass("selected"),this.container.find(".previous").removeClass("previous"),this.container.find(".next").removeClass("next")},a.prototype.selectTab=function(a){var b,c,d,e,f,g;return this.clearAll(),c=$(this.container).find(".js-carousel-nav li").length,f=a===0?c-1:a-1,e=a+1===c?0:a+1,$(this.container).find(".js-carousel-nav li:eq("+f+"), .js-carousel-slides li:eq("+f+")").addClass("previous"),$(this.container).find(".js-carousel-nav li:eq("+a+"), .js-carousel-slides li:eq("+a+")").addClass("selected"),$(this.container).find(".js-carousel-nav li:eq("+e+"), .js-carousel-slides li:eq("+e+")").addClass("next"),d=$(this.container).find(".js-carousel-nav li:eq("+a+")"),this.currentTab=d,b=d.find("a").attr("href"),typeof (g=window.history).replaceState=="function"?g.replaceState(null,document.title,b):void 0},a}(),$.pageUpdate(function(){var b,c;b=$(".js-carousel");if(b.length)return c=new a($(b)),$(document).on("keyup.carousel",c.handleKeynav)})}.call(this),function(){$.pageUpdate(function(){var a;if($(".js-zeroclipboard").length)return a=new ZeroClipboard($(".js-zeroclipboard")),a.on("load",function(a,b){return $(a.htmlBridge).tipsy()}),a.on("complete",function(a,b){var c;return c=$(a.htmlBridge),c.prop("title",$(this).attr("data-copied-hint")),c.tipsy("show")}),a.on("noflash wrongflash",function(a,b){return $(".js-zeroclipboard").hide()})})}.call(this),function(){$(document).on("ajaxBeforeSend",".js-new-comment-form",function(a){if(this!==a.target)return;if($(this).data("remote-xhr"))return!1}),$(document).on("ajaxSend",".js-new-comment-form",function(a){if(this!==a.target)return;return $(this).find(".js-comment-form-error").hide()}),$(document).on("ajaxSuccess",".js-new-comment-form",function(a){if(this!==a.target)return;return this.reset(),$(this).find(".js-write-tab").click()}),$(document).on("ajaxError",".js-new-comment-form",function(a){var b;if(this!==a.target)return;return b="There was an error posting your comment",$(this).find(".js-comment-field").val().trim()===""&&(b="Comment field was blank"),$(this).find(".js-comment-form-error").show().text(b),!1})}.call(this),function(){$(document).onFocusedInput(".js-new-comment-form .js-comment-field",function(){var a,b,c,d,e;b=$(this).closest(".js-new-comment-form"),a=b.find(".js-comment-and-button").first();if(!a[0])return;return d=a.text(),e=a.attr("data-original-text"),c=a.attr("data-comment-text"),function(){var b,f;f=$(this).val().trim()!=="",b=f?c:e,b!==d&&a.text(d=b)}})}.call(this),function(){$(document).on("click",".js-comment-edit-button",function(){var a;return a=$(this).closest(".js-comment"),a.addClass("is-comment-editing"),a.find(".js-comment-field").focus(),!1}),$(document).on("click",".js-comment-cancel-button",function(){return $(this).closest(".js-comment").removeClass("is-comment-editing"),!1}),$(document).on("ajaxSend",".js-comment-delete, .js-comment-update",function(a,b){var c;return c=$(this).closest(".js-comment"),c.addClass("is-comment-loading"),c.find(".minibutton").addClass("disabled"),b.setRequestHeader("X-Body-Version",c.attr("data-body-version"))}),$(document).on("ajaxError",".js-comment-update",function(a,b,c,d){var e,f;if(b.status===422)try{f=JSON.parse(b.responseText);if(f.stale)return b.stale=!0,e=$(this).closest(".js-comment"),e.addClass("is-comment-stale"),e.find(".minibutton").addClass("disabled"),e.hasClass("is-updating-task-list")&&window.location.reload(),a.preventDefault()}catch(d){}}),$(document).on("ajaxComplete",".js-comment-delete, .js-comment-update",function(a,b,c){var d;d=$(this).closest(".js-comment"),d.removeClass("is-comment-loading"),d.find(".minibutton").removeClass("disabled");if(b.stale)return d.find(".form-actions button[type=submit].minibutton").addClass("disabled")}),$(document).on("ajaxSuccess",".js-comment-delete",function(){var a,b;return a=$(this).closest(".js-comment"),b=$(this).closest(".js-comment-container"),b.length||(b=a),b.fadeOut(function(){return a.removeClass("is-comment-editing")})}),$(document).on("ajaxSuccess",".js-comment-update",function(a,b,c,d){var e,f;return e=$(this).closest(".js-comment"),f=$(this).closest(".js-comment-container"),f.length||(f=e),d.title!=null&&e.find(".js-comment-body-title").html(d.title),e.find(".js-comment-body").html(d.body),e.attr("data-body-version",d.newBodyVersion),e.removeClass("is-comment-editing"),f.pageUpdate()})}.call(this),function(){$(document).on("focusin",".js-write-bucket",function(){return $(this).addClass("focused")}),$(document).on("focusout",".js-write-bucket",function(){return $(this).removeClass("focused")})}.call(this),function(){$(document).onFocusedKeydown(".js-comment-field",function(){return function(a){var b;if(a.hotkey==="ctrl+L"||a.hotkey==="meta+L")if(b=$(this).prev(".js-enable-fullscreen")[0])return b.click(),!1}})}.call(this),function(){var a;$(document).on("click",".add-line-comment[data-remote]",function(){var b,c;return $(this).hasClass("loading")?!1:($(this).closest(".file").addClass("show-inline-notes"),c=$(this).closest("tr"),b=c.next("tr.inline-comments"),b.length?a(b):$.ajax({context:this,url:$(this).attr("data-remote"),success:function(b){return c.after(b).fire("pageUpdate"),a(c.next("tr.inline-comments"))}}))}),a=function(a){return a.find(".js-write-tab").click(),a.addClass("show-inline-comment-form").find(".js-comment-field").focus()},$(document).on("click",".js-show-inline-comment-form",function(){return a($(this).closest(".inline-comments")),!1}),$(document).on("click",".js-hide-inline-comment-form",function(){var a;return a=$(this).closest(".inline-comments"),a.removeClass("show-inline-comment-form"),a.find(".inline-comment-form .js-comment-field").val(""),a.find(".js-comments-holder").children(":visible").length||a.remove(),!1}),$(document).onFocusedKeydown(".inline-comment-form .js-comment-field",function(){return function(a){var b;if($(this).hasClass("js-navigation-enable"))return;if(a.hotkey==="esc"&&this.value.length===0)return b=$(this).closest(".inline-comments"),b.find(".js-hide-inline-comment-form").click(),!1}}),$(document).on("ajaxSend",".js-inline-comment-form",function(){return $(this).find(".ajaxindicator").show()}),$(document).on("ajaxComplete",".js-inline-comment-form",function(){return $(this).find(".ajaxindicator").hide()}),$(document).on("ajaxSuccess",".js-inline-comment-form",function(a,b,c,d){var e,f;return f=$(this).closest(".js-line-comments"),f.find(".js-comments-holder").append(d),f.find(".js-hide-inline-comment-form").click(),e=f.closest(".inline-comments").find(".comment-count .counter"),e.text(parseInt(e.text().replace(",",""))+1),f.closest(".inline-comments").pageUpdate()}),$(document).on("ajaxSuccess",".inline-comments .js-comment-delete",function(){var a,b=this;return a=$(this).closest(".inline-comments"),setTimeout(function(){if(!a.find(".js-comments-holder").children(":visible").length)return a.remove()},500)})}.call(this),function(){var a,b;$(document).on("click",".js-write-tab",function(){var a;return a=$(this).closest(".js-previewable-comment-form"),a.addClass("write-selected").removeClass("preview-selected"),a.find(".tabnav-tab").removeClass("selected"),$(this).addClass("selected"),!1}),$(document).on("click",".js-preview-tab",function(){var c;return c=$(this).closest(".js-previewable-comment-form"),c.addClass("preview-selected").removeClass("write-selected"),c.find(".tabnav-tab").removeClass("selected"),$(this).addClass("selected"),a(c),b(c),!1}),b=function(a){var b;return b=a.find(".comment-body"),b.html("<p>Loading preview&hellip;</p>"),$.ajax({type:"POST",url:a.attr("data-preview-url"),data:{text:a.find(".js-comment-field").val()},success:function(a){return b.html(a||"<p>Nothing to preview</p>")}})},$(document).onFocusedKeydown(".js-comment-field",function(){return function(a){var b;if(a.hotkey==="ctrl+P"||a.hotkey==="meta+P"){b=$(this).closest(".js-previewable-comment-form");if(b.hasClass("write-selected"))return $(this).blur(),b.find(".preview-tab").click(),a.stopImmediatePropagation(),!1}}}),a=function(a){return $(document).off("keydown.unpreview"),$(document).on("keydown.unpreview",function(b){if(b.hotkey==="ctrl+P"||b.hotkey==="meta+P")return a.find(".js-write-tab").click(),a.find(".js-comment-field").focus(),$(document).off("keydown.unpreview"),!1})}}.call(this),function(){$(document).on("keydown",function(a){var b,c,d,e;if(a.hotkey!=="r")return;if($(a.target).is(":input"))return;if(!(c=$(".js-new-comment-form .js-comment-field")[0]))return;e=window.getSelection();if(e.toString()&&$(e.focusNode).closest(".js-discussion").length){d="> "+e.toString().replace(/\n/g,"\n> ")+"\n\n";if(b=c.value)d=""+b+"\n\n"+d;c.value=d}return $(c).closest(".js-new-comment-form").scrollTo({duration:300},function(){return c.focus(),c.selectionStart=c.value.length}),!1})}.call(this),function(){$(document).onFocusedKeydown(".js-comment-field",function(){return function(a){if(a.hotkey==="ctrl+enter"||a.hotkey==="meta+enter")return $(this).closest("form").submit(),!1}})}.call(this),function(){var a,b=this;a=function(){function a(b){var c=this;this.container=b,this.onTabClick=function(b){return a.prototype.onTabClick.apply(c,arguments)},this.onFilterChange=function(){return a.prototype.onFilterChange.apply(c,arguments)},this.onNavigationOpen=function(b){return a.prototype.onNavigationOpen.apply(c,arguments)},this.onDeactivate=function(){return a.prototype.onDeactivate.apply(c,arguments)},this.onActivated=function(){return a.prototype.onActivated.apply(c,arguments)},this.pane=this.container.find(".pane-selector"),this.list=this.container.find(".js-navigation-container"),this.filter=this.container.find(".filterbar input"),this.items=this.list.find(".js-navigation-item"),this.container.on("menu:activated."+this.namespace,this.onActivated),this.container.on("menu:deactivate."+this.namespace,this.onDeactivate),this.container.on("filterable:change."+this.namespace,this.onFilterChange),this.container.on("navigation:open."+this.namespace,".js-navigation-item",this.onNavigationOpen),this.container.on("click."+this.namespace,".tabs > li > a",this.onTabClick),this.list.navigation("push")}return a.prototype.namespace="contextMenu",a.prototype.onActivated=function(){return this.filter.focus()},a.prototype.onDeactivate=function(){return this.list.navigation("pop"),this.items.removeClass("navigation-focus"),this.filter.val("").trigger("filterable:change"),this.container.off("."+this.namespace),this.container=this.pane=this.list=this.filter=this.items=null},a.prototype.onNavigationOpen=function(a){var b,c;b=$(a.currentTarget),this.items.filter(".selected").removeClass("selected"),b.addClass("selected"),b.find("input[type=radio]").prop("checked",!0).change(),c=b.find(".js-context-button-text"),c[0]&&this.container.find(".js-context-button").html(c.html()),this.pane.menu("deactivate")},a.prototype.onFilterChange=function(){this.reset()},a.prototype.onTabClick=function(a){var b;this.reset(),this.container.find(".tabs > li > a").removeClass("selected"),$(a.currentTarget).addClass("selected");if(b=$(a.currentTarget).attr("data-filter"))this.container.find(".js-filter-tab").hide(),this.container.find(".js-filter-"+b).show();return!1},a.prototype.reset=function(){return this.items.removeClass("navigation-focus"),this.list.navigation("focus")},a}(),$(document).on("menu:activate",".js-context-menu",function(){return new a($(this))})}.call(this),function(){GitHub.DangerousConfirmationBehavior=function(){function a(a){var b=this;this.element=$(a);if(!this.element.length)return;this.input=this.element.find(".confirm-input"),this.button=this.element.find(".confirm-button").attr("disabled","disabled"),this.confirmations=this.input.attr("data-confirm").toLowerCase().split(","),this.input.on("keyup",function(){return b.update()})}return a.prototype.update=function(){var a,b,c,d,e;this.button.attr("disabled","disabled"),d=this.confirmations,e=[];for(b=0,c=d.length;b<c;b++)a=d[b],this.input.val().toLowerCase()===a.toLowerCase()?e.push(this.button.attr("disabled",!1)):e.push(void 0);return e},a}(),$.pageUpdate(function(){return $(this).find(".js-dangerous-confirmation").each(function(){return new GitHub.DangerousConfirmationBehavior(this)})})}.call(this),function(){$(document).on("click",".js-details-container .js-details-target",function(){return $(this).closest(".js-details-container").performTransition(function(){return this.toggleClass("open")}),!1})}.call(this),function(){var a,b,c,d,e,f;f=function(){var a,b,c;return Modernizr.canvastext?(b=document.createElement("canvas"),a=b.getContext("2d"),a.textBaseline="top",a.font="32px Arial",c=String.fromCharCode(55357)+String.fromCharCode(56835),a.fillText(c,0,0),a.getImageData(16,16,1,1).data[0]!==0):!1}();if(f)return;a=function(a,b){return(a-55296)*1024+(b-56320)+65536},d=function(a){return 127462<=a&&a<=127487},b=function(a){return'<img height=20 width=20 align=absmiddle src="'+GitHub.assetHostUrl+"/images/icons/emoji/unicode/"+a+'.png">'},e=function(c){var e,f;if(c.data.match(/([\ud800-\udbff])([\udc00-\udfff])/g))return e=c.parentElement,f=null,e.innerHTML=e.innerHTML.replace(/([\ud800-\udbff])([\udc00-\udfff])/g,function(c,e,g){var h,i;return h=a(e.charCodeAt(0),g.charCodeAt(0)),d(h)?f?(i=""+f.toString(16)+"-"+h.toString(16),f=null,b(i)):(f=h,""):(f=null,b(h.toString(16)))})},c=function(a,b){if(!a)return;c(a.nextSibling,b),a.nodeType===3&&b(a),c(a.firstChild,b)},$.pageUpdate(function(){var a,b,d,f;f=$(this).find(".markdown-body");for(b=0,d=f.length;b<d;b++)a=f[b],c(a,e)})}.call(this),function(){var a,b,c,d;b=function(a){var b,d,e,f,g,h;return d=document.getElementById(a),e=document.getElementById("fullscreen_overlay"),f=$(e).find(".js-fullscreen-contents"),Modernizr.localstorage&&(g="gh-fullscreen-theme",localStorage.getItem(g)==="dark"?$(".js-fullscreen-overlay").addClass("dark-theme"):$(".js-fullscreen-overlay").removeClass("dark-theme")),h=$(d).val(),b=$(d).caret(),$(e).attr("data-return-scroll-position",window.pageYOffset),$("body").addClass("fullscreen-overlay-enabled"),$(document).on("keydown",c),$(f).attr("placeholder",$(d).attr("placeholder")),$(f).val(h),$(f).caret(b),f.focus()},a=function(a){var b,d,e,f,g,h;return d=document.getElementById(a),e=document.getElementById("fullscreen_overlay"),g=$(e).find(".js-fullscreen-contents"),h=$(g).val(),b=$(g).caret(),$("body").removeClass("fullscreen-overlay-enabled"),$(document).off("keydown",c),(f=$(e).attr("data-return-scroll-position"))&&window.scrollTo(0,f),window.editor!=null?window.editor.setCode(h):($(d).val(h),$(d).caret(b),$(d).trigger("validation:field:change")),g.val("")},d=!1,c=function(a){if(a.keyCode===27||a.hotkey==="ctrl+L"||a.hotkey==="meta+L")return d?history.back():window.location.hash="",a.preventDefault()},$(document).on("click",".js-exit-fullscreen",function(a){d&&(a.preventDefault(),history.back())}),$(document).on("click",".js-theme-switcher",function(){var a;return Modernizr.localstorage?(a="gh-fullscreen-theme",localStorage.getItem(a)==="dark"?(localStorage.removeItem(a),$(".js-fullscreen-overlay").removeClass("dark-theme")):(localStorage.setItem(a,"dark"),$(".js-fullscreen-overlay").addClass("dark-theme"))):$(".js-fullscreen-overlay").toggleClass("dark-theme"),!1}),$(window).on("hash:change",function(c){var e,f;if(e=c.newURL.match(/\#fullscreen_(.+)$/))return d=!!c.oldURL,b(e[1]);if(e=(f=c.oldURL)!=null?f.match(/\#fullscreen_(.+)$/):void 0)return d=!1,a(e[1])}),$(function(){var a;if(Modernizr.localstorage){a="gh-fullscreen-theme";if(localStorage.getItem(a)==="dark")return $(".js-fullscreen-overlay").addClass("dark-theme")}})}.call(this),function(){var a,b,c;b={},a=function(a){var c;a.preventDefault(),(c=b[a.hotkey])&&$(c).simulateClick()},$(document).on("keydown",function(b){if($(b.target).is(":input"))return;b.hotkey==="g"&&(b.preventDefault(),$(document).on("keydown hotkey:activate",a),setTimeout(function(){return $(document).off("keydown hotkey:activate",a)},1500))}),$.pageUpdate(c=function(){var a,c,d,e,f;b={},f=$("[data-gotokey]");for(d=0,e=f.length;d<e;d++)a=f[d],c=$(a).attr("data-gotokey"),b[c]=a})}.call(this),function(){var a,b,c,d,e;c=function(b){var c,f,g,h,i,j,k;c=$(a(this));if(b.which===2||b.metaKey)return!0;if(!c.length)return!0;g=$(this).closest(".js-hard-tabs"),k=g.find("a.selected");for(i=0,j=k.length;i<j;i++)f=k[i],$(f).removeClass("selected"),d(g,$(a(f)));return e(g,c),$(this).addClass("selected"),typeof (h=window.history).replaceState=="function"&&h.replaceState(null,document.title,$(this).attr("href")),c.pageChange(),!1},$(document).on("click",".js-hard-tabs a",c),a=function(a){var c,d;return d=b($(a).attr("href")),c=$(a).attr("data-container-id")?$(a).attr("data-container-id"):d,document.getElementById(c)},d=function(a,b){return a.hasClass("js-large-data-tabs")?b[0]===null?$():(b.is(":visible")&&!b[0].style.width&&b.css({width:""+b.width()+"px"}),b.css({position:"absolute",left:"-9999px"})):b.hide()},e=function(a,b){return a.hasClass("js-large-data-tabs")?b[0]===null?$():(b.is(":visible")||b.show(),b.css({position:"",left:""})):b.show()},b=function(a){var b;return a==null&&(a=document.location.pathname),a=a.replace(/\?.+|#.+/,""),b=a.match(/[^\/]+\/?$/),b.length===0&&alert("Invalid tab link!"),b[0].replace("/","")}}.call(this),function(){var a,b;b=function(a,b){var c,d,e;if(d=window.location.hash.slice(1))e=document.getElementById(d);return e==null&&(e=window),c=$.Event("hash:change",{oldURL:a,newURL:b}),$(e).trigger(c),!c.isDefaultPrevented()},$(function(){b(null,window.location.href)}),$(window).on("hashchange",function(a){var c;return c=a.originalEvent,b(c.oldURL,c.newURL)}),a=function(a){var b,c;((c=a.data)!=null?c.test:void 0)!=null&&(b=a.handler,a.handler=function(a){var c;if(c=a.newURL.match(a.data))return b.call(this,a,c)})},$.event.special["hash:change"]={add:a}}.call(this),function(){$(document).on("ajaxSuccess",".js-notice-dismiss",function(){return $(this).closest(".js-notice").fadeOut()}),$(document).on("ajaxError",".js-notice-dismiss",function(){return alert("Failed to dismiss notice. Sorry!")})}.call(this),function(){var a;$.support.pjax&&($.pjax.defaults.timeout=GitHub.debug?!1:1e3,a=function(a){return $(this).is("[data-pjax-preserve-scroll]")?!1:0},$(document).on("click","[data-pjax] a, a[data-pjax]",function(b){var c,d,e;if($(this).is("[data-skip-pjax]"))return;$(this).is("[data-pjax]")?d=this:d=$(this).closest("[data-pjax]")[0],e=a(this);if(c=$(this).closest("[data-pjax-container]")[0])return $.pjax.click(b,{container:c,scrollTo:e,fragment:"#pjax-body"})}),$(document).on("submit","form[data-pjax]",function(b){var c,d;d=a(this);if(c=$(this).closest("[data-pjax-container]")[0])return $.pjax.submit(b,{container:c,scrollTo:d,fragment:"#pjax-body"})}))}.call(this),function(){if(!$.support.pjax)return;$(document).on("pjax:start",function(a){var b;if(b=a.relatedTarget)$(b).addClass("pjax-active"),$(b).parents(".js-pjax-active").addClass("pjax-active")}),$(document).on("pjax:end",function(a){$(".pjax-active").removeClass("pjax-active")})}.call(this),function(){$(document).on("pjax:success",function(a,b){var c,d,e;c=$.parseHTML(b)[0];if(c.id==="pjax-head")return $("head [data-pjax-transient]").remove(),e=$(c).filter(":not(title, script, link[rel='stylesheet'])"),d=$(c).filter("link[rel='stylesheet']"),$(document.head).append(e.attr("data-pjax-transient",!0)),$(document.head).append(d)})}.call(this),function(){$(document).on("ajaxSuccess",".js-select-menu",function(){return $(this).menu("deactivate")}),$(document).on("ajaxSend",".js-select-menu",function(){return $(this).addClass("is-loading")}),$(document).on("ajaxComplete",".js-select-menu",function(){return $(this).removeClass("is-loading")}),$(document).on("ajaxError",".js-select-menu",function(){return $(this).addClass("has-error")}),$(document).on("menu:deactivate",".js-select-menu",function(){return $(this).removeClass("is-loading has-error")})}.call(this),function(){$(document).on("selectmenu:selected",".js-select-menu .js-navigation-item",function(){var a,b,c;a=$(this).closest(".js-select-menu"),c=$(this).find(".js-select-button-text"),c[0]&&a.find(".js-select-button").html(c.html()),b=$(this).find(".js-select-menu-item-gravatar");if(c[0])return a.find(".js-select-button-gravatar").html(b.html())})}.call(this),function(){$(document).on("filterable:change",".js-select-menu .select-menu-list",function(a){var b,c;c=$(this).find(".js-navigation-item"),c.removeClass("last-visible"),c.filter(":visible:last").addClass("last-visible"),$(this).is("[data-filterable-for]")||(b=$(a.target).hasClass("filterable-empty"),$(this).toggleClass("filterable-empty",b))})}.call(this),function(){$(document).on("menu:activated",".js-select-menu",function(){return $(this).find(".js-filterable-field").focus()}),$(document).on("menu:deactivate",".js-select-menu",function(){return $(this).find(".js-filterable-field").val("").trigger("filterable:change")})}.call(this),function(){$(document).on("navigation:open",".js-select-menu:not([data-multiple]) .js-navigation-item",function(){var a,b;b=$(this),a=b.closest(".js-select-menu"),a.find(".js-navigation-item.selected").removeClass("selected"),b.addClass("selected"),b.find("input[type=radio], input[type=checkbox]").prop("checked",!0).change(),b.fire("selectmenu:selected");if(!a.hasClass("is-loading"))return a.menu("deactivate")}),$(document).on("navigation:open",".js-select-menu[data-multiple] .js-navigation-item",function(){var a,b;return a=$(this),b=a.hasClass("selected"),a.toggleClass("selected",!b),a.find("input[type=radio], input[type=checkbox]").prop("checked",!b).change(),a.fire("selectmenu:selected")})}.call(this),function(){$(document).on("menu:activate",".js-select-menu",function(){return $(this).find(".js-navigation-container").navigation("push")}),$(document).on("menu:deactivate",".js-select-menu",function(){return $(this).find(".js-navigation-container").navigation("pop")}),$(document).on("filterable:change",".js-select-menu .select-menu-list",function(){return $(this).navigation("refocus")})}.call(this),function(){var a;$(document).on("filterable:change",".js-select-menu .select-menu-list",function(b){var c,d;if(!(d=$(this).find(".js-new-item-form")[0]))return;c=b.relatedTarget.value,c===""||a(this,c)?$(this).removeClass("is-showing-new-item-form"):($(this).addClass("is-showing-new-item-form"),$(d).find(".js-new-item-name").text(c),$(d).find(".js-new-item-value").val(c))}),a=function(a,b){var c,d,e,f,g;g=$(a).find(".js-select-button-text");for(e=0,f=g.length;e<f;e++){c=g[e],d=$.trim($(c).text().toLowerCase());if(d===b.toLowerCase())return!0}return!1}}.call(this),function(){var a;$(document).on("menu:activate",".js-select-menu",function(){var b;return b=$(this).find(".js-select-menu-tab-bucket .selected").closest(".js-select-menu-tab-bucket").attr("data-tab-filter"),a($(this),b)}),$(document).on("click",".js-select-menu .js-select-menu-tab",function(b){var c;return(c=$(this).attr("data-tab-filter"))&&a($(this).closest(".js-select-menu"),c),!1}),a=function(a,b){var c,d,e;return a.find("[data-tab-filter]").removeClass("selected"),b?(c=function(){return $(this).attr("data-tab-filter")===b},d=a.find(".js-select-menu-tab").filter(c),e=a.find(".js-select-menu-tab-bucket").filter(c)):(d=a.find(".js-select-menu-tab:first"),e=a.find(".js-select-menu-tab-bucket:first")),d.addClass("selected"),e.addClass("selected"),a.find(".js-filterable-field").trigger("filterable:change")}}.call(this),function(){}.call(this),function(){if(!$.fn.socket)return;$(document).on("visibilitychange webkitvisibilitychange mozvisibilitychange msvisibilitychange",function(){var a;if(!(a=$(document.head).find("link[rel=xhr-socket]").socket()))return;document.hidden||document.webkitHidden||document.mozHidden||document.msHidden?a.send({visibility:"hidden"}):a.send({visibility:"visible"})})}.call(this),function(){var a,b=this;a=function(){function b(){var a=this;this.onMouseMove=function(c){return b.prototype.onMouseMove.apply(a,arguments)},this.onMouseUp=function(c){return b.prototype.onMouseUp.apply(a,arguments)},this.onMouseDown=function(c){return b.prototype.onMouseDown.apply(a,arguments)},$(document).on("mousedown",".js-sortable-container .js-sortable-target",this.onMouseDown)}var a;return a=$("<li />").addClass("js-sortable-placeholder sortable-placeholder"),b.prototype.onMouseDown=function(b){return $(b.currentTarget).addClass("js-sorting").fadeTo(0,.5).css({"z-index":10,position:"absolute",top:$(b.currentTarget).position().top,left:$(b.currentTarget).position().left}).after(a),$(document).on("mousemove.sortable",this.onMouseMove),$(document).on("mouseup",this.onMouseUp),!1},b.prototype.onMouseUp=function(a){return $(".js-sorting").removeClass("js-sorting").fadeTo(0,1).css({"z-index":"",position:"",top:"",left:""}),$(".js-sortable-placeholder").remove(),$(document).off("mousemove.sortable",this.onMouseMove),$(document).off("mouseup",this.onMouseUp),!1},b.prototype.onMouseMove=function(a){var b,c,d;return b=$(".js-sorting"),d=a.pageY-b.parent().offset().top,c=$(".js-sorting").height(),d<0+c/2?$(".js-sorting").css({top:0}):d>b.parent().height()-c/2?$(".js-sorting").css({top:b.parent().height()-b.height()}):$(".js-sorting").css({top:d-c/2}),$(".js-sorting").index()<b.parent().find(".js-sortable-target").length&&$(".js-sorting").index()>=0&&($(".js-sorting").position().top>$(".js-sortable-placeholder").position().top+c*.8?($(".js-sortable-placeholder").insertAfter($(".js-sortable-placeholder").next()),$(".js-sorting").insertBefore($(".js-sortable-placeholder"))):$(".js-sorting").position().top<$(".js-sortable-placeholder").position().top-c*.8&&($(".js-sortable-placeholder").insertBefore($(".js-sortable-placeholder").prev().prev()),$(".js-sorting").insertBefore($(".js-sortable-placeholder")))),!1},b}(),new a}.call(this),function(){var a,b,c,d,e,f,g,h,i,j=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};e="[ ]",b="[x]",f=RegExp("^(?:\\s*[-+*]|(?:\\d+\\.))?\\s*("+b.replace(/([\[\]])/g,"\\$1")+"|"+e.replace(/([\[\]])/g,"\\$1")+")(?=\\s)"),a=/^`{3}(?:\s*\w+)?[\S\s].*[\S\s]^`{3}$/mg,g=RegExp("^("+b.replace(/[\[\]]/g,"\\$1")+"|"+e.replace(/[\[\]]/g,"\\$1")+").+$","g"),i=function(c,d,h){var i,k,l,m;return i=c.replace(/\r/g,"").replace(a,"").replace(g,"").split("\n"),k=0,m=function(){var a,g,m,n;m=c.split("\n"),n=[];for(a=0,g=m.length;a<g;a++)l=m[a],j.call(i,l)>=0&&l.match(f)&&(k+=1,k===d&&(l=h?l.replace(e,b):l.replace(b,e))),n.push(l);return n}(),m.join("\n")},d=function(a){if(a.find(".js-comment-field").length>0)return a.find(".task-list-item").addClass("enabled").find(".task-list-item-checkbox").attr("disabled",null),a.trigger("tasklist:enabled")},c=function(a){return a.find(".task-list-item").removeClass("enabled").find(".task-list-item-checkbox").attr("disabled","disabled"),a.trigger("tasklist:disabled")},h=function(a){var b,d,e,f,g;return d=a.closest(".js-comment"),f=
  d.find("form.js-comment-update"),e=f.find(".js-comment-field"),g=parseInt(a.attr("data-item-index")),b=a.prop("checked"),c(d),e.val(i(e.val(),g,b)),f.trigger("tasklist:updateSend",[g,b]),f.one("ajaxComplete",function(){return f.trigger("tasklist:updateComplete")}),f.submit()},$(document).on("change","input.task-list-item-checkbox[type=checkbox]",function(){return h($(this))}),$.pageUpdate(function(){return $(".js-comment").each(function(){return d($(this))})})}.call(this),function(){$(document).on("tasklist:updateSend","form.js-comment-update",function(a,b,c){var d,e,f,g,h;return f=$(this),e=f.closest(".js-comment").addClass("is-updating-task-list"),g=f.find("input[name=task_list_key]"),g.length>0||(h=f.find(".js-comment-field").attr("name").split("[")[0],g=$("<input>",{type:"hidden",name:"task_list_key",value:h}),f.append(g)),d=$("<input>",{type:"hidden",name:"task_list_checked",value:c!=null?c:{1:"0"}}),f.append(d),f.one("tasklist:updateComplete",function(){return d.remove(),e.removeClass("is-updating-task-list")})})}.call(this),function(){$(document).pageUpdate(function(){var a,b,c,d,e,f;f=$(this).find(".tooltipped");for(d=0,e=f.length;d<e;d++)b=f[d],a=$(b),c=a.hasClass("downwards")?"n":"s",c=a.hasClass("rightwards")?"w":c,c=a.hasClass("leftwards")?"e":c,c=a.hasClass("downandright")?"nw":c,a.tipsy({gravity:c});return $(this).tipsy.revalidate()})}.call(this),function(){var a,b=this;a=function(){function a(){var b=this;this.onToggle=function(c){return a.prototype.onToggle.apply(b,arguments)},this.onError=function(c){return a.prototype.onError.apply(b,arguments)},this.onSuccess=function(c){return a.prototype.onSuccess.apply(b,arguments)},this.onComplete=function(c){return a.prototype.onComplete.apply(b,arguments)},this.onBeforeSend=function(c){return a.prototype.onBeforeSend.apply(b,arguments)},this.onClick=function(c){return a.prototype.onClick.apply(b,arguments)},$(document).on("click",".js-toggler-container .js-toggler-target",this.onClick),$(document).on("ajaxBeforeSend",".js-toggler-container",this.onBeforeSend),$(document).on("ajaxComplete",".js-toggler-container",this.onComplete),$(document).on("ajaxSuccess",".js-toggler-container",this.onSuccess),$(document).on("ajaxError",".js-toggler-container",this.onError),$(document).on("toggler:toggle",".js-toggler-container",this.onToggle)}return a.prototype.onClick=function(a){return $(a.target).trigger("toggler:toggle"),!1},a.prototype.onBeforeSend=function(a){var b;return b=a.currentTarget,$(b).removeClass("success error"),$(b).addClass("loading")},a.prototype.onComplete=function(a){return $(a.currentTarget).removeClass("loading")},a.prototype.onSuccess=function(a){return $(a.currentTarget).addClass("success")},a.prototype.onError=function(a){return $(a.currentTarget).addClass("error")},a.prototype.onToggle=function(a){var b;return b=a.currentTarget,$(b).toggleClass("on")},a}(),new a}.call(this),function(){$.fn.hasDirtyFields=function(){var a,b,c,d;d=this.find("input, textarea");for(b=0,c=d.length;b<c;b++){a=d[b];if(a.value!==a.defaultValue)return!0}return!1}}.call(this),function(){$.fn.hasFocus=function(){var a,b;return(b=this[0])?(a=document.activeElement,b===a||$.contains(b,a)):!1}}.call(this),function(){var a;a=null,document.addEventListener("mousedown",function(b){a=b},!0),document.addEventListener("mouseup",function(b){a=null},!0),$.fn.hasMousedown=function(){var b,c;return(c=this[0])?a?(b=a.target,c===b||$.contains(c,b)):!1:!1}}.call(this),function(){$.fn.hasSelection=function(){var a,b,c;return(b=this[0])?(c=window.getSelection(),c&&c.type==="Range"&&c.focusNode!=null?(a=c.focusNode,b===a||$.contains(b,a)):!1):!1}}.call(this),function(){$.fn.markedAsDirty=function(){return this.find(".js-dirty").length>0}}.call(this),function(){var a,b,c,d;d=function(a,c,d){var e,f;if(!(e=$(a).attr("data-url")))return;if($(a).data("updatable-xhr"))return;return f=$.ajax({url:e,context:a,channel:c,success:function(c){return b(a,c)},error:function(){return console.error("error updating %s: %o",e,a)},complete:function(){return $(a).removeData("updatable-xhr")}}),$(a).data("updatable-xhr",f)},a=function(a){return $(a).hasDirtyFields()||$(a).hasFocus()||$(a).hasMousedown()||$(a).hasSelection()||$(a).markedAsDirty()},b=function(b,d){var e,f;if(a(b)){$(b).addClass("is-stale"),$(b).trigger("updatableContent:stale");return}return $(b).removeClass("is-stale"),f=$.parseHTML(d),e=$(f).find(".js-updatable-content-fragment"),e.length?(c(b,e),$(b).pageUpdate()):($(b).replaceWith(f),$(f).pageUpdate())},c=function(a,b){var c,d,e;for(d=0,e=b.length;d<e;d++)c=b[d],c.id?$(a).find("#"+c.id).replaceWith(c):console.error("fragment is missing id: %o",c)},$(document).on("socket:message",".js-updatable-content",function(a,b,c){if(this!==a.target)return;d(this,c,b)})}.call(this),function(){var a,b,c,d,e,f,g,h,i;if(!Modernizr.draganddrop)return;b=null,f=null,e=!1,g=function(a){var d,g;g=a.target,g!==f&&(e=c(a,f,g)),f=g,e&&a.preventDefault(),clearTimeout(b),d=function(){return e=c(a,f,null),f=null},b=setTimeout(d,100)},c=function(a,b,c){var d;return d=!0,b&&$(b).fire("drag:out",{originalEvent:a,dataTransfer:a.originalEvent.dataTransfer,relatedTarget:c}),c&&$(c).fire("drag:over",{originalEvent:a,dataTransfer:a.originalEvent.dataTransfer,relatedTarget:b},function(){return d=!1}),d},a=0,h=function(){++a===1&&$(window).on("dragover",g)},i=function(){--a===0&&$(window).off("dragover",g)},d=function(a){var b,c,d,e,f;e=this,f=a.type,c=a.relatedTarget,b=a.handleObj;if(!c||c!==e&&!$.contains(e,c))a.type=b.origType,d=b.handler.apply(this,arguments),a.type=f;return d},$.event.special["drag:out"]={setup:h,teardown:i},$.event.special["drag:over"]={setup:h,teardown:i},$.event.special["drag:enter"]={handle:d,delegateType:"drag:over",bindType:"drag:over"},$.event.special["drag:leave"]={handle:d,delegateType:"drag:out",bindType:"drag:out"}}.call(this),function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this,y=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1},z={}.hasOwnProperty,A=function(a,b){function d(){this.constructor=a}for(var c in b)z.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};e=function(){function a(){this.uploads=[],this.busy=!1}return a.prototype.upload=function(a,b){var c,d,e,f;return f=b.start||function(){},e=b.progress||function(){},c=b.complete||function(){},d=b.error||function(){},this.uploads.push({file:a,to:b.to,form:b.form||{},start:f,progress:e,complete:c,error:d}),this.process()},a.prototype.process=function(){var a,b,c,d,e,f,g=this;if(this.busy||this.uploads.length===0)return;c=this.uploads.shift(),this.busy=!0,e=new XMLHttpRequest,e.open("POST",c.to,!0),e.setRequestHeader("X-CSRF-Token",this.token()),e.onloadstart=function(a){return c.start()},e.onreadystatechange=function(a){var b;if(e.readyState===4)return e.status===204?(b=e.getResponseHeader("Location"),c.complete({href:b})):e.status===201?c.complete(JSON.parse(e.responseText)):c.error(),g.busy=!1,g.process()},e.onerror=function(a){return c.error()},e.upload.onprogress=function(a){var b;if(a.lengthComputable)return b=Math.round(a.loaded/a.total*100),c.progress(b)},a=new FormData,f=c.form;for(b in f)d=f[b],a.append(b,d);return a.append("file",c.file),e.send(a)},a.prototype.token=function(){return $('meta[name="csrf-token"]').attr("content")},a}(),d=function(){function d(a){var b=this;this.container=a,this.available=function(){return d.prototype.available.apply(b,arguments)},this.model=$(a).data("model"),this.uploadUrl="/upload/"+this.model+"s",this.policyUrl="/upload/policies/"+this.model}var a,b,c;return b=["image/gif","image/png","image/jpeg"],a=["gif","png","jpg","jpeg"],d.prototype.available=function(){return this.field&&this.field[0]!=null},d.prototype.okToUpload=function(a){return a.size<5242880&&c(a.type)},d.prototype.setup=function(a){return a()},d.prototype.start=function(a){},d.prototype.progress=function(a){},d.prototype.complete=function(a){},d.prototype.error=function(a){},d.prototype.acceptsExtension=function(b){var c;return c=b.split(".").pop(),y.call(a,c)>=0},c=function(a){return y.call(b,a)>=0},d}(),c=function(a){function c(a){var b=this;this.container=a,this.complete=function(a){return c.prototype.complete.apply(b,arguments)},c.__super__.constructor.call(this,a),this.field=$(a).siblings("ul.js-releases-field"),this.li=this.field.find("li.js-template"),this.meter=$(a).find(".js-upload-meter")}var b;return A(c,a),c.prototype.setup=function(a){return $("#release_id").val()?a():$("button.js-save-draft").trigger("click",a)},c.prototype.start=function(a){return this.meter.show()},c.prototype.progress=function(a){return this.meter.css("width",a+"%")},c.prototype.complete=function(a){var b,c,d;return c=this.li.clone(),c.removeClass("template"),c.removeClass("js-template"),b=a.asset.name||a.asset.href.split("/").pop(),c.find(".filename").val(b),a.asset.size?(d=(a.asset.size/1048576).toFixed(2),c.find(".filesize").text("("+d+"MB)")):c.find(".filesize").text(""),c.find("input[type=hidden].url").val(a.asset.href),c.find("input[type=hidden].id").val(a.asset.id),this.field.append(c),this.field.addClass("is-populated"),this.meter.hide()},c.prototype.okToUpload=function(a){return!0},b=function(a){return!0},c.prototype.acceptsExtension=function(a){return!0},c}(d),a=function(a){function b(a){var c=this;this.container=a,this.complete=function(a){return b.prototype.complete.apply(c,arguments)},b.__super__.constructor.call(this,a),this.field=$(a).find("img.js-image-field"),this.input=$(a).find("input.js-oauth-application-logo-id")}return A(b,a),b.prototype.complete=function(a){return this.field.attr("src",a.asset.href),this.input.val(a.asset.id),this.container.addClass("has-uploaded-logo")},b}(d),b=function(a){function f(a){var b=this;this.container=a,this.error=function(a){return f.prototype.error.apply(b,arguments)},this.complete=function(a){return f.prototype.complete.apply(b,arguments)},this.start=function(a){return f.prototype.start.apply(b,arguments)},f.__super__.constructor.call(this,a),this.field=$(a).find("textarea.js-comment-field")}var b,c,d,e;return A(f,a),d=function(a){return"![Uploading "+a+" . . .]()"},b=function(a){return a.replace(/(.*)\.[^.]+$/,"$1").replace(/[^\w\s:-]/g," ").replace(/\s+/g," ")},c=function(a,b){var c,d,e,f;return e=a.selectionEnd,c=a.value.substring(0,e),f=a.value.substring(e),d=a.value===""||c.match(/\n$/)?"":"\n",a.value=c+d+b+f,a.selectionStart=e+b.length,a.selectionEnd=e+b.length},e=function(a,b,c){var d,e;return $(a).data("link-replace")?a.value=c:(d=a.value.substring(0,a.selectionEnd),e=a.value.substring(a.selectionEnd),d=d.replace(b,c),e=e.replace(b,c),a.value=d+e,a.selectionStart=d.length,a.selectionEnd=d.length)},f.prototype.start=function(a){return c(this.field[0],d(a.name)+"\n")},f.prototype.complete=function(a){var c,f;return f=d(a.asset.name),c="!["+b(a.asset.name)+"]("+a.asset.href+")",e(this.field[0],f,c)},f.prototype.error=function(a){var b;return b=d(a.asset.name),e(this.field[0],b,"")},f}(d),n=["is-default","is-uploading","is-bad-file","is-failed"],p=function(a){return a.removeClass(n.join(" "))},q=function(a){return p(a),a.addClass("is-default")},w=new e,r=function(d){var e;e=new b(d),e.available()||(e=new a(d)),e.available()||(e=new c(d));if(!e||!e.available())return;return e},o=function(a,b){var c;c=r(b);if(!c||!c.okToUpload(a))return;return c.setup(function(){return i(a,c.policyUrl,function(b){var d;return c.start(a),d=j(b,c),w.upload(a,d)})})},i=function(a,b,c){return $.ajax({type:"POST",url:b,data:{name:a.name,size:a.size,content_type:a.type,repository_id:$("#release_repository_id").val(),release_id:$("#release_id").val(),team_id:$("[data-team-id]").data("team-id")},success:c})},j=function(a,b){var c,d;return c=$(b.container),d={to:a.upload_url,form:a.form,start:function(){return p(c),c.addClass("is-uploading")},progress:function(a){return b.progress(a)},complete:function(d){return $.ajax({type:"PUT",url:""+b.uploadUrl+"/"+a.asset.id}),b.complete(a),b.field.trigger("change"),q(c)},error:function(){return b.error(a),b.field.trigger("change"),p(c),c.addClass("is-failed")}}},t=function(a){var b,c,d,e;if(!a.types)return!1;e=a.types;for(c=0,d=e.length;c<d;c++){b=e[c];if(b==="Files")return!0}return!1},u=function(a){var b,c,d,e;if(!a.types)return!1;e=a.types;for(c=0,d=e.length;c<d;c++){b=e[c];if(b==="text/uri-list")return!0}return!1},v=function(a){var b,c,d,e;if(!a.types)return!1;e=a.types;for(c=0,d=e.length;c<d;c++){b=e[c];if(b==="text/plain")return!0}return!1},f=function(a,b){var c,d,e,f;f=[];for(d=0,e=a.length;d<e;d++)c=a[d],o(c,b)?f.push(void 0):(p(b),f.push(b.addClass("is-bad-file")));return f},g=function(a,b){var c,d,e,f,g,h;if(!a)return;d=r(b);if(!d.available())return;g=a.split("\r\n"),h=[];for(e=0,f=g.length;e<f;e++)c=g[e],d.acceptsExtension(c)?(d.start({name:""}),h.push(d.complete({asset:{name:"",href:c}}))):(p(b),h.push(b.addClass("is-bad-file")));return h},h=function(a,b){var c;return c=textarea(b),insertTextAtCursor(c[0],a)},k=function(a){return t(a)?"copy":u(a)?"link":v(a)?"copy":"none"},l=function(a){switch(a){case"image/gif":return"image.gif";case"image/png":return"image.png";case"image/jpeg":return"image.jpg"}},Modernizr.draganddrop&&(s=function(a){a==null&&(a=!0),$(document).off("drop.uploads dragover.uploads");if(!a)return;return $(document).on("drop.uploads",function(a){return a.preventDefault()}),$(document).on("dragover.uploads",function(a){return a.originalEvent.dataTransfer.dropEffect="none",a.preventDefault()})},m=function(a){if($(a).data("uploadable-container-installed"))return;return $(a).on("dragenter dragover",function(a){var b;return b=k(a.originalEvent.dataTransfer),a.originalEvent.dataTransfer.dropEffect=b,$(this).addClass("dragover"),!1}),$(a).on("dragleave",function(a){return a.originalEvent.dataTransfer.dropEffect="none",$(this).removeClass("dragover"),!1}),$(a).on("drop",function(b){var c;return $(this).removeClass("dragover"),c=b.originalEvent.dataTransfer,c.types?t(c)?f(c.files,$(this)):u(c)?g(c.getData("text/uri-list"),$(this)):v(c)&&h(c.getData("text/plain"),$(this)):(p($(a)),$(a).addClass("is-bad-browser")),!1}),$(a).data("uploadable-container-installed",!0)},$.pageUpdate(function(){var a,b,c,d,e;a=$(".js-uploadable-container"),s(a.length>0),e=[];for(c=0,d=a.length;c<d;c++)b=a[c],e.push(m(b));return e})),$(document).on("change",".js-manual-file-chooser",function(a){var b;return b=$(this).closest(".js-uploadable-container"),a.target.files?f(a.target.files,b):(p(b),b.addClass("is-bad-browser"))}),$(document).on("paste",".js-uploadable-container",function(a){var b,c,d,e,g;if(!(d=(e=event.clipboardData)!=null?(g=e.items)!=null?g[0]:void 0:void 0))return;if(!(c=l(d.type)))return;return b=d.getAsFile(),b.name=c,f([b],this),a.preventDefault()})}.call(this),function(){var a;a=function(b){var c,d,e,f,g;c=$(b);if(c.is("form")){g=b.elements;for(e=0,f=g.length;e<f;e++){d=g[e];if(!a(d))return!1}return!0}return c.is("input[required], textarea[required]")&&$.trim(c.val())===""?!1:!0},$(document).on("focusin","input[required], textarea[required]",function(){var b,c;return c=a(this),b=function(b){var d;d=a(this),d!==c&&$(this).trigger("validation:field:change",[d]),c=d},$(this).on("textchange",b),$(this).on("blur",function(){return $(this).off("textchange",b)})}),$(document).on("validation:field:change","form",function(b){var c;return c=a(this),$(this).trigger("validation:change",[c])}),$(function(){var b,c,d,e;e=$("input[required], textarea[required]");for(c=0,d=e.length;c<d;c++)b=e[c],$(b).trigger("validation:field:change",[a(b)])}),$(document).on("validation:change","form",function(a,b){return $(this).find("button[data-disable-invalid]").prop("disabled",!b)})}.call(this),function(){$(document).on("ajaxSuccess",function(a,b){var c;if(c=b.getResponseHeader("X-XHR-Location"))document.location.href=c,a.stopImmediatePropagation()})}.call(this),ZeroClipboard.setDefaults({moviePath:"https://a248.e.akamai.net/assets.github.com/flash/ZeroClipboard.swf",trustedDomains:"github.com",allowScriptAccess:"always"});if(typeof console=="undefined"||typeof console.log=="undefined")window.console={log:function(){}};window.debug=function(){},window.GitHub.assetHostUrl="https://a248.e.akamai.net/assets.github.com",$.ajaxPoll.version="2",$.fn.spin=function(){return debug("$.fn.spin is DEPRECATED"),this.after('<img src="'+GitHub.Ajax.spinner+'" id="spinner" width="16" />')},$.fn.stopSpin=function(){return debug("$.fn.stopSpin is DEPRECATED"),$("#spinner").remove(),this},GitHub.Ajax={spinner:"https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-32.gif",error:"https://a248.e.akamai.net/assets.github.com/images/modules/ajax/error.png"},$(function(){function b(){$("#facebox .shortcuts:visible").length?$.facebox.close():($(document).one("reveal.facebox",function(){$(".js-see-all-keyboard-shortcuts").click(function(){return $(this).remove(),$("#facebox .js-hidden-pane").show(),!1})}),$.facebox({div:"#keyboard_shortcuts_pane",ajax:"/site/keyboard_shortcuts?url="+window.location.pathname},"shortcuts"))}function c(){$("#facebox .cheatsheet:visible").length?$.facebox.close():$.facebox({div:"#markdown-help",ajax:"/site/markdown_cheatsheet"},"cheatsheet")}var a=new Image;a.src=GitHub.Ajax.spinner,$(".cards_select").cardsSelect({type_field:"credit_card_type"}),$(document).bind("reveal.facebox",function(){$(".cards_select").cardsSelect(),$("#facebox .content").fire("pageUpdate")}),$(".flash .close").click(function(){$(this).closest(".flash").fadeOut(300,function(){$(this).remove(),$(".flash-messages .close").length==0&&$(".flash-messages").remove()})}),$(".js-date-input").date_input(),$(document).on("keypress",function(a){if($(a.target).is(":input"))return;if(a.which===63)return b(),!1}),$(".home-signup input").placeholder(),$(document).on("keydown",function(a){if(a.hotkey!=="m"||$(a.target).is(":input"))return;return c(),!1}),$(".gfm-help").click(function(a){a.preventDefault(),c()})}),$.pageUpdate(function(){$(this).find("a[rel*=facebox]").each(function(){if($(this).data("facebox-installed"))return;$(this).facebox(),$(this).data("facebox-installed",!0)}),$(this).find(".js-entice").each(function(){$(this).enticeToAction({title:$(this).attr("data-entice")})})}),$.extend($.facebox.settings,{loadingImage:"https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-64.gif",closeHTML:'<span class="mini-icon mini-icon-remove-close"></span>',closeImage:""}),$(document).on("click","a.js-lineprof-file",function(){return $(this).next("div").toggle(),!1}),$(function(){$("#line-profile").length&&$.facebox({div:"#line-profile"},"full")}),function(){$.pageUpdate(function(){var a,b,c;if(!$("#menu-about").length)return;a=$(".js-github-jobs");if(!a.length)return;return $(".js-github-jobs").hasClass("loading")||(a.addClass("loading"),$.getJSON(a.data("url"),function(a){var d,e,f,g;if(a.length===0)return c();g=[];for(e=0,f=a.length;e<f;e++)d=a[e],g.push(b(d));return g}).error(function(a,b,c){return $(".js-github-jobs .jobs").html("Had a problem pulling in our jobs. Sorry!")})),b=function(a){var b;return b=a.description.split("\n")[0],$(".js-github-jobs .jobs").append('      <li>        <h3><a href="'+a.url+'">'+a.title+"</a></h3>        <p>"+b+"</p>        <hr />      </li>    ")},c=function(){return $(".js-github-jobs .jobs").html("<p>We haven't posted any jobs lately. Check back later, though!</p>")}})}.call(this),function(){$(function(){var a;return $(document).on("click",".section-head",function(b){var c;return c=$(b.currentTarget).next(".section-nav"),a.expand(c)}),a={collapse:function(a){return a.slideUp(200),a.addClass("collapsed")},expand:function(b){var c,d,e,f;d=$(".section-nav");for(e=0,f=d.length;e<f;e++)c=d[e],a.collapse($(c));return b.slideDown(200),b.removeClass("collapsed")}}})}.call(this),function(){var a,b,c,d,e,f;(e=window._gaq)==null&&(window._gaq=[]),_gaq.push(["_setAccount","UA-3769691-2"]),_gaq.push(["_setDomainName","none"]),_gaq.push(["_trackPageview"]),_gaq.push(["_trackPageLoadTime"]),document.title==="404 - GitHub"&&(d=document.location.pathname+document.location.search,a=document.referrer,_gaq.push(["_trackPageview","/404.html?page="+d+"&from="+a])),b=document.createElement("script"),b.type="text/javascript",b.async=!0,c=document.location.protocol==="https:"?"https://ssl":"http://www",b.src=""+c+".google-analytics.com/ga.js",document.getElementsByTagName("head")[0].appendChild(b),(f=window._gauges)==null&&(window._gauges=[]),window.location.pathname.match(/\/blog/)===null&&$(function(){var a,b;return a=document.createElement("script"),a.type="text/javascript",a.async=!0,a.id="gauges-tracker",a.setAttribute("data-site-id","4f5634b5613f5d0429000010"),a.src="https://secure.gaug.es/track.js",b=document.getElementsByTagName("script")[0],b.parentNode.insertBefore(a,b)})}.call(this),$(function(){$.hotkeys({y:function(){var a=$("link[rel='permalink']").attr("href"),b=$("title");a&&(a+=location.hash,window.location.href=a)}})}),function(){$(document).on("focusin","#js-command-bar-field",function(){var a;return a=$(this),a.data("command-bar-installed")?a.closest(".command-bar").addClass("command-bar-focus"):(a.commandBar().data("command-bar-installed",!0),setTimeout(function(){return a.focus()},20))}),$(document).on("focusout","#js-command-bar-field",function(){return $(this).closest(".command-bar").removeClass("command-bar-focus")}),$(document).on("mousedown",".commandbar .display",function(){return!1}),$(document).on("mousedown",".command-bar-focus #advanced_search",function(){return!1}),$(document).on("click",".js-command-bar .help",function(){var a;return a=$("#js-command-bar-field").focus(),$(".tipsy").hide(),setTimeout(function(){return a.val("help"),a.trigger("execute.commandbar")},250),!1}),$(document).ready(function(){return $(".launch #js-command-bar-field").focus()})}.call(this),function(){var a,b,c,d=[].slice,e=this;b=function(a){return a.replace(/^\s+|\s+$/g,"")},c=function(a){return a.replace(/^\s+/g,"")},a=function(){function a(a){this.defaultContext=a,this.callbacks={}}return a.prototype.bind=function(a,b){var c,d,e,f,g;g=a.split(" ");for(e=0,f=g.length;e<f;e++)c=g[e],(d=this.callbacks)[c]||(d[c]=[]),this.callbacks[c].push(b);return this},a.prototype.trigger=function(){var a,b,c,e,f,g;e=arguments[0],a=2<=arguments.length?d.call(arguments,1):[],c=this.callbacks[e];if(!c)return!0;for(f=0,g=c.length;f<g;f++){b=c[f];if(b.apply(this.context,a)===!1)return!1}return!0},a.prototype.unbind=function(a,b){var c,d,e,f,g;if(a)if(b){c=this.callbacks[a];for(e=f=0,g=c.length;f<g;e=++f){d=c[e];if(d!==b)continue;c.splice(e,1);break}}else delete this.callbacks[a];else this.callbacks={};return this},a.prototype.execute=function(a){return(new this.defaultContext(this,a)).fullMatch().execute()},a.prototype.suggestions=function(a,b){return(new this.defaultContext(this,a)).partialMatch().suggestions().slice(0,b)},a.prototype.complete=function(b,c){var d;return d=(new this.defaultContext(this,b)).partialMatch(),a.Store.set(""+d.constructor.name+":"+b,c),d.complete(c)},a}(),a.Store=function(){function b(){}var a;return a=function(){try{return"localStorage"in window&&window.localStorage!==null}catch(a){return!1}},b.set=function(b,c){if(!a())return;try{return localStorage.setItem(b,JSON.stringify(c)),c}catch(d){return!1}},b.get=function(b){return a()?this.parse(localStorage[b]):null},b.parse=function(a){try{return JSON.parse(a)}catch(b){return a}},b.expire=function(b){var c;if(!a())return;return c=localStorage[b],localStorage.removeItem(b),c},b}(),a.RemoteProxy=function(){function a(){}return a.caches={},a.requests={},a.get=function(a,b,c){var d,e,f=this;return this.commandBar=c,(e=b.cache_for)==null&&(b.cache_for=36e5),d=(new Date).getTime()-b.cache_for,this.shouldLoad=function(a){return this.isCached(a)?this.caches[a].requested<d?!0:!1:!0},this.shouldLoad(a)?(this.isLoading(a)||(this.requests[a]=$.ajax({url:a,dataType:b.dataType||"json",success:function(c){return f.caches[a]={response:b.process(c),requested:(new Date).getTime()}},error:function(b,c,d){return f.caches[a]={response:[],requested:(new Date).getTime()}},complete:function(){var b;return delete f.requests[a],(b=f.commandBar)!=null?b.trigger("suggest.commandbar"):void 0}})),this.isCached(a)?this.caches[a].response:[{command:"",description:b.loadingMessage,type:"loading"}]):this.caches[a].response},a.isLoading=function(a){return this.requests[a]!=null},a.isCached=function(a){return this.caches[a]!=null},a}(),a.Timer=function(){function a(){this.time=(new Date).getTime(),this}return a.prototype.diff=function(){var a,b;return b=(new Date).getTime(),a=b-this.time,this.time=b,a},a}(),a.History=function(){function f(){}var c,d,e;return e=[],d=function(){return a.Store.set("commandbar.history",e.slice(0,50).join("\n"))},c=function(a){var c,d,f,g;d=[];for(f=0,g=e.length;f<g;f++)c=e[f],b(c)!==b(a)&&d.push(c);return e=d},f.load=function(){var b;return b=a.Store.get("commandbar.history"),e=b!=null?b.split("\n"):[]},f.add=function(a){return c(a),e.unshift(a),d()},f.get=function(a){return e[a]},f.exists=function(a){return e[a]!=null},f}.call(this),a.History.load(),a.Context=function(){function d(a,b,c){var e=this;this.commandBar=a,this.text=b,this.parent=c,this.lazyLoad=function(a,b){return d.prototype.lazyLoad.apply(e,arguments)},this.suggestionCollection=function(){return d.prototype.suggestionCollection.apply(e,arguments)},this.matches=this.text.match(this.constructor.regex),this.remainder=this.matches?this.text.replace(this.matches[0],""):this.text}return d.contexts=[],d.register=function(a){return this.contexts.push(a)},d.regex=/(?:)/i,d.matches=function(a){return!!a.match(this.regex)},d.help=function(){return{}},d.prototype.suffix=function(){return" "},d.prototype.suggestionOptions=function(){return[]},d.prototype.filter=function(c){var d,e,f,g,h;f=b(this.remainder),d=[];for(g=0,h=c.length;g<h;g++)e=c[g],e=a.SuggestionCollection.prepare(e),e.score=e.defaultScore||a.SuggestionCollection.score(e,f,this),e.score!==0&&d.push(e);return d.sort(function(a,b){return b.score-a.score})},d.prototype.suggestionCollection=function(){var a,b,c,d,e,f,g,h,i,j;d=[],c=[],j=this.constructor.contexts;for(f=0,h=j.length;f<h;f++)a=j[f],e=(new a(this.commandBar,this.remainder,this)).suggestionOptions(),e=this.filter(e),e.length!==0&&c.push({suggestions:e});for(g=0,i=c.length;g<i;g++)b=c[g],d=d.concat(b.suggestions.slice(0,Math.round(12/c.length)));return d},d.prototype.suggestions=function(){var a;return a=this.suggestionCollection(),a.sort(function(a,b){return b.score-a.score}),a},d.prototype.fullMatch=function(a){var c,d,e,f,g,h,i;a==null&&(a=this.remainder),d=this;if(b(a)==="")f=this;else{i=this.constructor.contexts;for(g=0,h=i.length;g<h;g++){c=i[g];if(!c.skipMatch&&c.matches(a)){e=(new c(this.commandBar,a,this)).fullMatch();if(e)return e}}}return f||d},d.prototype.partialMatch=function(){var a,b,d,e,f,g,h;b=this;if(this.remainder.length){h=this.constructor.contexts;for(f=0,g=h.length;f<g;f++){a=h[f];if(a.matches(this.remainder)){d=(new a(this.commandBar,c(this.remainder),this)).partialMatch();if(d)return d}}}else e=this.parent;return e||b},d.prototype.description=function(){return"Execute `"+this.command()+"`"},d.prototype.command=function(){return this.parent?b(""+this.parent.command()+" "+this.matches[0]):""},d.prototype.complete=function(a){var b;return b=this.fullMatch(a),(b!=null?b.command():void 0)+b.suffix()},d.prototype.lazyLoad=function(b,c){return a.RemoteProxy.get(b,c,this.commandBar)},d.prototype.loading=function(a){return this.commandBar.trigger("loading.commandbar",a)},d.prototype.success=function(a){return this.commandBar.trigger("success.commandbar",a)},d.prototype.error=function(a){return this.commandBar.trigger("error.commandbar",a)},d.prototype.message=function(a){return this.commandBar.trigger("message.commandbar",a)},d.prototype.goToUrl=function(b){var c;if(!a.ctrlKey&&!a.metaKey)return window.location=b;c=window.open(b,(new Date).getTime());if(c!==window)return this.success("Opened in a new window")},d.prototype.post=function(a){return a=$.extend(a,{type:"POST"}),$.ajax(a)},d.prototype.getPageInfo=function(){var a,b,c;return this.info?this.info:(this.info={},b=$(".js-repository-name-with-owner"),b.length&&(a=$(".js-repository-branch"),c=$(".js-repository-tree-sha"),this.info.repo={name_with_owner:b.val(),branch:a.val(),tree_sha:c.val()}),this.info)},d.prototype.execute=function(){},d}(),a.SuggestionCollection={constructor:function(a){this.suggestions=a},prepare:function(a){return{prefix:a.prefix||"",search:a.search||null,command:a.command||"",display:a.display||a.command,description:a.description||"",type:a.type||"choice",multiplier:a.multiplier||1,defaultScore:a.defaultScore||null,filter:a.filter===!1?!1:!0}},score:function(b,c,d){var e,f,g;return f=0,b.filter===!1?f=1:b.type!=="loading"?(e=a.Store.get(""+d.constructor.name+":"+c),e===b.command?f=1.99:(g=b.search?b.search:b.command,f=c?fuzzyScore(g,c):1,f*=b.multiplier)):f=-3,f}},window.CommandBar=a}.call(this),function(){CommandBar.Context.prototype.execute=function(){return $.trim(this.text)===""?!1:(this.loading("Searching for '"+this.text+"'"),this.commandBar.trigger("submit.commandbar"))}}.call(this),function(){var a,b={}.hasOwnProperty,c=function(a,c){function e(){this.constructor=a}for(var d in c)b.call(c,d)&&(a[d]=c[d]);return e.prototype=c.prototype,a.prototype=new e,a.__super__=c.prototype,a};a=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return c(b,a),b.contexts=[],b.regex=/(help|\?)/i,b.prototype.suggestionOptions=function(){return this.text.match(/^[h\?]/i)?[{command:"help",description:"Show available commands",prefix:'<span class="mini-icon mini-icon-help"></span>',search:"help ?"}]:[]},b.prototype.description=function(){return"Show available commands"},b.prototype.helpMessagesFor=function(a){var b,c,d,e,f,g;e=this,d=[];for(f=0,g=a.length;f<g;f++)b=a[f],c=b.help(),c.constructor===Array?d=d.concat(c):(b.contexts.length&&(c.children=e.helpMessagesFor(b.contexts)),d.push(c));return d},b.prototype.formatCommands=function(a){var b;return b="<table>",b+=this.messageRows(a),b+="</table>",b},b.prototype.messageRows=function(a,b){var c,d,e,f;d="",b||(b=""),a=a.sort(function(a,b){return a.command>b.command?1:-1});for(e=0,f=a.length;e<f;e++){c=a[e];if(c.child!==!0||b!=="")d+=this.messageRow(c,b);c.children&&(d+=this.messageRows(c.children,""+b+c.command+" "))}return d},b.prototype.messageRow=function(a,b){var c;return c="",a.description?(c+="<tr><td class=command>",c+=""+b+"<strong>"+a.command+"</strong>",c+="</td><td><span>"+a.description+"</span></td></tr>"):""},b.prototype.execute=function(){var a;return a=[],a=a.concat(this.helpMessagesFor(this.commandBar.defaultContext.contexts)),this.message(this.formatCommands(a))},b}(CommandBar.Context),CommandBar.Context.register(a)}.call(this),function(){var a,b,c,d,e,f,g,h,i={}.hasOwnProperty,j=function(a,b){function d(){this.constructor=a}for(var c in b)i.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};a=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/^my/i,b.help=function(){return{command:"my"}},b.prototype.suggestionOptions=function(){return[{command:"my",description:"Dashboard, settings, and more"}]},b.prototype.description=function(){return"View your dashboard"},b.prototype.helpText=function(){return{command:"my",description:"View your dashboard, settings, and notifications"}},b.prototype.execute=function(){return this.loading("Loading your dashboard"),this.goToUrl("/?source=c")},b}(CommandBar.Context),b=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/dashboard/i,b.help=function(){return{command:"dashboard",description:"Go to your dashboard"}},b.prototype.suggestionOptions=function(){return[{command:"dashboard",description:"View your dashboard"}]},b.prototype.description=function(){return"View your dashboard"},b.prototype.execute=function(){return this.loading("Loading your dashboard"),this.goToUrl("/?source=c")},b}(CommandBar.Context),f=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/pulls/i,b.help=function(){return{command:"pulls",description:"View your pull requests"}},b.prototype.suggestionOptions=function(){return[{command:"pulls",description:"View your pull requests"}]},b.prototype.description=function(){return"View your pull requests"},b.prototype.execute=function(){return this.loading("Loading your pull requests"),this.goToUrl("/dashboard/pulls?source=c")},b}(CommandBar.Context),c=function(a){function b(){return b.__super__.constructor
  .apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/issues/i,b.help=function(){return{command:"issues",description:"View your issues"}},b.prototype.suggestionOptions=function(){return[{command:"issues",description:"View your issues"}]},b.prototype.description=function(){return"View your issues"},b.prototype.execute=function(){return this.loading("Loading your issues"),this.goToUrl("/dashboard/issues?source=c")},b}(CommandBar.Context),h=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/stars/i,b.help=function(){return{command:"stars",description:"View your starred repositories"}},b.prototype.suggestionOptions=function(){return[{command:"stars",description:"View your starred repositories"}]},b.prototype.description=function(){return"View your starred repositories"},b.prototype.execute=function(){return this.loading("Loading your starred repositories"),this.goToUrl("/stars?source=c")},b}(CommandBar.Context),e=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/profile/i,b.help=function(){return{command:"profile",description:"View your public user profile"}},b.prototype.suggestionOptions=function(){return[{command:"profile",description:"View your public user profile"}]},b.prototype.description=function(){return"View your public user profile"},b.prototype.execute=function(){var a;return this.loading("Loading your profile"),a=$("#js-command-bar-field").attr("data-username"),this.goToUrl("/"+a+"?source=cm")},b}(CommandBar.Context),g=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/settings/i,b.help=function(){return{command:"settings",description:"View or edit your account settings"}},b.prototype.suggestionOptions=function(){return[{command:"settings",description:"View or edit your account settings"}]},b.prototype.description=function(){return"View or edit your account settings"},b.prototype.execute=function(){return this.loading("Loading your settings"),this.goToUrl("/settings?source=c")},b}(CommandBar.Context),d=function(a){function b(){return b.__super__.constructor.apply(this,arguments)}return j(b,a),b.contexts=[],b.regex=/notifications/i,b.help=function(){return{command:"notifications",description:"View your notifications"}},b.prototype.suggestionOptions=function(){return[{command:"notifications",description:"View all your notifications"}]},b.prototype.description=function(){return"View all your notifications"},b.prototype.execute=function(){return this.loading("Loading your notifications"),this.goToUrl("/notifications?source=c")},b}(CommandBar.Context),CommandBar.Context.register(a),a.register(b),a.register(f),a.register(c),a.register(h),a.register(e),a.register(g),a.register(d)}.call(this),function(){var a,b,c,d,e,f,g,h,i,j=this,k={}.hasOwnProperty,l=function(a,b){function d(){this.constructor=a}for(var c in b)k.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=function(a){function b(){var a=this;return this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/^([\w\._-]+\/[\w\._-]+)/i,b.help=function(){return{command:"user/repo",description:"View a repository"}},b.prototype.repo=function(){if(this.matches)return this.matches[1]},b.prototype.suggestionOptions=function(){var a,b,c;if(!this.remainder.match(/^[\w\._-]/i))return[];a=[],a=this.lazyLoad("/command_bar/repos",{loadingMessage:"Loading repositories",process:function(a){return a.results}});if(c=this.text.match(/([\w\._-]+)\//i))b=c[1],a=this.lazyLoad("/command_bar/repos_for/"+b,{loadingMessage:"Loading repositories for "+b,process:function(a){return a.repositories}});return a},b.prototype.description=function(){return"Go to "+this.repo()},b.prototype.helpText=function(){return{command:"user/repo",description:"View user/repo, manage issues, etc."}},b.prototype.execute=function(){return this.loading("Loading "+this.repo()),this.goToUrl("/"+this.repo()+"?source=cr")},b}(CommandBar.Context),b=function(a){function b(){var a=this;return this.suffix=function(){return b.prototype.suffix.apply(a,arguments)},this.execute=function(){return b.prototype.execute.apply(a,arguments)},this.branch=function(){return b.prototype.branch.apply(a,arguments)},this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/@([\w-_\/]+)?/i,b.help=function(){return{child:!0,command:"@branchname",description:"View a branch in a repository"}},b.prototype.repo=function(){if(this.parent.repo)return this.parent.repo();if(this.getPageInfo().repo)return this.getPageInfo().repo.name_with_owner},b.prototype.suggestionOptions=function(){var a;return a=this.text,this.repo()?!!this.text.match(/^\s@/i)||this.repo()?this.lazyLoad("/command_bar/"+this.repo()+"/branches",{loadingMessage:"Loading "+this.repo()+"'s  branches",process:function(a){return a.results}}):[{command:"@branchname",description:"View a branch in a repository"}]:[]},b.prototype.branch=function(){if(this.matches)return this.matches[1]},b.prototype.description=function(){return"Show branch `"+this.branch()+"` for "+this.repo()},b.prototype.execute=function(){return!this.repo()||!this.branch()?!0:(this.loading("Loading "+this.repo()+":"+this.branch()+" branch"),this.goToUrl("/"+this.repo()+"/tree/"+this.branch()+"?source=cb"))},b.prototype.suffix=function(){return""},b}(CommandBar.Context),c=function(a){function b(){var a=this;return this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.skipMatch=!0,b.regex=/([\w-_\/]+)?/i,b.prototype.repo=function(){if(this.getPageInfo().repo)return this.getPageInfo().repo.name_with_owner},b.prototype.suggestionOptions=function(){var a;return a=this.text,this.repo()?!!this.text.match(/^\s@/i)||this.repo()?this.lazyLoad("/command_bar/"+this.repo()+"/branches",{loadingMessage:"Loading "+this.repo()+"'s  branches",process:function(a){return a.results}}):[{command:"@branchname",description:"View a branch in a repository"}]:[]},b}(CommandBar.Context),e=function(a){function b(){var a=this;return this.execute=function(){return b.prototype.execute.apply(a,arguments)},this.issue=function(){return b.prototype.issue.apply(a,arguments)},this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/\#\s?(\d+)?/i,b.timeout=null,b.previous_term=null,b.last_suggested=null,b.search_delay=400,b.help=function(){return{child:!0,command:"#123",description:"View a specific issue"}},b.prototype.repo=function(){if(this.parent.repo)return this.parent.repo();if(this.getPageInfo().repo)return this.getPageInfo().repo.name_with_owner},b.prototype.searchDelayPassed=function(){return(new Date).getTime()-this.constructor.last_suggested>=this.constructor.search_delay},b.prototype.suggestionOptions=function(){var a,b,c;return c=this.text,c.match(/^\s?[\#\d\w\._-]/i)?this.repo()?(b=this.constructor.previous_term,clearTimeout(this.constructor.timeout),this.constructor.previous_term=c,c===b&&this.searchDelayPassed()?this.lazyLoad("/command_bar/"+this.repo()+"/issues?q="+c,{loadingMessage:"Loading "+this.repo()+"'s issues",process:function(a){return a.results}}):(this.constructor.last_suggested=(new Date).getTime(),a=this.commandBar,this.constructor.timeout=setTimeout(function(){return a.trigger("suggest.commandbar")},this.constructor.search_delay),[])):this.lazyLoad("/command_bar/issues",{loadingMessage:"Loading issues",process:function(a){return a.results}}):[]},b.prototype.suffix=function(){return""},b.prototype.issue=function(){return this.matches?this.matches[1]:""},b.prototype.description=function(){return"Show issue #"+this.issue()+" for "+this.repo()},b.prototype.execute=function(){return this.loading("Loading issue #"+this.issue()+" for "+this.repo()),this.goToUrl("/"+this.repo()+"/issues/"+this.issue()+"?source=c")},b}(CommandBar.Context),a=function(a){function b(){var a=this;return this.suffix=function(){return b.prototype.suffix.apply(a,arguments)},this.filename=function(){return b.prototype.filename.apply(a,arguments)},this.fullpath=function(){return b.prototype.fullpath.apply(a,arguments)},this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/\/([\w\_\-\.]+\/?)+/i,b.timeout=null,b.previous_term=null,b.last_suggested=null,b.search_delay=400,b.help=function(){return{child:!0,command:"/path/to/file.s",description:"View a blob page"}},b.prototype.repo=function(){if(this.parent.repo)return this.parent.repo();if(this.getPageInfo().repo)return this.getPageInfo().repo.name_with_owner},b.prototype.searchDelayPassed=function(){return(new Date).getTime()-this.constructor.last_suggested>=this.constructor.search_delay},b.prototype.fullpath=function(){if(this.matches)return this.matches[0]},b.prototype.filename=function(){if(this.matches)return this.matches[1]},b.prototype.suggestionOptions=function(){var a,b,c,d;return d=this.text,d.match(/^[\/\w\._-]/i)?this.repo()?(c=this.getPageInfo().repo.tree_sha,c===""?[]:(b=this.constructor.previous_term,clearTimeout(this.constructor.timeout),this.constructor.previous_term=d,d===b&&this.searchDelayPassed()?this.lazyLoad("/command_bar/"+this.repo()+"/paths?q="+d+"&sha="+c,{loadingMessage:"Loading "+this.repo()+"'s  files",process:function(a){return a.results}}):(this.constructor.last_suggested=(new Date).getTime(),a=this.commandBar,this.constructor.timeout=setTimeout(function(){return a.trigger("suggest.commandbar")},this.constructor.search_delay),[]))):[]:[]},b.prototype.suffix=function(){return""},b.prototype.execute=function(){var a;return a=this.getPageInfo(),a.repo?(this.loading("Loading "+this.filename()),this.goToUrl("/"+this.repo()+"/blob/"+a.repo.branch+this.fullpath()+"?source=c")):null},b}(CommandBar.Context),i=function(a){function b(){var a=this;return this.execute=function(){return b.prototype.execute.apply(a,arguments)},this.section=function(){return b.prototype.section.apply(a,arguments)},this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/(wiki|graphs|network|admin)/i,b.help=function(){return(new this(this.commandBar,"")).suggestionOptions()},b.prototype.repo=function(){return this.parent.repo()},b.prototype.section=function(){if(this.matches)return this.matches[1]},b.prototype.suggestionOptions=function(){return[{command:"wiki",description:"Pull up the wiki"},{command:"graphs",description:"All the Graphs!"},{command:"network",description:"See the network"},{command:"admin",description:"Manage this repo"}]},b.prototype.description=function(){return"View the "+this.section()+" for "+this.repo()},b.prototype.execute=function(){return this.loading("Loading "+this.section()+" for "+this.repo()),this.goToUrl("/"+this.repo()+"/"+this.section()+"?source=c")},b}(CommandBar.Context),f=function(a){function b(){var a=this;return this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/issues/i,b.help=function(){return{command:"issues",description:"List issues for a repository"}},b.prototype.repo=function(){return this.parent.repo()},b.prototype.suggestionOptions=function(){return[{command:"issues",description:"List, show, and create issues"}]},b.prototype.description=function(){return"View issues for "+this.repo()},b.prototype.helpText=function(){return{command:""+this.repo()+" issues",description:"List issues, show a specific issue, new issue"}},b.prototype.execute=function(){return this.loading("Loading issues for "+this.repo()),this.goToUrl("/"+this.repo()+"/issues?source=c")},b}(CommandBar.Context),g=function(a){function b(){var a=this;return this.execute=function(){return b.prototype.execute.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/new/i,b.help=function(){return{command:"new",description:"Create a new issue"}},b.prototype.suggestionOptions=function(){return[{command:"new",description:"Create new issue"}]},b.prototype.description=function(){return"Create a new issue for "+this.repo()},b.prototype.execute=function(){return this.loading("Loading new issue form for "+this.repo()),this.goToUrl("/"+this.repo()+"/issues/new?source=c")},b}(f),h=function(a){function b(){var a=this;return this.execute=function(){return b.prototype.execute.apply(a,arguments)},this.repo=function(){return b.prototype.repo.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return l(b,a),b.contexts=[],b.regex=/pull(?:s|-requests)/i,b.help=function(){return{command:"pulls",description:"View pull requests"}},b.prototype.suggestionOptions=function(){return[{command:"pulls",description:"Show open pull requests"}]},b.prototype.repo=function(){return this.parent.repo()},b.prototype.description=function(){return"Show pull requests for "+this.repo()},b.prototype.execute=function(){return this.loading("Loading pulls for "+this.repo()),this.goToUrl("/"+this.repo()+"/pulls?source=c")},b}(CommandBar.Context),CommandBar.Context.register(d),CommandBar.Context.register(c),CommandBar.Context.register(a),CommandBar.Context.register(e),d.register(e),d.register(f),d.register(b),d.register(a),d.register(i),d.register(h)}.call(this),function(){var a,b,c=this,d={}.hasOwnProperty,e=function(a,b){function e(){this.constructor=a}for(var c in b)d.call(b,c)&&(a[c]=b[c]);return e.prototype=b.prototype,a.prototype=new e,a.__super__=b.prototype,a};b=function(a){function b(){var a=this;return this.suffix=function(){return b.prototype.suffix.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return e(b,a),b.contexts=[],b.regex=/search github for '(.+)'/i,b.prototype.query=function(){if(this.matches)return $.trim(this.matches[1])},b.prototype.suggestionOptions=function(){return[{command:"Search GitHub for '"+this.text+"'",description:"",multiplier:0,defaultScore:-2}]},b.prototype.description=function(){return"Search GitHub for "+this.query()},b.prototype.execute=function(){return this.loading("Searching for '"+this.query()+"'"),this.goToUrl("/search?q="+this.query()+"&source=c")},b.prototype.suffix=function(){return""},b}(CommandBar.Context),a=function(a){function b(){var a=this;return this.suffix=function(){return b.prototype.suffix.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return e(b,a),b.contexts=[],b.regex=/search ([\w\._-]+\/[\w\._-]+) for '(.+)'/i,b.prototype.query=function(){if(this.matches)return $.trim(this.matches[2])},b.prototype.repomatch=function(){if(this.matches)return $.trim(this.matches[1])},b.prototype.suggestionOptions=function(){var a;return a=this.getPageInfo(),a.repo?[{command:"Search "+a.repo.name_with_owner+" for '"+this.text+"'",description:"",multiplier:0,defaultScore:-1}]:[]},b.prototype.description=function(){return"Search GitHub for "+this.query()},b.prototype.execute=function(){return this.loading("Searching for '"+this.query()+"'"),this.goToUrl("/"+this.repomatch()+"/search?q="+this.query()+"&source=c")},b.prototype.suffix=function(){return""},b}(CommandBar.Context),CommandBar.Context.register(b),CommandBar.Context.register(a)}.call(this),function(){var a,b=this,c={}.hasOwnProperty,d=function(a,b){function e(){this.constructor=a}for(var d in b)c.call(b,d)&&(a[d]=b[d]);return e.prototype=b.prototype,a.prototype=new e,a.__super__=b.prototype,a};a=function(a){function b(){var a=this;return this.suffix=function(){return b.prototype.suffix.apply(a,arguments)},this.user=function(){return b.prototype.user.apply(a,arguments)},b.__super__.constructor.apply(this,arguments)}return d(b,a),b.contexts=[],b.regex=/^@([A-Za-z0-9-_]+)\/?/i,b.help=function(){return{command:"@user",description:"View a user&rsquo;s profile"}},b.matches=function(a){var b;return b=a.match(this.regex),!!b&&!b[0].match(/\/$/)},b.prototype.suggestionOptions=function(){return this.remainder.match(/^[@\w\._-]/i)?this.lazyLoad("/command_bar/users",{loadingMessage:"Loading users",process:function(a){return a.results}}):[]},b.prototype.user=function(){if(this.matches)return this.matches[1]},b.prototype.suffix=function(){return""},b.prototype.execute=function(){return this.loading("Loading "+this.user()+"'s profile"),this.goToUrl("/"+this.user()+"?source=c")},b}(CommandBar.Context),CommandBar.Context.register(a)}.call(this),function(){window.stringDistance=function(a,b){var c,d,e,f,g,h,i,j,k,l,m;j=[a,b].sort(function(a,b){return b.length-a.length}),a=j[0],b=j[1],d=a.length,i=b.length,h=[],h[0]=[];for(e=k=0;0<=i?k<=i:k>=i;e=0<=i?++k:--k)h[0][e]=e;for(f=l=1;1<=d?l<=d:l>=d;f=1<=d?++l:--l){h[f]=[],h[f][0]=f;for(g=m=1;1<=i?m<=i:m>=i;g=1<=i?++m:--m)c=a.charAt(f-1)===b.charAt(g-1)?0:1,h[f][g]=Math.min(h[f-1][g]+1,h[f][g-1]+1,h[f-1][g-1]+c)}return h[d][i]},window.fuzzyScore=function(a,b){var c,d,e,f,g,h,i,j,k,l;a=a.toLowerCase(),b=b.toLowerCase(),f="",l=b.split("");for(j=0,k=l.length;j<k;j++)i=l[j],f+=i.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")+".*?";g=new RegExp("("+f+")","g"),h=0;if(e=a.match(g))c=stringDistance(a,b),c===0?h=1:(h=.4*(1/e[0].length),h+=.1*(1/a.length),d=a.indexOf(b),d>=0&&(h+=.5*(1/(d+1))),h+=1-h-(1-h)*(1/e.length));return Math.floor(h*100)/100}}.call(this),function(){var a,b,c;a=jQuery,b={ENTER:13,TAB:9,UP:38,DOWN:40,N:78,P:80,CTRL:17,ESC:27},c={init:function(c){var d;return d={classname:"commandbar",debug:!1,context:CommandBar.Context,limit:12},d=a.extend(d,c),this.each(function(){var c,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;return h=new CommandBar(d.context),f=a(this),d.limit||(d.limit=f.attr("data-results-limit")),f.attr("autocomplete","off"),f.attr("spellcheck","false"),f.wrap('<div class="'+d.classname+'" />'),e=f.closest("."+d.classname),g=a('<span class="message" />').prependTo(e),c=a('<div class="display hidden" />').appendTo(e),n=null,j=0,f.bind("execute.commandbar",function(){return k()}),h.bind("suggest.commandbar",function(){return f.trigger("suggest.commandbar")}),h.bind("loading.commandbar",function(a){return t(a,"loading")}),h.bind("message.commandbar",function(a){return q(a)}),h.bind("success.commandbar",function(a){return t(""+String.fromCharCode(10004)+" "+a,"success",!0)}),h.bind("error.commandbar",function(a){return t(""+String.fromCharCode(10006)+" "+a,"error",!0)}),h.bind("submit.commandbar",function(a){return f.closest("form").submit()}),t=function(a,b,c){g.text(a).show().addClass("visible"),g.removeClass("loading error success").addClass(b);if(c)return l()},l=function(){return setTimeout(function(){return g.removeClass("visible")},5e3)},m=function(){return g.hide().removeClass("visible loading error success")},r=function(){var a,b,d;a=c.find(".selected"),d=function(){return a.position().top<0},b=function(){return a.position().top+a.outerHeight()>c.height()},d()&&c.scrollTop(c.scrollTop()+a.position().top);if(b())return c.scrollTop(c.scrollTop()+a.position().top+a.outerHeight()-c.height())},o=function(){var a;c.find(".selected").removeClass("selected");if(j===-1)return f.val(f.data("val")),c.removeClass("hidden"),j++;if(j>=0)return a=c.find(".choice:nth-child("+(j+1)+")").addClass("selected"),a.length?(r(),f.val(h.complete(f.data("val"),a.data("command"))),j++):c.find(".choice:nth-child("+j+")").addClass("selected");if(CommandBar.History.exists(-j-2))return f.val(CommandBar.History.get(-j-2)),j++},p=function(){var a;c.find(".selected").removeClass("selected");if(j===1)return f.val(f.data("val")),j--;if(j>1)return a=c.find(".choice:nth-child("+(j-1)+")"),a.addClass("selected"),r(),a.length&&f.val(h.complete(f.data("val"),a.data("command"))),j--;if(CommandBar.History.exists(-j))return c.addClass("hidden"),f.val(CommandBar.History.get(-j)),j--},i=function(b){var d,e;b.length||(b=c.find(".choice:first"));if(!b.length)return;return n!=null&&clearTimeout(n),e=f.data("val"),d=a(b).data("command"),f.val(h.complete(e,d)),f.focus().keyup()},q=function(a){return c.html(a).show().removeClass("hidden")},k=function(){return c.html(""),CommandBar.History.add(f.val()),h.execute(f.val()),f.val(""),s()},g.click(function(){return m(),f.focus(),!1}),f.focus(function(){return clearTimeout(n),e.addClass("focused"),a(this).keyup()}),f.blur(function(){return n=setTimeout(function(){return e.removeClass("focused"),c.addClass("hidden")},200)}),f.bind("suggest.commandbar",function(){var b,e,f,g,i,k;j=0,g=a(this).val(),c.html("");if(g!==""){f=h.suggestions(g,d.limit);for(i=0,k=f.length;i<k;i++)e=f[i],b=a("<div class="+e.type+"></div>").attr("data-command",e.command),e.prefix&&a("<span class=prefix />").html(e.prefix).appendTo(b),e.display&&a("<span class=command />").text(e.display).appendTo(b),e.description&&a("<span class=description />").text(e.description).appendTo(b),b.appendTo(c)}return s()}),s=function(){return c.is(":empty")?c.hide().addClass("hidden"):c.show().removeClass("hidden")},f.bind("throttled:input",function(a){return f.val()!==""&&m(),f.data("val",f.val()),f.trigger("suggest.commandbar")}),f.keyup(function(a){switch(a.which){case b.N:case b.P:return a.ctrlKey?!1:f.trigger("suggest.commandbar");case b.ENTER:case b.TAB:case b.CTRL:case b.DOWN:case b.UP:case b:return!1;case b.ESC:return f.val()===""?f.blur():f.val("")}}),f.keydown(function(a){CommandBar.ctrlKey=a.ctrlKey,CommandBar.metaKey=a.metaKey,CommandBar.shiftKey=a.shiftKey;switch(a.which){case b.DOWN:return o();case b.UP:return p(),a.preventDefault(),!1;case b.P:if(a.ctrlKey)return p();break;case b.N:if(a.ctrlKey)return o();break;case b.ENTER:return k(),!1;case b.TAB:if(f.val()!=="")return i(c.find(".selected")),!1}}),c.on("click","div.choice",function(){return i(a(this)),!1})})}},a.fn.commandBar=function(b){return c[b]?c[b].apply(this,Array.prototype.slice.call(arguments,1)):typeof b=="object"||!b?c.init.apply(this,arguments):a.error("Method "+b+" does not exists on jQuery.commandBar")}}.call(this),function(){$(document).on("click",".js-compare-tabs a",function(){return $(this).closest(".js-compare-tabs").find("a").removeClass("selected"),$(this).addClass("selected"),$("#commits_bucket, #files_bucket, #commit_comments_bucket").hide(),$(this.hash).show(),!1})}.call(this),function(){$(function(){var a,b,c;c=$("form"),b=$("form #form_subject"),a=$("form .documentation-results");if(b.length>0)return a.css({top:b.outerHeight(!0)+19,width:"400px"}),b.quicksearch({url:"https://help.github.com/articles/quicksearch?quicksearch_external=true",results:a}).css({outline:"none"}).bind("quicksearch.loaded",function(a){var c;b.css({display:"block"}),c=$("form .documentation-results a");if(c.length>0)return c.attr("href",function(){return this.href.replace(/https?:\/\/.+?\//,"https://help.github.com/")})})})}.call(this),function(){$(document).on("pjax:send",".context-loader-container",function(){var a;return a=$(this).find(".context-loader:first"),a.length?a.addClass("is-context-loading"):$(".page-context-loader").addClass("is-context-loading")}),$(document).on("pjax:complete",".context-loader-container",function(a){return $(a.target).find(".context-loader:first").removeClass("is-context-loading"),$(".page-context-loader").removeClass("is-context-loading"),$(document.body).removeClass("disables-context-loader")}),$(document).on("pjax:timeout",".context-loader-container",function(){return!1})}.call(this),function(){var a,b,c,d,e,f,g;b=null,c=null,f=null,g=null,a=function(a){var b;return b=$("<img>",{"class":"dots",src:"/images/spinners/octocat-spinner-128.gif"}),$("#contribution-activity-listing").html(b),$.pjax({url:a,container:"#contribution-activity",scrollTo:!1,replace:!0})},d=function(c){var d,h;return b=c,d=null,f=null,g=null,h=""+document.location.pathname+"?tab=contributions&period="+b,e(),a(h)},e=function(a,b){var c,d;return d=$(".calendar-graph"),c=d3.select(".js-calendar-graph").selectAll("rect.day").classed("active",!1),a||b?(d.addClass("days-selected"),c.filter(function(c,d){return a&&b?c[0]>=a&&c[0]<=b:c[0]===a}).classed("active",!0)):d.removeClass("days-selected")},$(document).on("contributions:range",function(h,i,j){var k,l,m,n,o,p,q,r,s,t;j==null&&(j=!1),q=""+document.location.pathname+"?tab=contributions";if(i>=f&&i<=g){d("weekly");return}return typeof j=="object"&&(c=j,j=!0),c&&j?(o=moment(c).clone().subtract("days",31).toDate(),n=moment(c).clone().add("days",31).toDate(),r=i>c?[c,i]:[i,c],m=r[0],p=r[1],m<o&&(m=o),p>n&&(p=n),s=[m,p],f=s[0],g=s[1],k=moment(m).format("YYYY-MM-DD"),l=moment(p).format("YYYY-MM-DD"),q+="&from="+k+"&to="+l):(m=i,t=[m,null],f=t[0],g=t[1],k=moment(m).format("YYYY-MM-DD"),q+="&from="+k),c=i,b="custom",e(m,p),a(q)}),$(document).on("change",".js-period-container",function(a){var c;a.preventDefault(),a.stopPropagation(),c=$(a.target).val().toLowerCase();if(b===c)return;return d(c)}),$(function(){var a;return a=$(".popular-repos .col").height()-20,$(".popular-repos .capped-box").css("height",""+a+"px")})}.call(this),function(){$(document).on("submit",".js-credit-card-form",function(a){var b;b=$(".js-optional-postal-code",this);if(b.val().match(/\S/))return b.attr("name",b.attr("data-name"))})}.call(this),$(function(){if($(".repohead").length==0)return;var a=$("#repo_details"),b=GitHub.hasAdminAccess,c=GitHub.watchingRepo,d=GitHub.hasForked,e=$("#repository_description"),f=$("#repository_homepage"),g=$("#repo_details_loader");if($(".js-edit-details").length){var h=$(".repo-desc-homepage, .kill-the-chrome .js-details-show"),i=$(".edit-repo-desc-homepage, .kill-the-chrome .js-details-edit"),j=i.find(".error");$(".repo-desc-homepage, .kill-the-chrome .repository-meta").delegate(".js-edit-details","click",function(a){a.preventDefault(),h.hide(),i.show(),i.find(".description-field").focus()}),i.find(".cancel a").click(function(a){a.preventDefault(),h.show(),i.hide()}),$("#js-update-repo-meta-form").submit(function(a){a.preventDefault();var b=$(this);j.hide(),g.show(),i.css({opacity:.5}),$.ajax({url:b.attr("action"),type:"put",data:b.serialize(),success:function(a){i.hide(),h.html(a).show(),g.hide(),i.css({opacity:1})},error:function(){j.show(),g.hide(),i.css({opacity:1})}})})}b&&($(".editable-only").show(),$(".for-owner").show())}),function(){$(document).on("click",".js-git-protocol-selector",function(){var a,b,c;return a=$(this).closest(".url-box"),c=$(this).attr("href"),b=$(this).attr("data-permission"),a.find(".js-url-field").val(c),a.find(".js-zeroclipboard").attr("data-clipboard-text",c),a.find(".js-clone-url-permission").text(b),$(".js-live-clone-url").text(c),(c=$(this).attr("data-url"))&&$.ajax({type:"POST",url:c}),a.find(".js-clone-urls > .selected").removeClass("selected"),$(this).parent(".js-clone-url-button").addClass("selected"),!1}),$(document).on("mouseup",".js-url-field",function(){return $(this).select()})}.call(this),function(){$(document).on("mousedown",".diff-line-code",function(){var a;return a=$(this).closest(".file-diff"),a.addClass("hide-line-numbers"),a.hasClass("line-number-attrs")||(a.addClass("line-number-attrs"),a.find(".diff-line-num").each(function(){var a;return a=$(this),a.attr("data-line-number",a.text())})),$(document).one("mouseup",function(){if(!window.getSelection().toString())return a.removeClass("hide-line-numbers")})})}.call(this),function(){$(document).on("ajaxSend",".js-update-capability",function(){return $(this).find("select").prop("disabled",!0)}),$(document).on("ajaxComplete",".js-update-capability",function(){return $(this).find("select").prop("disabled",!1)}),$(document).on("ajaxSend",".js-revoke-capability",function(){return $(this).addClass("disabled"),$(this).text($(this).attr("data-disable-with"))}),$(document).on("ajaxSuccess",".js-revoke-capability",function(){return $(this).closest(".js-capability-member").remove()})}.call(this),$.pageUpdate(function(){$(document).on("click",".js-hook-target",function(){return $(".js-hook-target").removeClass("selected"),$(this).addClass("selected"),$(".js-hook-group").hide(),$(this.hash).show().scrollTo(),!1}),$(".test_hook").click(function(){var a=$(this),b=a.prev(".test_hook_message");b.text("Sending payload...");var c=a.attr("href");return $.post(c,{name:a.attr("rel")||""},function(){b.text("Payload deployed")}),!1}),$(".add_postreceive_url").click(function(){var a=$(this).prev("dl.form").clone();return a.find("input").val(""),$(this).before(a),!1}),$(document).on("click",".remove_postreceive_url",function(){return $(this).closest(".fields").find("dl.form").length<2?(alert("You cannot remove the last post-receive URL"),!1):($(this).closest("dl.form").remove(),!1)}),$(".unlock_branch").click(function(){var a=location.pathname.split("/"),b="/"+a[1]+"/"+a[2]+"/unlock_branch/"+a[4],c=$(this).parents(".notification");$(this).spin().remove();var d=this;return $.post(b,function(){c.hide()}),!1});if($("#edit_repo").length>0){var a=$("#change_default_branch"),b=a.find("select"),c=b.val();b.change(function(){a.removeClass("success").removeClass("error").addClass("loading"),$.ajax({type:"PUT",url:a.closest("form").attr("action"),data:{field:"repository_master_branch",value:b.val()},success:function(){a.removeClass("loading").addClass("success"),c=b.val()},error:function(){b.val(c),a.removeClass("loading").addClass("error")}})}),$(".addon.feature").each(function(){var a=$(this);a.find(":checkbox").change(function(){var b=this;a.removeClass("success").removeClass("error").addClass("loading"),$.ajax({type:"PUT",url:a.closest("form").attr("action"),data:{field:b.name,value:b.checked?1:0},success:function(){a.removeClass("loading").addClass("success")},error:function(){b.checked=!b.checked,a.removeClass("loading").addClass("error")}})})});var d=$("#push_pull_collabs input[data-autocomplete]"),e=$("#push_pull_collabs button[type=submit]"),f=null;d.on("autocomplete:search",function(){f&&f.abort();var a=$(this).val();if(a===""){$("#add-user-autocomplete ul").empty(),$("#add-user-autocomplete").trigger("autocomplete:change");return}f=$.ajax({type:"GET",data:{q:a},url:"/autocomplete/users",dataType:"html",success:function(a){f=null,$("#add-user-autocomplete ul").html(a),$("#add-user-autocomplete").trigger("autocomplete:change")}})}),d.on("autocomplete:autocompleted:changed",function(){d.attr("data-autocompleted")?e.removeAttr("disabled"):e.attr("disabled","disabled")}),$("#push_pull_collabs form").submit(function(){var a=$(this).find(":text"),b=a.val();debug("Trying to add %s...",b);if(!b||!a.attr("data-autocompleted"))return!1;var c=function(a){a!=null?$("#push_pull_collabs .error").text(a).show():$("#push_pull_collabs .error").hide()};return c(),$.ajax({url:this.action,data:{member:b},type:"POST",dataType:"json",success:function(b){a.val(""),b.error?c(b.error):$("#push_pull_collabs ul.usernames").append(b.html)},error:function(){c("An unidentified error occurred, try again?")}}),!1}),$(document).on("click","#push_pull_collabs .remove-user",function(){return $.ajax({type:"DELETE",url:this.href}),$(this).closest("li").remove(),!1}),$("#teams form").submit(function(){var a=$(this).find("select"),b=a.val(),c=function(a){a!=null?$("#push_pull_collabs .error").text(a).show():$("#push_pull_collabs .error").hide()};return b==""?(c("You must select a team"),!1):(c(),$.ajax({url:this.action,data:{team:b},type:"POST",dataType:"json",success:function(b){a.val(""),b.error?c(b.error):$("#teams ul.teams").append(b.html)},error:function(){c("An unidentified error occurred, try again?")}}),!1)}),$(document).on("click","#teams .remove-team",function(){return $.ajax({type:"DELETE",url:this.href}),$(this).closest("li").remove(),!1}),$(".site").is(".vis-public")?$(".private-only").hide():$(".public-only").hide(),$(document).on("click","#custom_tabs .remove-tab",function(){return $.ajax({type:"DELETE",url:this.href}),$(this).closest("li").remove(),!1}),$(document).bind("reveal.facebox",function(){$("#facebox .renaming_to_field").val($("#rename_field").val())})}}),$(function(){var a=$(".community .bigcount"),b=function(){var b=a.outerWidth();a.css("margin-left",-(b/2)+"px"),a.fadeIn()};a.length>0&&setTimeout(b,500)}),function(){$(document).on("click",".email-hidden-toggle > a",function(){return $(this).parent().siblings(".email-hidden-reply").toggle(),!1})}.call(this),function(){var a,b,c,d,e,f,g,h,i,j;i=667,b=107,j=[20,0,0,20],f=j[0],e=j[1],c=j[2],d=j[3],a=12,g=2,h=function(a){var b,c,d,e,f;d=a.length;if(d<1)return NaN;if(d===1)return 0;c=d3.mean(a),b=-1,e=0;while(++b<d)f=a[b]-c,e+=f*f;return e/(d-1)},$(document).on("graph:load",".js-calendar-graph",function(c,e){var j,k,l,m,n,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M;j=$(this),n=j.attr("data-from"),n&&(n=y=moment
  (n).toDate()),E=j.attr("data-to"),E&&(E=moment(E).toDate()),e||(e=[]),e=e.map(function(a){return[new Date(a[0]),a[1]]}).sort(function(a,b){return d3.ascending(a[0],b[0])}),k=3.77972616981,v=e.map(function(a){return a[1]}),C=Math.sqrt(h(v)),s=d3.mean(v),B=3,p=d3.max(v),F=r-s;if(F<6||p<15)B=1;x=0;while(x<B)G=v.filter(function(a){var b;return b=Math.abs((s-a)/C),b>k}),G.length>0?(G=G[0],v=v.filter(function(a){return a!==G}),x===0&&(q=v)):G=null,x+=1;r=d3.max(v),z=["#d6e685","#8cc665","#44a340","#1e6823"],o=d3.scale.quantile().domain([0,r]).range(z),m=d3.time.format("%w"),M=d3.time.format("%Y%U"),L=d3.time.format("%m-%y"),t=d3.time.format("%b"),J={},u={},e.forEach(function(a){var b;return b=M(a[0]),J[b]||(J[b]=[]),J[b].push(a)}),J=d3.entries(J),J.forEach(function(a){var b;return b=L(a.value[0][0]),u[b]||(u[b]=[a.value[0][0],0]),u[b][1]+=1}),u=d3.entries(u).sort(function(a,b){return d3.ascending(a.value[0],b.value[0])}),D=d3.tip().attr("class","svg-tip").offset([-10,0]).text(function(a){var b;return b=a[1]===0?"No":a[1],"<strong>"+b+" "+$.pluralize(a[1],"contribution")+"</strong> on "+moment(a[0]).format("MMMM Do YYYY")}),H=d3.select(this).append("svg").attr("width",i).attr("height",b).attr("id","calendar-graph").append("g").attr("transform","translate("+d+", "+f+")").call(D),I=0,K=H.selectAll("g.week").data(J).enter().append("g").attr("transform",function(b,c){var d;return d=b.value[0][0],d.getFullYear()===(new Date).getFullYear()&&d.getDay()!==0&&I===0&&(I=-1),"translate("+(c+I)*a+", 0)"}),A=K.selectAll("rect.day").data(function(a){return a.value}).enter().append("rect").attr("class","day").attr("width",a-g).attr("height",a-g).attr("y",function(b){return m(b[0])*a}).style("fill",function(a){return a[1]===0?"#eee":o(a[1])}).on("click",function(a){return $(document).trigger("contributions:range",[a[0],d3.event.shiftKey])}).on("mouseover",D.show).on("mouseout",D.hide),l=0,H.selectAll("text.month").data(u).enter().append("text").attr("x",function(b,c){var d;return d=a*l,l+=b.value[1],d}).attr("y",-5).attr("class","month").style("display",function(a){if(a.value[1]<=2)return"none"}).text(function(a){return t(a.value[0])}),H.selectAll("text.day").data(["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]).enter().append("text").style("display",function(a,b){if(b%2===0)return"none"}).attr("text-anchor","middle").attr("class","wday").attr("dx",-10).attr("dy",function(b,c){return f+((c-1)*a+g)}).text(function(a){return a[0]});if(n||E)return $(document).trigger("contributions:range",[n,E])})}.call(this),function(){$(document).on("graph:load",".js-graph-code-frequency",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E;return s=$(this).width(),h=500,g=function(a){var b;return a=Math.abs(a),a<1e3?a:(b=d3.formatPrefix(a),""+b.scale(a)+b.symbol)},q=0,c=function(a,b){var c,d;return c=a[1],d=a[2],q=c+d+q,q},b=b.map(function(a,b){return c(a,b),[new Date(a[0]*1e3),~~a[1],~~a[2],q]}).sort(function(a,b){return d3.ascending(a[0],b[0])}),d=b.map(function(a){return[a[0],a[1]]}),f=b.map(function(a){return[a[0],a[2]]}),l=b.length,E=[10,70,60,10],p=E[0],n=E[1],o=E[2],m=E[3],j=d3.max(d,function(a){return a[1]}),k=d3.min(f,function(a){return a[1]}),u=b[0][0],t=b[b.length-1][0],v=d3.time.scale().domain([u,t]).range([0,s-n-o]),x=d3.scale.linear().domain([k,j]).range([h-m-p,0]),B=d3.max(b,function(a){return a[3]}),y=d3.scale.linear().domain([0,B]).range([h-m-p,0]),z=d3.svg.axis().scale(y).orient("right").tickSize(5).tickPadding(5).tickFormat(g),w=d3.svg.axis().scale(v).tickSize(h).tickFormat(function(a){return u.getFullYear()!==t.getFullYear()?d3.time.format("%m/%y")(a):d3.time.format("%m/%d")(a)}),C=d3.svg.axis().scale(x).orient("left").tickPadding(5).tickFormat(g),r=d3.select(this).data(b).style("width",""+s+"px").append("svg").attr("width",s+n+o).attr("height",h+p+m).attr("class","viz").append("svg:g").attr("transform","translate("+n+","+p+")"),r.append("g").attr("class","x axis").call(w),e=d3.svg.area().x(function(a){return v(a[0])}).y0(function(a){return x(a[1])}).y1(function(a){return x(0)}),i=d3.svg.line().x(function(a){return v(a[0])}).y(function(a){return y(a[3])}).interpolate("basis"),D=r.append("g").attr("transform","translate(-35, 0)").attr("class","y axis"),r.selectAll("path.area").data([d,f]).enter().append("path").attr("class",function(a,b){return b===0?"area addition":"area deletion"}).attr("d",e),D.call(C).selectAll(".y.axis g").classed("zero",function(a,b){return a===0}).classed("add",function(a,b){return a>0}).classed("del",function(a,b){return a<0}),A=r.append("g").attr("transform","translate("+(s-n-o+30)+", 0)").attr("class","y2 axis"),A.call(z).selectAll(".y2.axis g").classed("tot",!0),r.selectAll("path.cumulative").data([b]).enter().append("path").attr("class","cumulative path").attr("d",i),r.append("text").text("Total Lines").attr("text-anchor","middle").attr("transform",function(){return"translate("+(s-n-o+15)+", "+(h-this.getBoundingClientRect().width/2)/2+")rotate(90)"}).attr("class","axlabel biglabel"),r.append("text").text("Additions and Deletions").attr("text-anchor","middle").attr("transform",function(){return"translate(-15, "+(h-this.getBoundingClientRect().width/2)/2+")rotate(270)"}).attr("class","axlabel biglabel")})}.call(this),function(){$(document).on("graph:load",".js-commit-activity-graph",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;return i=$("#commit-activity-master"),d=$("#commit-activity-detail"),g=260,q=d.width(),r=0,function(){var a,c,f,h,i,j,k,l,m,n,o,p,s,t,u,v,w,x;return h=0,i=b.length,b.forEach(function(a,b){if(a.total!==0)return h=b}),r=h,x=[20,30,30,40],n=x[0],l=x[1],m=x[2],k=x[3],c=b[r].days,j=d3.max(b,function(a){return d3.max(a.days)}),t=d3.scale.linear().domain([0,c.length-1]).range([0,q-l-m]),v=d3.scale.linear().domain([0,j]).range([g,0]),w=d3.svg.axis().scale(v).orient("left").ticks(5).tickSize(-q+m+l),$(document).on("gg.week.selected",function(a,b){return p(b)}),$(document).on("keyup",function(a){var c,d;c=r;if((d=a.keyCode)===37||d===39)return r>0&&a.keyCode===37&&(c-=1),r<b.length&&a.keyCode===39&&(c+=1),p({index:c})}),s=d3.select(d[0]).data([c]).append("svg").attr("width",q).attr("height",g+n+k).attr("class","viz").append("g").attr("transform","translate("+l+","+n+")"),s.append("g").attr("class","y axis").call(w),u=s.append("g").attr("class","days"),a=u.selectAll("g.day").data(moment.langData()._weekdays).enter().append("g").attr("class","day").attr("transform",function(a,b){return"translate("+t(b)+", "+g+")"}),a.append("text").attr("text-anchor","middle").attr("dy","2em").text(function(a,b){return a}),o=d3.svg.line().interpolate("cardinal").x(function(a,b){return t(b)}).y(v),s.append("path").attr("class","path").attr("d",o),f=s.selectAll("g.dot").data(c).enter().append("g").attr("class","dot").attr("transform",function(a,b){return"translate("+t(b)+", "+v(a)+")"}),f.append("circle").attr("r",4),f.append("text").attr("text-anchor","middle").attr("class","tip").attr("dy",-10).text(function(a){return a}),p=function(a){var d,f,g;if(a.index>52||a.index<0)return;return r=a.index,c=b[a.index].days,j=d3.max(c),t.domain([0,c.length-1]),g=d3.selectAll(".bar.mini").attr("class","bar mini"),d=d3.select(g[0][r]),d.attr("class","bar mini active"),f=d3.transform(d.attr("transform")),e.transition().ease("back-out").duration(300).attr("transform","translate("+(f.translate[0]+8)+", 105)"),s.selectAll(".path").data([c]).transition().duration(500).attr("d",o),s.selectAll("g.dot").data(c).transition().duration(300).attr("transform",function(a,b){return"translate("+t(b)+", "+v(a)+")"}),s.selectAll("text.tip").data(c).text(function(a){return a})}}(),w=[10,30,20,30],m=w[0],k=w[1],l=w[2],j=w[3],o=b.map(function(a){return a.total}),h=d3.max(o),g=100,s=d3.scale.ordinal().domain(d3.range(o.length)).rangeRoundBands([0,q-k-l],.1),u=d3.scale.linear().domain([0,h]).range([g,0]),f=d3.time.format("%m/%d"),v=d3.svg.axis().scale(u).orient("left").ticks(3).tickSize(-q+k+l),t=d3.svg.axis().scale(s).orient("bottom").ticks(d3.time.weeks).tickFormat(function(a,c){var d;return d=new Date(b[c].week*1e3),f(d)}),n=d3.tip().attr("class","svg-tip").offset([-10,0]).text(function(a){return"<strong>"+a+"</strong> "+$.pluralize(a,"commit")}),p=d3.select(i[0]).style("width",""+q+"px").append("svg").attr("width",q+(k+l)).attr("height",g+m+j).attr("class","viz").append("g").attr("transform","translate("+k+","+m+")").call(n),p.append("g").attr("class","y axis").call(v),c=p.selectAll("g.mini").data(o).enter().append("g").attr("class",function(a,b){return b===r?"bar mini active":"bar mini"}).attr("transform",function(a,b){return"translate("+s(b)+", 0)"}).on("click",function(a,b){return $(document).trigger("gg.week.selected",{node:this,index:b,data:a})}),c.append("rect").attr("width",s.rangeBand()).attr("height",function(a){return g-u(a)}).attr("y",function(a){return u(a)}).on("mouseover",n.show).on("mouseout",n.hide),p.append("g").attr("class","x axis").attr("transform","translate(0,"+g+")").call(t).selectAll(".x.axis g").style("display",function(a,b){return b%3!==0?"none":"block"}),e=p.append("circle").attr("class","focus").attr("r",8).attr("transform","translate("+(s(r)+s.rangeBand()/2)+", "+ -g+")").style("fill","#4183C4"),e.transition().ease("elastic-in").duration(1e3).attr("r",2).attr("transform","translate("+(s(r)+s.rangeBand()/2)+", "+(g+5)+")").style("fill","#555")})}.call(this),function(){var a,b,c,d,e,f;a=d3.time.format("%Y-%m-%d"),c=a.parse,e=function(a){var b;return a<1e3?a:(b=d3.formatPrefix(a),""+b.scale(a)+b.symbol)},d=function(){var a;return a={},$.each(document.location.search.substr(1).split("&"),function(b,c){var d,e,f;return f=c.split("="),d=f[0],e=f[1],a[d]=e}),a},f=function(a,b){var c,d,e;return e=moment(a).format("MMMM Do YYYY"),d=moment(b).format("MMMM Do YYYY"),c=$("#js-date-range").attr("data-default-branch"),$("#js-date-range").html(""+e+" <span class='dash'>&dash;</span> "+d+"    <p class='info'>Commits to "+c+", excluding merge commits</p>")},b=function(a){var b,c,d;return b=moment(a[0].weeks[0].date),c=b.subtract("weeks",1),d=c.format("YYYY-MM-DD"),a.forEach(function(a){return a.weeks.unshift({a:0,c:0,d:0,date:c.toDate(),w:d})})},$(document).on("graph:load","#contributors",function(g,h){var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;return j=$(this),k=[],p=d(),y=null,x=null,p.from!=null&&(u=c(p.from)),p.to!=null&&(m=c(p.to)),l=(p!=null?p.type:void 0)||"c",j.on("range.selection.end",function(b,c){var d;return d=c.range,u=d[0],m=d[1],a(u)===a(m)&&(u=y,m=x),w(),f(u,m),s()}),r=function(a){var d;return a[0].weeks.length===1&&b(a),d=i(a),y=c(d[0].key),x=c(d[d.length-1].key),u==null&&(u=y),m==null&&(m=x),f(u,m),t(d,y,x),s(a,y,x),$(".js-contribution-container").on("change","input[type=radio]",o)},q=function(a){return a.forEach(function(a){return a.weeks.forEach(function(a){return a.date=c(a.w)})}),a},n=function(a,b){return a.map(function(a){var c;return c=$.extend(!0,{},a),c.weeks=c.weeks.filter(function(a){return a.date>=b[0]&&a.date<=b[1]}),c})},i=function(a){var b;return b={},a.forEach(function(a){return a.weeks.forEach(function(a){var c,d;return(d=b[c=a.w])==null&&(b[c]={c:0,a:0,d:0}),b[a.w].c+=a.c,b[a.w].a+=a.a,b[a.w].d+=a.d})}),d3.entries(b)},v=function(a){return a=n(a,[u,m]),a.forEach(function(a){var b,c,d;return c=0,b=0,d=0,a.weeks.forEach(function(a){return c+=a.c,b+=a.a,d+=a.d}),a.c=c,a.a=b,a.d=d}),a.sort(function(a,b){return d3.descending(a[l],b[l])})},t=function(b,d,f){var g,h,i,k,n,o,p,q,r,s,t,v,w,x,y,z,A,B;return B=[20,50,20,30],q=B[0],o=B[1],p=B[2],n=B[3],w=j.width(),i=125,k=d3.max(b,function(a){return a.value[l]}),x=d3.time.scale().domain([d,f]).range([0,w-o-p]),z=d3.scale.linear().domain([0,k]).range([i,0]),A=d3.svg.axis().scale(z).orient("left").ticks(4).tickSize(-w+o+p).tickPadding(10).tickFormat(e),y=d3.svg.axis().scale(x),b.length<5&&y.ticks(b.length),g=d3.svg.area().interpolate("basis").x(function(a){return x(c(a.key))}).y0(function(a){return i}).y1(function(a){return z(a.value[l])}),d3.select("#contributors-master svg").remove(),v=d3.select("#contributors-master").data([b]).append("svg").attr("height",i+q+n).attr("width",w).attr("class","viz").append("g").attr("transform","translate("+o+","+q+")"),v.append("g").attr("class","x axis").attr("transform","translate(0, "+i+")").call(y),v.append("g").attr("class","y axis").call(A),v.append("path").attr("class","area").attr("d",g),t=function(){var a;return v.classed("selecting",!0),a=d3.event.target.extent(),j.trigger("range.selection.start",{data:arguments[0],range:a})},r=function(){var a,b;return a=d3.time.format("%m/%d/%Y"),b=d3.event.target.extent(),j.trigger("range.selection.selected",{data:arguments[0],range:b})},s=function(){var a;return v.classed("selecting",!d3.event.target.empty()),a=d3.event.target.extent(),j.trigger("range.selection.end",{data:arguments[0],range:a})},h=d3.svg.brush().x(x).on("brushstart",t).on("brush",r).on("brushend",s),(a(u)!==a(d)||a(m)!==a(f))&&h.extent([u,m]),v.append("g").attr("class","selection").call(h).selectAll("rect").attr("height",i)},s=function(){var a,b,c,d,f,g,i,j,n,o,p,q,r,s,t,w,x,y,z,A;return A=[10,10,10,20],n=A[0],i=A[1],j=A[2],g=A[3],s=428,c=100,$("#contributors ol").remove(),h=v(k),r=d3.select("#contributors").append("ol").attr("class","contrib-data clearfix"),f=d3.max(h,function(a){return d3.max(a.weeks,function(a){return a[l]})}),t=d3.time.scale().domain([u,m]).range([0,s]),x=d3.scale.linear().domain([0,f]).range([c-g-n,0]),b=d3.svg.area().interpolate("basis").x(function(a){return t(a.date)}).y0(function(a){return c-g-n}).y1(function(a){return x(a[l])}),y=d3.svg.axis().scale(x).orient("left").ticks(2).tickSize(-s).tickPadding(10).tickFormat(e),w=d3.svg.axis().scale(t).tickFormat(d3.time.format("%m/%y")),h[0].weeks.length<5&&w.ticks(h[0].weeks.length).tickFormat(d3.time.format("%x")),$("li.person").remove(),o=r.selectAll("li.person").data(h).enter().append("li").attr("class","person").style("display",function(a){return a[l]<1?"none":"block"}),d=o.append("h3"),d.append("img").attr("src",function(a){return a.author.gravatar}).attr("class","avatar"),d.append("span").attr("class","rank").text(function(a,b){return"#"+(b+1)}),d.append("a").attr("class","aname").attr("href",function(a){return"/"+a.author.login}).text(function(a){return a.author.login}),a=d.append("span").attr("class","ameta"),p=$(".graphs").attr("data-repo-url"),a.append("span").attr("class","cmeta").html(function(a){return"<a class='cmt' href='"+p+"/commits?author="+a.author.login+"'>"+$.commafy(a.c)+" "+$.pluralize(a.c,"commit")+"</a> / <span class='a'>"+$.commafy(a.a)+" ++</span> / <span class='d'>"+$.commafy(a.d)+" --</span>"}),q=o.append("svg").attr("width",s+(i+j)).attr("height",c+n+g).attr("class","spark").append("g").attr("transform","translate("+i+","+n+")"),q.append("g").attr("class","x axis").attr("transform","translate(0, "+(c-n-g)+")").call(w).selectAll(".x.axis g text").style("display",function(a,b){return b%2!==0?"none":"block"}),z=q.append("g").attr("class","y axis").call(y).selectAll(".y.axis g text").attr("dx",s/2).style("display",function(a,b){return b===0?"none":"block"}).classed("midlabel",!0),q.append("path").attr("d",function(a){return b(a.weeks)})},w=function(){var b,c;if($.support.pjax)return b=document.location,l=$("input[name=ctype]:checked").prop("value").toLowerCase(),c=""+b.pathname+"?from="+a(u)+"&to="+a(m)+"&type="+l,window.history.pushState(null,null,c)},o=function(a){if(l!==$(this).val())return w(),r(k)},k=q(h),r(h)})}.call(this),function(){var a,b;a={},b=function(b){var c,d,e;c=$(b);if(!(e=c.attr("data-url")))return;return c.find("svg").remove(),(d=a[e])?c.fire("graph:load",[d]):(c.addClass("is-graph-loading"),c.removeClass("is-graph-crunching is-graph-load-error is-graph-empty"),$.ajaxPoll({url:e,success:function(b,d,f){var g,h;return f.status===202?c.addClass("is-graph-crunching"):(c.removeClass("is-graph-loading is-graph-crunching"),(b!=null?b.length:void 0)===0||((g=b[0])!=null?(h=g.weeks)!=null?h.length:void 0:void 0)===0?c.addClass("is-graph-empty"):(a[e]=b,c.fire("graph:load",[b])))},error:function(){return c.removeClass("is-graph-loading is-graph-crunching"),c.addClass("is-graph-load-error")}}))},$.pageChange(function(){var a,c,d,e;e=$(this).find(".js-graph");for(c=0,d=e.length;c<d;c++)a=e[c],b(a)})}.call(this),function(){$(document).on("graph:load",".js-milestone-graph",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;return u=$(this).width(),m=50,B=[10,20,10,30],q=B[0],p=B[1],n=B[2],o=B[3],d=100,C=[60,20,0,30],k=C[0],j=C[1],h=C[2],i=C[3],v=d3.scale.ordinal().rangeRoundBands([0,u-i-j],.1),x=d3.scale.linear().range([d,0]),z=d3.scale.linear().range([d,0]),A=d3.scale.linear().range([m,0]),w=d3.svg.axis().scale(v).orient("top").tickSize(5).tickPadding(10).tickFormat(function(a){return moment(b[a].date).format("M/D")}),y=d3.svg.axis().scale(x).orient("left").tickSize(-u+i+j).tickFormat(Math.abs).ticks(4),l=d3.svg.line().x(function(a,b){return v(b)}).y(function(a){return A(a.events)}).interpolate("cardinal"),g=d3.svg.line().x(function(a,b){return v(b)+v.rangeBand()/2}).y(function(a){return z(a.open_total)}).interpolate("step-after"),r=d3.select(this).append("svg").attr("width",u).attr("height",m+q+n).attr("id","total-events").append("g").attr("transform","translate("+o+", "+q+")"),t=d3.select(this).append("svg").attr("id","graph-open-close").attr("height",d+k+h).append("g").attr("transform","translate("+i+", "+k+")"),b.forEach(function(a){return a.date=new Date(a.date),a.closed=-a.closed}),f=d3.min(b,function(a){return a.closed}),e=d3.max(b,function(a){return a.open+a.reopened}),x.domain([f-1,e+1]),v.domain(d3.range(b.length)),A.domain([0,d3.max(b,function(a){return a.events})]),z.domain([0,d3.max(b,function(a){return a.open_total})]),t.append("rect").attr("class","axis-backing").attr("width",u).attr("height",30).attr("x",-i).attr("y",-k),t.append("line").attr("class","axis-backing-line").attr("x1",-i).attr("x2",u).attr("y1",-k+30).attr("y2",-k+30),t.append("g").attr("class","x axis").attr("transform","translate(0, -25)").call(w).selectAll("g").style("display",function(a,b){return b%4===0?"block":"none"}),t.append("g").attr("class","y axis").call(y),t.selectAll("g.y g").filter(function(a,b){return a===0}).classed("zero",!0),c=t.selectAll("g.bar").data(b).enter().append("g").attr("class","bar").attr("transform",function(a,b){return"translate("+v(b)+", 0)"}),c.selectAll("rect.day").data(function(a){return[a.open+a.reopened,a.closed]}).enter().append("rect").attr("width",v.rangeBand()).attr("height",function(a,b){return Math.abs(x(a)-x(0))}).attr("y",function(a){return x(Math.max(0,a))}).attr("class",function(a,b){return b===0?"opened":"closed"}),s=r.append("g").attr("class","x axis").attr("transform","translate(0, "+(m+10)+")").call(w).selectAll("g").style("display",function(a,b){return b%4===0?"block":"none"}),s.selectAll("g text").style("display","none"),r.selectAll("path.events").data([b]).enter().append("path").attr("class","events").attr("d",l),r.append("text").text("ACTIVITY").attr("text-anchor","middle").attr("x",function(a){return u/2-this.getBBox().width/2}).attr("y",m/2).attr("class","activity-label")})}.call(this);var Network=defineNetwork(window.jQuery);Modernizr.canvas&&$(function(){$("#ng")[0]&&new Network("#ng",920,600)}),function(){$(document).on("graph:load",".js-pulse-authors-graph",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;return c=15,b=b.slice(0,+(c-1)+1||9e9),m=$(this).width(),e=$(this).height(),q=[20,0,10,20],j=q[0],i=q[1],g=q[2],h=q[3],n=d3.scale.ordinal().rangeRoundBands([0,m-h-i],.2),o=d3.scale.linear().range([e,0]),p=d3.svg.axis().scale(o).orient("left").ticks(3).tickSize(-m+h+i),f=d3.max(b,function(a){return a.commits}),o.domain([0,f]),n.domain(d3.range(c)),g=n.rangeBand()+g,k=d3.tip().attr("class","svg-tip").offset([-10,0]).text(function(a){return"<strong>"+a.commits+"</strong> "+$.pluralize(a.commits,"commit")+" by <strong>"+a.login+"</strong>"}),l=d3.select(this).append("svg").attr("id","graph-pulse-authors").attr("height",e+j+g).append("g").attr("transform","translate("+h+", "+j+")").call(k),l.append("g").attr("class","y axis").call(p),d=l.selectAll("g.bar").data(b).enter().append("g").attr("class","bar").attr("transform",function(a,b){return"translate("+n(b)+", 0)"}),d.append("rect").attr("width",n.rangeBand()).attr("height",function(a,b){return e-o(a.commits)}).attr("y",function(a){return o(a.commits)}).on("mouseover",k.show).on("mouseout",k.hide).on("click",function(a){return document.location=d3.select(this.ownerSVGElement.parentNode).attr("data-commits-url")+("?author="+a.login)}),d.append("image").attr("y",e+5).attr("xlink:href",function(a){return a.gravatar}).attr("width",n.rangeBand()).attr("height",n.rangeBand()).on("click",function(a){return document.location="/"+a.login})})}.call(this),function(){$(document).on("graph:load",".js-graph-punchcard",function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return g=500,u=$(this).width(),m={},b.forEach(function(a){var b,c,d,e,f;return d=moment.langData()._weekdays[a[0]],b=(e=m[d])!=null?e:m[d]=[],c=a[1],(f=b[c])==null&&(b[c]=0),b[c]+=a[2]}),b=d3.entries(m).reverse(),x=[0,0,0,20],q=x[0],o=x[1],p=x[2],n=x[3],j=100,d=d3.range(7),i=d3.range(24),l=d3.min(b,function(a){return d3.min(a.value)}),k=d3.max(b,function(a){return d3.max(a.value)}),v=d3.scale.ordinal().domain(i).rangeRoundBands([0,u-j-o-p],.1),w=d3.scale.ordinal().domain(d).rangeRoundBands([g-q-n,0],.1),h=d3.scale.quantize().domain([l,k]).range(d3.range(0,50)),r=function(a){return v.rangeBand()*(h(a)/100)},s=d3.tip().attr("class","svg-tip").offset([-10,0]).text(function(a){return"<strong>"+a+"</strong> "+$.pluralize(a,"commit")}),t=d3.select(this).data(b).attr("width",""+u+"px").append("svg").attr("width",u+(o+p)).attr("height",g+q+n).attr("class","viz").append("g").attr("transform","translate("+o+","+q+")").call(s),e=t.selectAll("g.day").data(b).enter().append("g").attr("class","day").attr("transform",function(a,b){return"translate(0, "+w(b)+")"}),e.append("line").attr("x1",0).attr("y1",0).attr("x2",u-o-p).attr("y2",0).attr("class","axis"),e.append("text").attr("class","label").text(function(a,b){return a.key}).attr("dy",w.rangeBand()/2),t.append("g").selectAll("text.hour").data(i).enter().append("text").attr("text-anchor","middle").attr("transform",function(a,b){return"translate("+(v(b)+j)+", "+g+")"}).attr("class","label").text(function(a){var b;return b=a%12||12,a===0||a<12?""+b+"a":""+b+"p"}),f=e.selectAll("g.hour").data(function(a){return a.value}).enter().append("g").attr("class","hour").attr("transform",function(a,b){return"translate("+(v(b)+j)+", 0)"}).attr("width",v.rangeBand()),f.append("line").attr("x1",0).attr("y1",function(a,b){return b%2===0?-15:-10}).attr("x2",0).attr("y2",0).attr("class",function(a,b){return b%2===0?"axis even":"axis odd"}),c=f.append("circle").attr("r",0).attr("cy",w.rangeBand()/2-5).attr("class",function(a){return"day h"+h(a)}).on("mouseover",s.show).on("mouseout",s.hide),c.transition().attr("r",r)})}.call(this),function(){$(document).on("click",".dropdown-toggle .js-details-target",function(){return $(".dropdown-toggle .js-dropdown-menu-container").html($(".js-new-dropdown-contents").html())})}.call(this),$(function(){var a=$("#issues_search");if(a.length==0)return;var b=$("#js-issues-quicksearch").val();a.find("input[type=radio], select").change(function(a){var c=$(this).closest("form");c.find("#search_q").val(b),c.submit()})}),$(function(a){var b=a("#issues_next");if(b.length==0)return;var c=a("#js-issues-quicksearch"),d=!0;if(c.length>0){var e=b.find(".js-new-issue-button"),f=c.offset();b.find(".search .autocomplete-results").css({left:c.position().left,width:e.offset().left-f.left+e.outerWidth(!0)}),c.quicksearch({results:b.find(".search .autocomplete-results"),insertSpinner:function(a){c.closest("form").prepend(a)}}).bind("focus",function(b){d&&(d=!1),a(this).closest(".fieldwrap").addClass("focused")}).bind("blur",function(b){a(this).closest(".fieldwrap").removeClass("focused")}).css({outline:"none"})}}),$(function(){var a=$(".github-jobs-promotion");if(a.get(0)==null)return;a.css("visibility","hidden"),window.jobsWidgetCallback=function(b){var c=Math.floor(Math.random()*b.jobs.length),d=b.jobs[c];a.find(".job-link").attr("href",d.url),a.find(".job-company").text(d.company),a.find(".job-position").text(d.position),a.find(".job-location").text(d.location),a.css({visibility:"visible"})},$.getScript(a.attr("url"))}),function(){$.extend($.facebox.settings,{loadingImage:"https://a248.e.akamai.net/assets.github.com/images/spinners/octocat-spinner-64.gif",closeHTML:'<span class="mini-icon mini-icon-remove-close"></span>',closeImage:""}),$(document).on("click",".js-keyboard-shortcuts",function(){return $("#facebox .shortcuts:visible").length||$(document).one("reveal.facebox",function(){return $(".js-see-all-keyboard-shortcuts").click(function(){return $(this).remove(),$("#facebox .js-hidden-pane").show(),!1})}),$.facebox({div:"#keyboard_shortcuts_pane",ajax:"/site/keyboard_shortcuts?url="+window.location.pathname},"shortcuts")})}.call(this),function(){var a,b=this,c=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};a=function(){function a(b){var c=this;this.input=b,this.loadSuggestions=function(){return a.prototype.loadSuggestions.apply(c,arguments)},this.onInvite=function(b){return a.prototype.onInvite.apply(c,arguments)},this.onSubmit=function(b){return a.prototype.onSubmit.apply(c,arguments)},this.onNavigationOpen=function(b){return a.prototype.onNavigationOpen.apply(c,arguments)},this.onNavigationKeyDown=function(b){return a.prototype.onNavigationKeyDown.apply(c,arguments)},this.onKeyUp=function(){return a.prototype.onKeyUp.apply(c,arguments)},this.teardown=function(){return a.prototype.teardown.apply(c,arguments)},$(this.input).on("focusout:delayed.member-adder",this.teardown),$(this.input).on("keyup.member-adder",this.onKeyUp),$(this.input).on("throttled:input.member-adder",this.loadSuggestions),this.form=$(this.input).closest("form"),this.form.on("submit.member-adder",this.onSubmit),this.container=document.getElementById($(this.input).attr("data-member-adder")),this.list=document.getElementById($(this.input).attr("data-member-list")),$(this.container).on("navigation:keydown.member-adder","[data-value]",this.onNavigationKeyDown),$(this.container).on("navigation:open.member-adder","[data-value]",this.onNavigationOpen)}return a.prototype.teardown=function(){this.deactivate(),$(this.input).off(".member-adder"),$(this.container).off(".member-adder"),$(this.form).off(".member-adder")},a.prototype.activate=function(){if($(this.container).is(".active"))return;$(this.container).addClass("active"),$(this.input).addClass("js-navigation-enable"),$(this.container).navigation("push"),$(this.container).navigation("focus")},a.prototype.deactivate=function(){$(this.container).removeClass("active"),$(this.container).find(".suggestions").hide(),$(this.input).removeClass("js-navigation-enable"),$(this.container).navigation("pop")},a.prototype.onKeyUp=function(){var a;a=this.input.value;if(a===this.query)return;if(this.query=a)return this.activate(),this.search(a),this.query;this.query=null,this.deactivate()},a.prototype.onNavigationKeyDown=function(a){switch(a.hotkey){case"tab":return this.onNavigationOpen(a),!1;case"esc":return this.deactivate(),!1}},a.prototype.onNavigationOpen=function(a){var b,c,d=this;return b=$(a.target).attr("data-value"),this.input.value="",(c=this.ajax)!=null&&c.abort(),this.spinner(),$.ajax({url:$(this.container).attr("data-add-url"),type:"post",data:{member:b},complete:function(a){if(a.status===200)return d.notice("Added "+b),d.stopSpinner(),$(d.list).append(a.responseText),$(d.container).trigger("member-adder:added",b)}}),this.deactivate(),this.input.focus(),!1},a.prototype.onSubmit=function(a){a.preventDefault();if(this.isEmail($(this.input).val()))return this.onInvite(a)},a.prototype.spinner=function(){if(!$(".js-spinner").length)return $(this.input).after("<img class='js-spinner' src='"+GitHub.Ajax.spinner+"' width='16' />")},a.prototype.stopSpinner=function(){return $(".js-spinner").remove()},a.prototype.search=function(a){var b,c,d;c=$(this.container).find("ul");if(!c[0])return;return $(this.container).find(".js-member-adder-notice").removeClass("active"),b=$(this.container).find(".js-no-results").removeClass("active"),d=c.fuzzyFilterSortList(a,{limit:5}),d>0?(c.show(),$(this.container).navigation("focus"),!0):this.isEmail(a)?this.deactivate():(b.addClass("active"),!1)},a.prototype.onInvite=function(a){var b,c,d=this;a.preventDefault(),b=$(this.input).val();if(!this.isEmail(b))return;return(c=this.ajax)!=null&&c.abort(),this.spinner(),$.ajax({url:$(this.container).attr("data-invite-url"),method:"POST",data:{email:b},complete:function(a){return d.notice(a.responseText),a.status===200&&($(d.input).val(""),$(d.container).trigger("member-adder:invited",b)),d.deactivate(),d.stopSpinner()}})},a.prototype.notice=function(a){var b;return b=$(".js-member-adder-notice"),b.addClass("active"),b.text(a)},a.prototype.isEmail=function(a){return c.call(a.slice(1),"@")>=0},a.prototype.loadSuggestions=function(){var a,b=this;if(!(a=this.query))return;if(this.ajax)return;return this.spinner(),this.ajax=$.ajax({url:$(this.container).attr("data-search-url"),data:{query:a},complete:function(){return b.ajax=null,b.stopSpinner()}}),this.ajax.done(function(a){var c,d,e,f,g,h,i,j,k,l;b.query=null,c=$($.parseHTML(a)),g=c.find("li");if(!g.length)return;i=$(b.container).find("ul"),d=i.data("fuzzy-sort-items"),h={},f=[],l=d.toArray().concat(g.toArray());for(j=0,k=l.length;j<k;j++)e=l[j],h[e.textContent]||f.push(e),h[e.textContent]=!0;return i.data("fuzzy-sort-items",$(f)),b.onKeyUp()})},a}(),$.pageUpdate(function(){return new a($("input[data-member-adder]"))})}.call(this),function(){}.call(this),function(){var a,b;a=function(){var a,c,d,e,f;return e=[],a=$(".js-advanced-search-input").val(),f={Repositories:0,Users:0,Code:0},e=b($("input[type=text].js-advanced-search-prefix, select.js-advanced-search-prefix"),function(a,b,c){if(a==="")return"";b!==""&&f[c]++;if(b!=="")return""+a+b}),$.merge(e,b($("input[type=checkbox].js-advanced-search-prefix"),function(a,b,c){var d;d=$(this).prop("checked"),d!==!1&&f[c]++;if(d!==!1)return""+a+d})),c=function(a){return a.Users>a.Code&&a.Users>a.Repositories?"Users":a.Code>a.Users&&a.Code>a.Repositories?"Code":"Repositories"},d=$.trim(e.join(" ")),$(".js-type-value").val(c(f)),$(".js-search-query").val($.trim(""+a+" "+d)),$(".js-advanced-query").empty(),$(".js-advanced-query").text(""+d),$(".js-advanced-query").prepend($("<span>").text($.trim(a))," ")},b=function(a,b){return $.map(a,function(a,c){var d,e,f,g;return f=$.trim($(a).val()),d=$(a).attr("data-search-prefix"),e=$(a).attr("data-search-type"),g=function(a){return a.search(/\s/g)!==-1?'"'+a+'"':a},d===""?b.call(a,d,f,e):f.search(/\,/g)!==-1&&d!=="location"?f.split(/\,/).map(function(c,f){return b.call(a,d,g($.trim(c)),e)}):b.call(a,d,g(f),e)})},$(document).on("change input",".js-advanced-search-prefix",a),$(document).on("focusin",".js-advanced-search-input",function(){return $(this).closest(".js-advanced-search-label").addClass("focus")}),$(document).on("focusout",".js-advanced-search-input",function(){return $(this).closest(".js-advanced-search-label").removeClass("focus")}),$(document).on("click",".js-see-all-search-cheatsheet",function(){return $(".js-more-cheatsheet-info").removeClass("hidden"),!1}),$(function(){if($(".js-advanced-search-input").length)return a()})}.call(this),$(function(){$("#js-coupon-click-onload").click(),$(".selected .choose_plan").click(),$(".js-show-credit-card-form")[0]&&($.facebox({div:"#credit_card_form"}),$(document).unbind("close.facebox").bind("close.facebox",function(){window.location="/account/billing"}))}),$(document).on("click",".js-add-cc",function(){return $(document).one("reveal.facebox",function(){$("#facebox .js-thanks, #facebox .rule:first").hide()}),$.facebox({div:this.href}),!1}),$(document).on("click",".js-add-billing-contact-info",function(){return $(document).one("reveal.facebox",function(){$(".js-billing-info-field").focus()}),$.facebox({div:"#js-add-billing-contact-info-modal"}),!1}),$(document).on("click",".js-close-facebox",function(){$(document).trigger("close.facebox")}),$(document).on("click",".js-plan-change",function(a){var b=$(this).closest("tr").attr("data-name");$.facebox({div:this.hash});var c=$("#facebox");return c.find(".js-new-plan-name-val").val(b),c.find(".js-new-plan-name").text(b),c.find(".js-new-plan-card-on-file").toggle(b!=="free"),c.find(".js-new-plan-free").toggle(b=="free"),a.stopImmediatePropagation(),!1}),$(document).on("ajaxSuccess","#facebox .js-coupon-form",function(a,b){$("#facebox .content").
  html(b.responseText),$(document).one("close.facebox",function(){window.location.reload()})}).on("ajaxError","#facebox .js-coupon-form",function(a,b){return $("#facebox .content").html(b.responseText),!1}),function(){var a,b,c,d,e,f,g,h;c=function(a){var b,c,d,e,f;if(c=a.match(/\#?(?:L|-)(\d+)/gi)){f=[];for(d=0,e=c.length;d<e;d++)b=c[d],f.push(parseInt(b.replace(/\D/g,"")));return f}return[]},a=function(a){a.sort(h);switch(a.length){case 1:return"#L"+a[0];case 2:return"#L"+a[0]+"-L"+a[1];default:return"#"}},h=function(a,b){return a-b},g=!1,b=function(a){var b,c,d;c=$(".line, .line-data");if(!c.length)return;c.css("background-color","");if(a.length===1)return $("#LC"+a[0]).css("background-color","#ffc");if(a.length>1){b=a[0],d=[];while(b<=a[1])$("#LC"+b).css("background-color","#ffc"),d.push(b++);return d}},f=function(a){var d;return a==null&&(a=c(window.location.hash)),b(a),!g&&(d=$("#LC"+a[0])).length&&$(window).scrollTop(d.offset().top-$(window).height()*.33),g=!1},$(window).on("hash:change",function(){return setTimeout(f,0)}),d=function(a){var b,c;return g=!0,b=(c=$(window).scrollTop())!=null?c:0,a(),$(window).scrollTop(b)},$(document).on("mousedown",".line-number, .blob-line-nums span[rel]",function(b){var e,f;return f=c($(this).attr("rel")),b.shiftKey&&(e=c(window.location.hash),f.unshift(e[0])),d(function(){return window.location.hash=a(f)}),!1}),$(document).on("reveal.facebox",function(){var a,b;a=$("#facebox"),b=a.find(".js-jump-to-line-field"),b.focus(),a.find(".js-jump-to-line-form").on("submit",function(){var a;return a=parseInt(b.val().replace(/\D/g,"")),a&&(window.location.hash="L"+a),b.blur(),$(document).trigger("close.facebox"),!1})}),$(document).on("click",".highlight-ctags a.ctag-relative",function(b){var d;return(d=c($(this).attr("href"))).length&&(window.location.hash=a(d)),!1}),e=!1,$(document).on("click",".js-ctags-lookup-results a.js-slide-to,                         .js-ctags-search-results a.js-slide-to",function(a){return e=!0}),$.pageUpdate(function(){if(e)return f(),e=!1})}.call(this),function(){var a,b,c,d;c=!1,a=null,$.pageUpdate(function(){if(c)return setTimeout(function(){var a;if((a=$("#highlight-ctags-enabled")).length)return a.prop("checked",!0).change()},100)}),d=function(b,c){var e,f;return c==null&&(c=1e3),a?b(a):(e=$("#highlight-ctags-enabled"),f=$(".highlight-ctags").addClass("ctags-loading"),$.ajax({url:e.data("list-url"),dataType:"json",success:function(e){var g=this;if(e.tags)return a=e.tags,b(a),f.removeClass("ctags-loading");if(e.generating)return c<6e4?(c*=1.5,setTimeout(function(){return d(b,c)},c)):f.removeClass("ctags-loading")},error:function(){return f.removeClass("ctags-loading")}}))},b=function(){var a=this;return d(function(a){var b,c,d,e,f;c=[],f=$(".highlight .line > span.n, .highlight .line > span.no");for(d=0,e=f.length;d<e;d++)b=f[d],a[b.innerText]&&(b.children.length?a[b.innerText]>1&&(b.innerHTML=b.innerText,c.push(b)):c.push(b));return $(c).addClass("valid-ctag")})},$(document).on("click",".highlight-ctags .popover",function(a){return!1}),$(document).on("click",".highlight-ctags",function(a){var b;if((b=$(".highlight-ctags .visible-ctag")).length)return b.removeClass("visible-ctag").popover("destroy"),$(".highlight-ctags .popover").remove(),!1}),$(document).on("click",".highlight-ctags span.valid-ctag",function(b){var c,d,e,f;if((d=$(".highlight-ctags .visible-ctag")).length){d.removeClass("visible-ctag").popover("destroy"),$(".highlight-ctags .popover").remove();if(d[0]===b.target)return!1}return d=$(b.target),d.addClass("visible-ctag"),c=$("#highlight-ctags-enabled"),f=b.target.innerText,e=d.offset().left+d.width()>$(window).width()*.5?"left":"right",d.popover({html:!0,content:"<div class='loading'><img align='absmiddle' src='"+GitHub.Ajax.spinner+"' height='16'/>      Loading "+(a&&a[f]||"")+" definitions</div>",placement:e}).popover("show"),$.ajax({url:c.data("lookup-url")+escape(f),data:{path:c.data("path"),line:d.parents("div.line:first").attr("id").slice(2)},dataType:"html",success:function(a){return d.popover({html:!0,content:a,placement:e}).popover("show"),$(".popover .js-navigation-container").pageUpdate().navigation("focus")}}),!1}),$(document).on("change","input#highlight-ctags-enabled",function(a){var d;return d=$(".js-blob-data td > .highlight"),(c=$(a.target).is(":checked"))?(d.addClass("highlight-ctags"),b()):d.removeClass("highlight-ctags")}),$(document).on("keydown",function(a){var b;if($(a.target).is("input, textarea"))return!0;if(a.hotkey==="f"&&(b=$("#highlight-ctags-enabled")).length)return b.prop("checked",!b[0].checked).change(),!1})}.call(this),function(){var a,b,c,d,e,f,g,h,i;e=function(){var a,b,c,d,e,f,g,h,i;return b=$(".js-blob-form"),a=b.find(".js-blob-filename"),g=!a[0]||a.val()!==a.attr("data-default-value"),a[0]&&(g=g&&a.val()!=="."&&a.val()!==".."&&a.val()!==".git"&&!a.val().match(/^\s+$/)),h=b.find(".js-check-for-fork").is(":visible"),f=$(".js-blob-contents")[0],d=f.value!==f.defaultValue,c=d||$(f).attr("data-allow-unchanged")||$(f).attr("data-new-filename"),e=f.value==="",b.find(".js-blob-submit").prop("disabled",!g||h||!c||e),i=d||$(f).attr("data-allow-unchanged"),b.find(".js-blob-contents-changed").val(i)},$.pageUpdate(function(){var a;if(!(a=$(this).find(".js-blob-contents")[0]))return;return e()}),$(document).on("change",".js-blob-contents",function(){return f($(".js-blob-filename")),e()}),$(document).on("click",".js-new-blob-submit",function(){return $(this).closest("form.js-new-blob-form").submit()}),$(document).onFocusedInput(".js-blob-filename",function(){return function(){return $(".js-blob-contents").attr("data-filename",$(this).val()),d($(this).val()),f($(this))}}),$(document).onFocusedInput(".js-breadcrumb-nav",function(){return function(){return i($(this)),f($(this))}}),$(document).on("keydown",".js-breadcrumb-nav",function(a){var b,d,e;return d=$(this).caretSelection(),e=[0,0],b=$(d).not(e).length===0&&$(e).not(d).length===0,b&&a.keyCode===8&&$(this).parent().children(".separator").size()!==1&&(c($(this),!0),a.preventDefault()),f($(this))}),f=function(a){return a[0]!=null&&(h(a),g(a)),e()},i=function(a){var d,e,f,g,h,i;i=[];while(a.val().split("/").length>1)d=a.val(),f=d.split("/"),e=f[0],h=f.slice(1).join("/"),e===""||e==="."||e===".git"?(a.val(h),g=function(){return a.caret(0)},i.push(window.setTimeout(g,1))):e===".."?i.push(c(a)):i.push(b(a,e,h));return i},d=function(a){var b;return b=$(".js-gitignore-template"),/^(.+\/)?\.gitignore$/.test(a)?b.addClass("is-visible"):b.removeClass("is-visible")},g=function(a){var b,c,d,e,f,g,h,i,j,k,l,m;return d=a.closest("form"),c=$(".js-blob-contents"),b=d.find(".js-new-blob-commit-summary"),h=a.val()?"Create "+a.val():"Create new file",l=c.attr("data-old-filename"),i=$(".js-new-filename-field").val(),c.removeAttr("data-new-filename"),h=l.length&&i!==l&&a[0]!=null?(c.attr("data-new-filename","true"),f=c[0].value!==c[0].defaultValue,e=f?"Update and rename":"Rename",a.val().length&&i.length?(m=l.split("/"),j=i.split("/"),k=!0,g=m.length-1,m.forEach(function(a,b){if(b!==g&&a!==j[b])return k=!1}),m.length===j.length&&k?""+e+" "+m[g]+" to "+j[g]:""+e+" "+l+" to "+i):""+e+" "+l):l.length&&i===l?"Update "+a.val():h,b.attr("placeholder",h),$(".js-commit-message-fallback").val(h)},h=function(a){var b,c;return b=$(".breadcrumb").children("[itemscope]"),c="",b.each(function(){var a;return a=$(this),c=c+a.text()+"/"}),c+=a.val(),$(".js-new-filename-field").val(c)},c=function(a,b){var c,d;return b==null&&(b=!1),b||a.val(a.val().replace("../","")),d=function(){return a.caret(0)},a.parent().children(".separator").size()!==1&&(a.prev().remove(),c=a.prev().children().children().html(),a.prev().remove(),b&&(a.val(""+c+a.val()),d=function(){if(b)return a.caret(c.length)})),window.setTimeout(d,1)},b=function(a,b,c){var d,e,f,g,h,i;return c==null&&(c=""),b=b.replace(/[^\.-a-z_0-9]+/ig,"-"),i=a.parent().children(".bold, [itemtype]").children("a").last().attr("href"),i||(d=a.parent().children(".bold, [itemtype]").children("span").children("a").last(),e=d.data("branch"),g=d.attr("href"),i=""+g+"/tree/"+e),f="<span itemscope itemtype='http://data-vocabulary.org/Breadcrumb'><a href='"+i+"/"+b+"' class='js-slider-breadcrumb' itemscope='url'><span itemprop='title'>"+b+"</span></a></span><span class='separator'> / </span>",a.before(f),a.val(c),h=function(){return a.caret(0)},window.setTimeout(h,1)},$(document).onFocusedInput(".js-new-blob-commit-summary",function(){var a;return a=$(this).closest(".js-file-commit-form"),function(){return a.toggleClass("is-too-long-error",$(this).val().length>50)}}),a=function(a){if(a.data("checking-for-fork"))return;return e(),$.ajaxPoll({interval:2,url:a.attr("data-check-url"),success:function(){return a.hide(),e()},error:function(b){return b.status===404?this.resume():a.html("<img src='/images/modules/ajax/error.png'>\nSomething went wrong. Please fork the project, then try from your fork.")}}),a.data("checking-for-fork",!0)},$.pageUpdate(function(){var b,c,d,e;e=$(".js-check-for-fork");for(c=0,d=e.length;c<d;c++)b=e[c],a($(b))}),$(document).on("change",".js-gitignore-template input[type=radio]",function(){return $.ajax({type:"GET",url:$(this).attr("data-template-url"),success:function(a){return editor.setCode(a)}})})}.call(this),function(){$(document).on("click",".js-branch-toggle",function(){return $(".js-branches-content").toggleClass("showing-unmerged"),$(".js-branches-content").toggleClass("showing-merged"),!1}),$(document).on("ajaxSend",".js-branch-delete",function(){return $(this).addClass("disabled"),$(this).closest(".actions").find(".spinner").show()}),$(document).on("ajaxSuccess",".js-branch-delete",function(a,b,c,d){return $(this).closest("tr").fadeOut(),!1}),$(document).on("ajaxError",".js-branch-delete",function(a,b,c,d){return $(this).closest(".actions").find(".spinner").hide(),$(this).html("Couldn't delete!"),!1}),$(function(){var a,b,c,d;return b=2,a=7,d=30,c=1e4,$(".diverge-widget").each(function(){var c,e,f;return c=$(this),e=new Date(c.attr("last-updated")),f=(new Date-e)/1e3/3600/24,f<=b?c.addClass("hot"):f<=a?c.addClass("fresh"):f<=d?c.addClass("stale"):c.addClass("old")})})}.call(this),function(){$.pageUpdate(function(){var a,b;if(!(a=document.getElementById("diff-comment-data")))return;if($(a).data("commit-inline-comments-rendered"))return;return b={},$("#files.diff-view > .file > .meta").each(function(){return b[$(this).attr("data-path")]=this}),$("#diff-comment-data > table").each(function(){var a,c,d,e;return c=$(this).attr("data-path"),d=$(this).attr("data-position"),a=$(b[c]).closest(".file"),e=a.find(".data table tr[data-position='"+d+"']"),e.after($(this).find("tr").detach()),a.addClass("has-inline-notes show-inline-notes")}),$("#diff-comment-data > div").each(function(){var a;return a=$(this).attr("data-path"),$(b[a]).closest(".file").find(".file-comments-place-holder").replaceWith($(this).detach())}),$(a).data("commit-inline-comments-rendered",!0)}),$(document).on("change",".js-show-inline-comments-toggle",function(){return $(this).closest(".file").toggleClass("show-inline-notes",this.checked)}),$(document).on("keyup",function(a){var b;if(a.hotkey==="i"&&!$(a.target).is(":input"))return b=$(".js-show-inline-comments-toggle:not(:checked)").length===0,$(".js-show-inline-comments-toggle").prop("checked",!b).trigger("change")}),$(document).on("change","#js-inline-comments-toggle",function(){return $("#comments").toggleClass("only-commit-comments",!this.checked)}),$(document).on("click",".linkable-line-number",function(){return document.location.hash=this.id,!1}),$(document).on("click",".js-tag-list-toggle",function(){var a;return a=$(this),a.closest(".tag-list").find("li").show(),a.hide(),!1}),$(document).on("reveal.facebox",function(a){var b;b=$(".js-commit-contribution-status");if(!b.length)return;return $.ajax({url:b.attr("data-url"),success:function(a){return b.html(a)}})})}.call(this),function(){$(document).on("navigation:open",".commit-group-item",function(){return $(this).find(".commit-title > a:first").simulateClick(),!1}),$(document).on("navigation:keydown",".commit-group-item",function(a){if(a.hotkey==="c")return $(this).find(".commit-title > a:first").simulateClick(),!1}),$.support.pjax&&$(document).on("click",".js-pjax-commit-title > a.message",function(a){$.pjax.click(a,$(this).closest("[data-pjax-container]"))})}.call(this),$(function(){if(!$(document.body).hasClass("page-compare"))return!1;var a=$("#compare").data("base"),b=$("#compare").data("head"),c=null;$(".compare-range .commit-ref.to").click(function(){return c="end",$.facebox({div:"#compare_chooser"}),!1}),$(".compare-range .commit-ref.from").click(function(){return c="start",$.facebox({div:"#compare_chooser"}),!1});var d=function(){var d=$("#facebox .ref-autocompleter"),e=$("#facebox button.choose-end"),f=$("#facebox button.refresh");d.val(c=="start"?a:b),$("#facebox .mode-upper").text($.capitalize(c)),$("#facebox .mode-lower").text(c),c=="start"?e.show():e.hide()},e=function(){var e=$("#facebox .ref-autocompleter");if(e.length==0)return;var f=$("#facebox .commit-preview-holder"),g=$("#facebox button.refresh"),h=$(".compare-range").attr("url-base");d(),g.click(function(){return c=="start"?a=e.val():b=e.val(),$(document).trigger("close.facebox"),document.location=h+a+"..."+b,!1}),e.click(function(){return this.focus(),this.select(),!1});var i=!1,j=null,k=function(){i&&j.abort(),i=!0,j=$.get(f.attr("url_base")+e.val(),null,function(a){a.length>0&&(f.html(a),f.find("a").attr("target","_blank"),f.pageUpdate()),i=!1})};k();var l=e.val(),m=null,n=function(){if(l!=e.val()||m==e.val()){l=e.val();return}k(),m=e.val()};e.keyup(function(){l=this.value,setTimeout(n,1e3)}),e.click()};$(document).bind("reveal.facebox",e),a==b&&$(".compare-range .commit-ref.from").click()}),$(document).on("hash:change","#files_bucket",function(a){$(a.target).is(":visible")||$('a.tabnav-tab[href="#files_bucket"]').click()}),function(){var a;a=function(a){var b;return a==null&&(a=document.location.search.substr(1)),b={},$.each(a.split("&"),function(a,c){var d,e,f;return f=c.split("="),d=f[0],e=f[1],b[d]=decodeURIComponent(e.replace(/\+/g," "))}),b},$(document).on("navigation:open",".ctags-search-result",function(a){return $(".js-ctags-search-form input.query").attr("placeholder",$.trim($(this).find(".name > .full").text())),$(this).find("a").simulateClick()}),$(document).on("click",".js-ctags-search-results a.filter-item",function(b){var c,d;return d=a(this.href.split("?",2)[1]||""),c=$(".js-ctags-search-form"),c.find("input[name=l]").val(d.l),c.find("input[name=k]").val(d.k),c.submit(),!1}),$(document).on("submit","form.js-ctags-search-form[data-ajax]",function(a){var b,c;c=$(this);if(b=$(".js-ctags-search-results[data-ajax-container]")[0])return c.addClass("pjax-active"),$.ajax({url:c.attr("action"),data:c.serialize()}).always(function(){return c.removeClass("pjax-active")}).done(function(a,c){if(c==="success")return b.innerHTML=a,$(b).pageUpdate()}),!1}),$(document).on("focusin",".js-ctags-search-form input.query",function(a){var b,c;return b=$(this),b.on("blur.ctags",function(){return b.off(".ctags")}),c=null,b.on("input.ctags",function(a){return c&&clearTimeout(c),c=setTimeout(function(){return b.closest("form").submit()},150)}),b.on("keydown.ctags",function(a){return a.hotkey==="esc"&&(history.back(),a.preventDefault()),!0})}),$.pageUpdate(function(){var a,b,c,d,e,f,g;$(".js-ctags-search-results .js-navigation-container").navigation("focus"),g=$(".js-ctags-search-results .ctags-search-result");for(e=0,f=g.length;e<f;e++)a=g[e],d=$(a),c=d.width()-d.find(".name").width()-10,d.find(".link").css("max-width",""+c+"px");b=$(".js-ctags-search-form"),b.find("input.query").attr("placeholder","Search definitions...").focus(),b.find("input.query:focus").length||b.find("input.query").focus();if($(".js-ctags-search-generating").length)return setTimeout(function(){return b.submit()},5e3)})}.call(this),$(function(){$("#your_repos").repoList({selector:"#repo_listing",ajaxUrl:"/dashboard/ajax_your_repos"}),$("#watched_repos").repoList({selector:"#watched_repo_listing",ajaxUrl:"/dashboard/ajax_watched_repos"});if($("#org_your_repos").length>0){var a=location.pathname;a[a.length-1]=="/"&&(a=a.slice(0,a.length-1)),$("#org_your_repos").repoList({selector:"#repo_listing",ajaxUrl:a+"/ajax_your_repos"})}}),function(){$(function(){var a;a=$(".mini-nav, .repo-container .menu");if(a.length)return $.each(a,function(a,b){return new FastClick(b)})}),$(document).on("click",".js-directory-link",function(a){if(a.which===2||a.metaKey||a.ctrlKey)return;return $(this).closest("tr").addClass("is-loading"),$(document.body).addClass("disables-context-loader")}),$(document).on("focusin",".js-url-field",function(){var a;return a=this,setTimeout(function(){return $(a).select()},0)}),$(document).on("click",".js-repo-home-link, .js-repository-container-pjax a",function(a){var b,c;if($(this).hasClass("js-disable-pjax"))return;return c=!1,b=$(".repo-container"),$.pjax.click(a,{container:b,scrollTo:c})}),$.pageChange(function(){var a;if($(".kill-the-chrome").length===0)return;$(".mini-nav .selected").removeClass("selected"),a=$(this).find(".repo-container"),a.length===0&&$(this).hasClass("repo-container")&&(a=$(this));if(a.length===0)return;return $(".repository-with-sidebar").length>0?$(document.body).addClass("with-custom-nav"):$(document.body).removeClass("with-custom-nav")})}.call(this),function(){var a,b,c;c=null,$(document).on("ajaxBeforeSend",".js-discussion-update",function(a,b){c=b}),$(document).on("ajaxSuccess",".js-discussion-update",function(a,c,d,e){b(e)}),$(document).on("ajaxComplete",".js-discussion-update",function(){c=null}),$(document).on("socket:message",".js-comment-channel",function(){if(c)return;return c=$.ajax({url:$(this).attr("data-url"),context:this,beforeSend:function(a){var b;if(b=$("#js-discussion-last-modified").attr("datetime"))return a.setRequestHeader("X-Discussion-Last-Modified",b)},success:function(a){if(a)return b(a)},complete:function(){return c=null}})}),$(document).on("ajaxBeforeSend",".js-new-comment-form",function(a,b){var c;if(c=$("#js-discussion-last-modified").attr("datetime"))return b.setRequestHeader("X-Discussion-Last-Modified",c)}),b=function(b){var c,d,e,f;return d=function(){var a;return b.discussionStats!=null&&$(".discussion-stats").html(b.discussionStats),b.discussion!=null&&$(".js-discussion").append(b.discussion),b.formActions!=null&&$(".js-new-comment-form .form-actions").html(b.formActions),a=$("#js-pull-merging .merge-form"),b.merging!=null&&(!a.is(":visible")||a.is(".disabled"))&&$("#js-pull-merging").html(b.merging),$(".js-new-comment-form .js-comment-field").trigger("validation:field:change"),$("#discussion_bucket").pageUpdate(),$("#show_issue").pageUpdate()},c=$(".js-discussion").next(),f=$(document.activeElement).is("textarea"),e=c.offset().top<a,f||e?c.preservingScrollPosition(d):d()},a=0,$(function(){if(!$(".js-discussion-update").length)return;return $(document).on("mousemove",function(b){return a=b.pageY})})}.call(this),function(){$(document).on("click",".js-zen-mode",function(){return $(document.body).hasClass("zen")?($(document.body).removeClass("zen"),$(document).off("keydown.zenMode")):($(document.body).addClass("zen"),$(document).on("keydown.zenMode",function(a){if(a.hotkey==="esc")return $(document.body).removeClass("zen"),!1})),!1})}.call(this),function(){var a,b,c;b=function(b,c){return b.closest(".js-label-editor").find(".js-color-editor-bg").css("background-color",c),b.css("color",a(c,-0.5)),b.css("border-color",c)},c=function(a){var b,c;return b="#eee",c=$(a).closest(".js-color-editor"),c.find(".js-color-editor-bg").css("background-color",b),a.css("color","#c00"),a.css("border-color",b)},a=function(a,b){var c,d,e;a=String(a).toLowerCase().replace(/[^0-9a-f]/g,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0,e="#",c=void 0,d=0;while(d<3)c=parseInt(a.substr(d*2,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length),d++;return e},$(document).on("focusin",".js-color-editor-input",function(){var a,d;return d=$(this),a=$(this).closest(".js-label-editor"),d.on("throttled:input.colorEditor",function(e){var f;return d.val().charAt(0)!=="#"&&d.val("#"+d.val()),a.removeClass("is-valid is-not-valid"),f=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(d.val()),a.find(".js-label-editor-submit").toggleClass("disabled",!f),f?(a.addClass("is-valid"),b(d,d.val()),$(".js-color-cooser-color").removeClass("selected")):(a.addClass("is-not-valid"),c(d))}),d.on("blur.colorEditor",function(){return d.off(".colorEditor")})}),$(document).on("menu:activate",".js-editable-label",function(){var a;a=$(this).find(".js-color-editor-input");if(!$(this).find(".js-color-cooser-color").filter(".selected").length)return b(a,a.val()),$(this).find(".js-label-editor").addClass("is-valid")}),$(document).on("menu:deactivate",".js-editable-label",function(){var a,b,c;return c=$(this).find(".js-color-editor-input"),b=$(this).find(".js-label-editor"),c.attr("style",""),b.removeClass("is-valid is-not-valid"),b.find(".js-color-editor-bg").attr("style",""),c.val(c.attr("data-original-color")),a=$(".js-color-cooser-color"),a.removeClass("selected"),a.filter("[data-selected]").addClass("selected")}),$(document).on("click",".js-color-cooser-color",function(){var a,c,d;return a=$(this).closest(".js-label-editor"),c="#"+$(this).data("hex-color"),d=a.find(".js-color-editor-input"),a.find(".js-label-editor-submit").removeClass("disabled"),a.removeClass("is-valid is-not-valid"),d.val(c),b(d,c)}),$(document).on("submit",".js-label-editor form",function(){var a,b;return a=$(this).find(".js-color-editor-input"),b=a.val(),b.length<6&&(b=b[0]+b[0]+b[1]+b[1]+b[2]+b[2]),a.val(b.replace("#",""))}),$(function(){var a;a=$("#issues_list");if(!a.length)return;return a.selectableList(".js-color-chooser",{wrapperSelector:".js-color-cooser-color",mutuallyExclusive:!0})})}.call(this),function(){$(window).on("hash:change",/\/issues#issue\/(\d+)$/,function(a,b){var c,d;return d=b[0],c=b[1],window.location=a.newURL.replace(/\/?#issue\/.+/,"/"+c)}),$(window).on("hash:change",/\/issues#issue\/(\d+)\/comment\/(\d+)$/,function(a,b){var c,d,e;return e=b[0],d=b[1],c=b[2],window.location=a.newURL.replace(/\/?#issue\/.+/,"/"+d+"#issuecomment-"+c)})}.call(this),function(){$(document).on("menu:activate",".js-issue-mass-assign",function(){var a,b,c;a=$(this).find("form"),a.find(".js-issue-number").remove(),c=function(){var a,c,d,e;d=$(".js-issues-list-checkbox").filter(":checked"),e=[];for(a=0,c=d.length;a<c;a++)b=d[a],e.push($("<input>",{type:"hidden","class":"js-issue-number",name:"issues[]",value:$(b).val()}));return e}(),a.append(c)}),$(document).on("ajaxSuccess",".js-issue-mass-assign",function(){return $.pjax.reload($("#issues_list"))})}.call(this),function(){var a;$(document).on("selectmenu:selected",".js-composer-assignee-picker .js-navigation-item",function(){var a,b,c,d=this;return a=$(this).closest(".js-infobar"),b=$(this).find("input[type=radio]"),c=$(this).hasClass("js-clear-assignee"),a.find(".js-composer-assignee-picker").toggleClass("is-showing-clear-item",!c),a.find(".js-assignee-infobar-item-wrapper").html(function(){return c?"No one will be assigned":"<a href='/"+b.val()+"' class='css-truncate-target'>"+b.val()+"</a> will be assigned"})}),$(document).on("selectmenu:selected",".js-assignee-picker .js-navigation-item",function(){var b,c=this;return b=$(this).closest("form"),a(b,function(){var a,b;return a=$(c).closest(".js-assignee-picker"),b=$(c).hasClass("js-clear-assignee"),a.toggleClass("is-showing-clear-item",!b),$(".js-assignee-infobar-item-wrapper").html(function(){var a;return b?"No one is assigned":(a=$(c).find("input[type=radio]"),"<a href='/"+a.val()+"' class='css-truncate-target'>"+a.val()+"</a> is assigned")})})}),$(document).on("selectmenu:selected",".js-composer-milestone-picker .js-navigation-item",function(){var a,b,c,d,e,f=this;return a=$(this).closest(".js-infobar"),d=$(this).find("input[type=radio]"),b=a.find('input[name="issue[milestone_id]"]'),c=a.find('input[name="new_milestone_title"]'),$(this).hasClass("js-new-item-form")?(b.val("new"),c.val($(this).find(".js-new-item-name").html())):b.val(d[0].value),e=$(this).hasClass("js-clear-milestone"),a.find(".js-composer-milestone-picker").toggleClass("is-showing-clear-item",!e),$(".js-composer-milestone-title").html(function(){return e?"No milestone":'Milestone: <strong class="css-truncate-target">'+$(f).find(".js-milestone-title").html()+"</strong>"})}),$(document).on("selectmenu:selected",".js-milestone-picker .js-navigation-item",function(){var b,c=this;return b=$(this).closest("form"),a(b,function(a){var b,d,e;d=$(c).closest(".js-milestone-picker"),e=$(c).hasClass("js-clear-milestone"),d.toggleClass("is-showing-clear-item",!e),b=$(".js-milestone-infobar-item-wrapper");if(b.length)return b.html(a.infobar_body),d.menu("deactivate"),d.find(".js-milestone-picker-body").html(a.select_menu_body)})}),$(document).on("click",".js-update-labels",function(b){var c,d=this;return c=$(this).closest("form"),a(c,function(a){return $(".discussion-labels > .color-label-list").html(a.labels),$(d).menu("deactivate")}),!1}),$(document).on("focusin",".js-label-select-menu .js-filterable-field",function(){var a;return a=$(this),a.on("keydown.labelPicker",function(a){if(a.hotkey==="enter")return!1}),a.on("blur.labelPicker",function(){return a.off(".labelPicker")})}),a=function(a,b){var c;if(!(c=a[0]))return;return $.ajax({context:c,type:a.attr("method"),url:a.attr("action"),data:a.serialize(),success:b})}}.call(this),function(){$(document).on("click",".js-issues-sort .js-navigation-item",function(){return $(this).menu("deactivate")}),$(function(){var a,b;a=$("#issues_list");if(!a.length)return;return b=function(){return $.pjax.reload(a)},a.on("navigation:keydown",".js-issues-list .js-list-browser-item",function(a){if(a.hotkey==="x")return $(this).click().trigger("change")}),a.selectableList(".js-selectable-issues",{wrapperSelector:"",itemParentSelector:".js-list-browser-item",enableShiftSelect:!0,ignoreLinks:!0}),a.on("click",".js-milestone-issue-filter .js-navigation-item",function(){return $(this).menu("deactivate")}),a.selectableList(".js-issue-sidebar .js-color-label-list"),a.on("click",".js-editable-labels-container .js-manage-labels",function(){var a,c,d,e;return a=$(this),c=a.closest(".js-editable-labels-container"),e=c.find(".js-editable-labels-show"),d=c.find(".js-editable-labels-edit"),e.is(":visible")?(e.hide(),d.show(),a.addClass("selected"),$(document).on("keydown.manage-labels",function(b){if(b.keyCode===27)return a.click()})):b(),!1}),a.on("ajaxSuccess",".js-color-label-delete",function(){return $(this).closest(".color-label").hide()}),a.on("change",".select-toggle-check",function(){var b;return b=a.find(".js-list-browser-item.selected").length,a.find(".js-mass-assign-button").toggleClass("disabled",!b)}),a.find(":checked").removeProp("checked"),a.on("click",".js-issues-list-close",function(){var c;return $.ajax({type:"PUT",url:$(this).attr("data-url"),data:{issues:function(){var b,d,e,f;e=a.find(".js-issues-list :checked"),f=[];for(b=0,d=e.length;b<d;b++)c=e[b],f.push($(c).val());return f}()},success:b}),!1}),a.on("ajaxSuccess",".js-navigation-item",b),a.pageUpdate()})}.call(this),$(function(){var a=$("#js-new-issue-form");if(a.length==0)return;$(a).on("click",".js-composer-labels",function(a){a.preventDefault()}),a.selectableList("ul.color-label-list")}),function(){$(function(){var a;if($(".js-leaving-form")[0])return a=function(){var a;return a=new WufooForm,a.initialize({userName:"github",formHash:"q7x4a9",autoResize:!0,height:"504",ssl:!0}),$(".js-leaving-form").html(a.generateFrameMarkup())},function(){var b,c;return b=document.location.protocol==="https:"?"https://secure.":"http://",c=""+b+"wufoo.com/scripts/embed/form.js",$.getScript(c,a)}()})}.call(this),function(){$(document).on("ajaxSuccess",".js-milestones-assign, .js-milestones-unassign",function(){return window.location.reload()})}.call(this),DateInput.prototype.resetDate=function(){$(".date_selector .selected").removeClass("selected"),this.changeInput("")},$(function(){$("input.js-date-input").each(function(){var a=new DateInput(this);a.hide=$.noop,a.show(),$(this).hide(),$(".date_selector").addClass("no_shadow")}),$("label.js-date-input a").click(function(a){var b=$("input.js-date-input").data("datePicker");return b.resetDate(),!1})}),function(){var a;a=function(a){var b;if($(a).is(".read"))return;return $(a).toggleClass("unread read"),b=$(a).closest(".js-notifications-browser").find(".js-notifications-unreadcount"),b.text(b.text()-1)},$(document).on("click",".js-notification-target",function(){return a($(this).closest(".js-notification"))}),$(document).on("ajaxSuccess",".js-delete-notification",function(){return a($(this).closest(".js-notification"))}),$(document).on("ajaxSuccess",".js-mute-notification",function(){var b;return a($(this).closest(".js-notification")),b=$(this).closest(".js-notification"),b.is(".muted")?this.action=this.action.replace("unmute","mute"):this.action=this.action.replace("mute","unmute"),b.toggleClass("muted")}),$(document).on("ajaxSuccess",".js-mark-visible-as-read",function(){var a;return a=$(this).closest(".js-notifications-browser"),a.find(".unread").toggleClass("unread read"),a.find(".js-notifications-unreadcount").text(0),a.find(".js-mark-as-read-confirmation").show()}),$(document).on("navigation:keydown",".js-notification",function(a){var b;switch(a.hotkey){case"I":case"e":case"y":return $(this).find(".js-delete-notification").submit(),!1;case"M":return $(this).find(".js-mute-notification").submit(),!1;case"o":case"enter":return b=$(this).find(".js-notification-target"),b.click(),window.location=b.attr("href"),!1}}),$(document).on("ajaxBeforeSend",".js-notifications-subscription",function(){return $(this).find(".js-spinner").show()}),$(document).on("ajaxComplete",".js-notifications-subscription",function(){return $(this).find(".js-spinner").hide()})}.call(this),function(){$(document).on("focusin","#organization_login",function(){var a;return a=$(this).closest("dd").find(".js-field-hint-name"),$(this).on("input.organizationLogin",function(){return a.text($(this).val())}),$(this).on("blur.organizationLogin",function(){return $(this).off(".organizationLogin")})}),$(function(){var a;if(!(a=document.getElementById("organization-transforming")))return;return $.ajaxPoll({url:$(a).attr("data-url"),success:function(a,b,c){if(c.status===201)return window.location="/login"}})})}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;b<c;b++)if(b in this&&this[b]===a)return b;return-1};$(document).on("filterable:change",".js-member-search-name",function(){return $(".js-member-list:visible").hasClass("filterable-empty")?$(".js-details-container").addClass("no-results"):$(".js-details-container").removeClass("no-results"),$(".js-add-member").val($(".js-member-search-name").val()),$(".js-add-member").trigger("keyup")}),$(document).on("focus",".js-add-member, .js-member-search-name",function(b){return $(document).on("keyup.add-member",".js-add-member",function(b){var c,d;return c=$(".js-add-member-button"),d=$(b.target).val(),a.call(d.slice(1),"@")>=0?(c.val("Invite"),c.removeClass("disabled")):(c.val("Add"),c.addClass("disabled"))})}),$(document).on("blur",".js-add-member, .js-member-search-name",function(a){return $(document).off(".add-member")}),$(document).on("member-adder:invited",".js-add-member-form",function(a,b){var c;return c=$(".js-add-member-button"),c.val("Add"),c.addClass("disabled")})}.call(this),function(){$(document).on("throttled:input",".js-repo-search",function(){var a,b;a=$(this);if(a.val().trim())return a.closest(".js-repo-search").addClass("is-loading"),b=$.ajax({url:a.data("search-url")+"?query="+a.val(),method:"GET"}),b.complete(function(b){return a.closest(".js-repo-search").removeClass("is-loading"),$(".js-repo-list").hide(),$(".js-repo-search-results").html(b.responseText),$(".pagination").hide()})}),$(document).on("keyup",".js-repo-search",function(){if(!$(this).val().trim())return $(".js-repo-list").show(),$(".js-repo-search-results").html(""),$(".pagination").show()})}.call(this),function(){$(document).on("ajaxBeforeSend",".js-delete-team",function(){return $(this).addClass("disabled")}),$(document).on("ajaxSuccess",".js-delete-team",function(){return $(this).closest(".js-team").remove()}),$(document).on("click",".js-show-member",function(){var a,b,c;return a=$(this),b=a.closest(".js-org-member"),b.addClass("is-loading"),c=$.ajax({url:a.data("show-url"),method:"GET"}),c.always(function(a){return $("#js-member-show").html(a),b.removeClass("is-loading")}),!1}),$(document).on("click",".js-cancel-note",function(
  ){var a,b;return b=$(this).closest(".js-uploadable-container"),b.removeClass("is-default"),$(".js-note-form",b).removeClass("active"),a=$(".js-note-body",b),a.css({height:"1em"}),!1}),$(document).on("focus",".js-note-body",function(){return $(this).closest(".js-uploadable-container").addClass("is-default"),$(this).closest(".js-note-form").addClass("active")}),$(document).on("ajaxBeforeSend",".js-note-form",function(){return $(".js-note-body").val().trim()&&!$(this).hasClass("is-submitting")?$(this).addClass("is-submitting"):($(".js-note-body").focus(),!1)}),$(document).on("ajaxSuccess",".js-note-form",function(a,b,c,d){return $(this).closest(".js-uploadable-container").removeClass("is-default"),$(this).removeClass("active"),$(this).removeClass("is-submitting"),$(".js-activity-list").prepend(d),$(".js-note-body",this).val(""),$(".js-note-body",this).css({height:"1em"})}),$(document).on("ajaxSuccess",".js-delete-note",function(a,b,c,d){return $(this).closest(".js-note").remove()}),$(document).on("click",".js-toggle-note-comments",function(a,b,c,d){var e;return e=$(this).closest(".js-note"),$(".js-note-comments",e).toggleClass("active"),$(".js-comment-body",e).focus(),!1}),$(document).on("focus",".js-comment-body",function(){return $(this).closest(".js-note-comment-form").addClass("active")}),$(document).on("ajaxBeforeSend",".js-note-comment-form",function(){if(!$(".js-comment-body").val().trim())return $(".js-comment-body").focus(),!1}),$(document).on("ajaxSuccess",".js-note-comment-form",function(a,b,c,d){var e;return e=$(this).closest(".js-note"),$(".js-comment-list",e).append(d),$(".js-comment-body",e).val("")}),$(document).on("ajaxSuccess",".js-delete-note-comment",function(a){return $(this).closest(".js-note-comment").remove(),!1}),$(document).on("click",".js-toggle-note-star",function(a){var b,c;return b=$(this),b.toggleClass("active"),c=b.next(".js-note-starred-users"),b.hasClass("active")?(c.prepend($("<img class='starred-user' src='https://github.com/"+c.data("login")+".png' />")),$.ajax({url:b.data("star-path"),method:"POST"})):(c.find("img[src*="+c.data("login")+"]").remove(),$.ajax({url:b.data("unstar-path"),method:"POST"})),!1})}.call(this),function(){var a,b;a=function(a,b){var c;c=$(a).closest(".js-edit-in-place-container"),c.children().toggleClass("active");if(!b)return c.find("input").focus()},b=function(){var b,c,d=this;return b=$(this),b.val()===b.prev("h2").text()?a(this):(b.spin(),c=$.ajax({url:b.data("url"),data:{"team[description]":b.val()},method:"PUT"}),c.always(function(){return b.prev("h2").text(b.val().trim()||b.data("default-description")),b.stopSpin(),a(d)}),!1)},$(document).on("click",".js-team-description h2",function(){return a(this)}),$(document).on("blur",".js-team-description input",function(){return b.call(this)}),$(document).on("keypress",".js-team-description input",function(a){if(a.which!==13)return;return b.call(this)}),$(document).on("keyup",".js-edit-team-name",function(){var a;return a=/[^0-9A-Za-z_\.]/g,$(this).val($(this).val().replace(a,"-"))})}.call(this),function(){$(document).on("filterable:change",".js-team-search-name",function(){return $(".js-team-list:visible").hasClass("filterable-empty")?$(".js-details-container").addClass("no-results"):$(".js-details-container").removeClass("no-results"),$(".js-new-team-name").val($(".js-team-search-name").val()),$(".js-new-team-name").trigger("keyup")}),$(document).on("ajaxBeforeSend",".js-create-team",function(a,b,c,d){var e;return e=$(".js-new-team-name",this).val(),e.trim()?($(this).addClass("is-loading"),$(this).find(".js-new-team-name",this).val(""),$(".js-team-search-name").val(""),$(".js-team-search-name").trigger("filterable:change"),$(this).closest(".js-details-container").removeClass("no-results open")):!1}),$(document).on("ajaxSuccess",".js-create-team",function(a,b,c,d){return $(".js-team-list").prepend(d),$(this).removeClass("is-loading")}),$(document).on("keyup",".js-new-team-name",function(){var a,b,c;a=$(this),b=/[^0-9A-Za-z_\.]/g,c=$(".js-warning",a.closest(".js-create-team")),$(".js-actual-team-name").val(a.val().replace(b,"-"));if(!a.val())return;c.html("Will be created as <code>"+a.val().replace(b,"-")+"</code>");if(!b.test(a.val()))return c.fadeOut(200);if(!c.is(":visible"))return c.fadeIn(200)}),$(document).on("click",".js-toggle-all-teams",function(){return $(".js-all-teams").toggle(),$(".js-your-teams").toggle(),$(".js-team-search-name").toggle(),!1})}.call(this),function(){var a,b,c;c=function(a){return a.status===500?"Oops, something went wrong.":a.responseText},a=0,$(document).on("ajaxSend",".js-cleanup-pull-request",function(){return $(this).removeClass("error"),$(this).addClass("disabled"),$(this).find(".button").addClass("disabled")}),$(document).on("ajaxComplete",".js-cleanup-pull-request",function(){return $(this).removeClass("disabled"),$(this).find(".button").removeClass("disabled")}),$(document).on("ajaxSuccess",".js-cleanup-pull-request",function(b,c,d,e){return $(this).find(".message").html(c.responseText),a===1?a=0:($(this).find(".merge-branch").removeClass("merging").addClass("deleted"),$(this).find(".button").hide())}),$(document).on("ajaxError",".js-cleanup-pull-request",function(a,b){return $(this).addClass("error"),$(this).find(".js-cleanup-error-message").html(c(b)),!1}),b=function(a,b){var d;d=$(document).find(".js-head-ref-pull-request").show().find(".message");if(b)return d.html(c(b))},$(document).on("ajaxSend",".js-restore-head-ref",function(){return $(this).hide(),$(this).next().show(),b(this)}),$(document).on("ajaxSuccess",".js-restore-head-ref",function(c,d,e,f){var g,h,i,j;return b(this,d),j=$(this),j.parent().hide(),i=j.closest(".mergeable"),i.removeClass("deleted"),h=j.closest(".merge-branch"),h.hasClass("mergeable-dirty")||i.addClass("merging"),g=i.find(".button"),g.show().removeClass("disabled"),a=1,!0}),$(document).on("ajaxError",".js-restore-head-ref",function(a,c){return b(this,c),!1})}.call(this),function(){$(document).on("ajaxSend",".js-merge-pull-request",function(){return $(this).removeClass("error"),$(this).addClass("disabled"),$(this).find(".js-button-confirm-merge").text("Merging...").addClass("disabled")}),$(document).on("ajaxComplete",".js-merge-pull-request",function(){return $(this).removeClass("disabled"),$(this).find(".js-button-confirm-merge").text("Merged!").removeClass("disabled")}),$(document).on("ajaxError",".js-merge-pull-request",function(a,b){return $(this).addClass("error"),$(this).find(".js-merge-error-message").text(b.responseText),!1})}.call(this),function(){var a;$(document).on("click",".js-new-pull-tab",function(){return $(this).closest(".js-pull-tabs").find("a").removeClass("selected"),$(this).addClass("selected"),$("#preview_discussion_bucket, #discussion_bucket, #commits_bucket, #files_bucket").hide(),$(this.hash).show(),!1}),a=function(a){return $(a.relatedTarget).is(".js-pull-range-target")},$(document).on("pjax:beforeSend","#js-repo-pjax-container",function(b){var c;if(a(b)){c=b.relatedTarget,$(c).menu("deactivate");if($(this).find("form").hasDirtyFields())return form.action=c.href,form.noValidate=!0,$(form).submit(),!1}}),$(document).on("pjax:send","#js-repo-pjax-container",function(b){if(a(b))return $(this).find(".pull-heading").addClass("loading")}),$(document).on("pjax:timeout","#js-repo-pjax-container",function(b){if(a(b))return!1})}.call(this),function(){$(document).on("hash:change",".outdated-diff-comment-container",function(){return $(this).addClass("open")}),$(document).on("ajaxSuccess",".js-inline-comment-form",function(){return $(this).closest("#discussion_bucket").length?$("#files_bucket").remove():$("#discussion_bucket").remove()}),$(document).on("socket:message",".js-pull-request-stale-files",function(){return $("#files_bucket").addClass("is-stale").pageUpdate()})}.call(this),function(){$(document).on("change",".js-pulse-period",function(a){var b;return b=$(a.target).attr("data-url"),$.pjax({url:b,container:"#js-repo-pjax-container"})})}.call(this),function(){$(document).on("navigation:open",".js-create-branch",function(){return $(this).submit()}),$(document).on("navigation:open",".js-create-tag",function(){var a,b,c,d,e,f;return b=$(this),d=$(".js-select-button"),c=$(".js-spinner"),a=$(".js-error"),e=$(".js-new-item-value").val(),f=$(".js-create-tag").attr("data-url"),d.text("Creating tag..."),c.show(),a.hide(),$.ajax({url:f,type:"POST",data:{tag_name:e},success:function(){var a,c;d.text(e),c=b.closest(".select-menu-list").find(".select-menu-item-template");if(c.length)return a=c.clone().removeClass("select-menu-item-template").addClass("selected"),a.insertBefore(c),a.find(".js-select-button-text").text(e)},complete:function(){return c.hide()},error:function(){return a.show(),d.text("No tag selected")}}),!1})}.call(this),function(){$.pageUpdate(function(){var a,b;if(!(a=$("#repo_details")[0]))return;b=!window.location.pathname.match(/\/(blob|find)\//),$(a).toggle(b),$(".pagehead ul.tabs").toggleClass("with-details-box",b)})}.call(this),function(){var a,b=this;a=function(){function a(){var b=this;this.validate=function(){return a.prototype.validate.apply(b,arguments)},this.updateUpsell=function(){return a.prototype.updateUpsell.apply(b,arguments)},this.selectedPrivacyToggleElement=function(){return a.prototype.selectedPrivacyToggleElement.apply(b,arguments)},this.handlePrivacyChange=function(c,d){return c==null&&(c=b.selectedPrivacyToggleElement()),d==null&&(d=null),a.prototype.handlePrivacyChange.apply(b,arguments)},this.handleOwnerChange=function(){return a.prototype.handleOwnerChange.apply(b,arguments)},this.elements={ownerContainer:$(".js-owner-container"),iconPreviewPublic:$(".js-icon-preview-public"),iconPreviewPrivate:$(".js-icon-preview-private"),upgradeUpsell:$("#js-upgrade-container").hide(),upgradeConfirmationCheckbox:$(".js-confirm-upgrade"),upsells:$(".js-upgrade"),upsellCardsSelect:$(".cards_select"),privacyToggles:$(".js-privacy-toggle"),privateRadio:$(".js-privacy-toggle[value=false]"),publicRadio:$(".js-privacy-toggle[value=true]"),repoNameField:$("input[type=text].js-repo-name"),form:$("#new_repository"),ignoreContainer:$(".js-ignore-container"),autoInitCheckbox:$(".js-auto-init-checkbox"),teamBoxes:$(".js-team-select"),suggestion:$(".js-reponame-suggestion")},this.current_login=$("input[name=owner]:checked").prop("value"),this.privateRepo=!1,this.autocheckURL=this.elements.repoNameField.attr("data-autocheck-url"),this.changedPrivacyManually=!1,this.elements.teamBoxes.hide(),this.elements.ignoreContainer.on("change","input[type=radio]",function(){return $(".js-auto-init-checkbox").prop("checked",!0)}),this.elements.ownerContainer.on("change","input[type=radio]",this.handleOwnerChange),this.elements.privacyToggles.on("change",function(a){return b.handlePrivacyChange(a.targetElement,a)}),this.elements.repoNameField.on("textchange",function(a){return $(a.target).removeClass("is-autocheck-successful"),b.validate()}),this.elements.upgradeUpsell.on("change textchange","input",this.validate),this.elements.form.on("repoform:validate",this.validate),this.elements.suggestion.on("click",function(a){var c;return c=b.elements.repoNameField,c.val($(a.target).text()),c.trigger("change")}),this.handleOwnerChange(),this.updateUpsell(),this.validate()}return a.prototype.handleOwnerChange=function(){var a,b,c;return this.current_login=$("input[name=owner]:checked").prop("value"),b=""+this.autocheckURL+"?owner="+encodeURIComponent(this.current_login),this.elements.repoNameField.attr("data-autocheck-url",b),this.elements.repoNameField.trigger("change"),c=this.elements.ownerContainer.find(".select-menu-item.selected"),this.elements.teamBoxes.hide().find("input, select").prop("disabled",!0),a=this.elements.teamBoxes.filter("[data-login="+this.current_login+"]"),a.show().find("input, select").prop("disabled",!1),this.changedPrivacyManually||(c.attr("data-default")==="private"?this.elements.privateRadio.prop("checked","checked").change():this.elements.publicRadio.prop("checked","checked").change()),this.handlePrivacyChange(),c.attr("data-permission")==="yes"?($(".with-permission-fields").show(),$(".without-permission-fields").hide()):($(".with-permission-fields").hide(),$(".without-permission-fields").show()),this.updateUpsell()},a.prototype.handlePrivacyChange=function(a,b){return a==null&&(a=this.selectedPrivacyToggleElement()),b==null&&(b=null),b&&!b.isTrigger&&(this.changedPrivacyManually=!0),a.val()==="false"?(this.privateRepo=!0,this.elements.upgradeUpsell.show(),this.elements.upgradeUpsell.find("input[type=checkbox]").prop("checked","checked"),this.elements.iconPreviewPublic.hide(),this.elements.iconPreviewPrivate.show(),this.elements.upgradeUpsell.find(".js-cc-upgrade").length?this.elements.form.attr("action",this.elements.form.attr("data-tr-url")):this.elements.form.attr("action",this.elements.form.attr("data-url")),this.elements.upsellCardsSelect.cardsSelect()):(this.privateRepo=!1,this.elements.upgradeUpsell.hide(),this.elements.upgradeUpsell.find("input[type=checkbox]").prop("checked",null),this.elements.form.attr("action",this.elements.form.attr("data-url")),this.elements.iconPreviewPrivate.hide(),this.elements.iconPreviewPublic.show()),this.validate()},a.prototype.selectedPrivacyToggleElement=function(){return this.elements.privateRadio.is(":checked")?this.elements.privateRadio:this.elements.publicRadio},a.prototype.updateUpsell=function(){var a;return a=this.elements.upsells.filter("[data-login="+this.current_login+"]"),this.elements.upgradeUpsell.html(a),this.elements.upgradeUpsell.find(".js-cc-upgrade").length&&this.elements.privateRadio.is(":checked")?this.elements.form.attr("action",this.elements.form.attr("data-tr-url")):this.elements.form.attr("action",this.elements.form.attr("data-url"))},a.prototype.validate=function(){var a,b,c;return a=this.elements.form,c=!0,this.elements.repoNameField.is(".is-autocheck-successful")||(c=!1),a.find("dl.form.errored").length&&(c=!1),a.find(".is-autocheck-loading").length&&(c=!1),b=this.elements.upgradeUpsell.find("input[type=checkbox]"),this.privateRepo&&b.length&&!b.is(":checked")&&(c=!1),$("button.primary").prop("disabled",!c)},a}(),$(function(){if(!$(".page-new-repo").length)return;return new a}),$(document).on("autocheck:send","#repository_name",function(){return $(this).trigger("repoform:validate")}),$(document).on("autocheck:complete","#repository_name",function(){return $(this).trigger("repoform:validate")}),$(document).on("autocheck:success","#repository_name",function(a,b){var c,d,e;d=$(this).val();if(d&&d!==b.name)return c=$(this).closest("dl.form"),c.addClass("warn"),e=$("<dd>").addClass("warning").text("Will be created as "+b.name),c.append(e)}),$(document).on("menu:activated",".js-ignore-container",function(){var a,b;a=$(this).find(".js-menu-content"),b=a.overflowOffset();if(b.bottom<=-10)return a.css({marginTop:b.bottom-20})})}.call(this),function(){var a,b;$(document).on("ajaxSend",".js-restore-repository",function(){return $(this).find(".minibutton").addClass("disabled")}),$(document).on("ajaxComplete",".js-restore-repository",function(c,d){var e,f;return e=$(this),e.addClass("error"),f=d.status===500?"Oops, something went wrong.":(b(e),d.responseText),a(e,f),!1}),a=function(a,b){return a.find(".js-message").show().html(b)},b=function(b){return $.ajaxPoll({interval:2,url:b.attr("data-check-url"),complete:function(c){console.log("POLL COMPLETE"),console.log(c);if(c.status===500)return a(b,"Oops, something went wrong.");a(b,c.responseText);if(c.status===!1)return this.resume()}})}}.call(this),function(){$.support.pjax&&($(document).on("submit",".js-stars-search",function(a){var b;if(b=$(this).closest("[data-pjax-container]")[0])return $.pjax.submit(a,{container:b})}),$(document).on("submit",".js-goto-user-stars",function(a){var b;return b=$(this).find(".js-username").val(),window.location="/stars/"+encodeURIComponent(b),!1})),$(document).on("focusin","#star-repo-search",function(){return $(this).on("input.clearSearch",function(){return $(this).closest(".js-stars-search").toggleClass("has-search-value",$(this).val()!=="")}),$(this).on("blur.clearSearch",function(){return $(this).off(".clearSearch")})}),$(document).on("click",".js-clear-search",function(){return $("#star-repo-search").val("").focus(),$(this).closest(".js-stars-search").removeClass("has-search-value"),!1})}.call(this),function(){$(function(){var a;if($(".js-styleguide-ace")[0])return a=new GitHub.CodeEditor(".js-styleguide-ace"),$(".js-styleguide-themes").change(function(){return a.setTheme($(this).find(":selected").val())})})}.call(this),GitHub.Team=function(a){this.url=window.location.pathname,this.orgUrl=this.url.split(/\/(teams|invite)/)[0],a&&(this.url=this.orgUrl+"/teams/"+a)},GitHub.Team.prototype={name:function(){return $("#team-name").val()},newRecord:function(){return!/\/invite/.test(location.pathname)&&!/\d/.test(location.pathname)},repos:function(){return $.makeArray($(".repositories li:visible a span").map(function(){return $(this).text()}))},addRepo:function(a,b){debug("Adding repo %s",a);if(!a||$.inArray(a,this.repos())>-1)return!1;this.addRepoAjax(a);var c=$(".repositories").find("li:first").clone(),d=c.find("input[type=hidden]");return c.find("a:first").attr("href","/"+a).find("span").text(a),c.find(".remove-repository").attr("data-repo",a),b==="private"?(c.addClass("private"),c.find("span.mini-icon").removeClass("mini-icon-public-repo").addClass("mini-icon-private-repo")):(c.addClass("public"),c.find("span.mini-icon").addClass("mini-icon-public-repo")),d.length>0&&d.val(a).attr("disabled",!1),$(".repositories").append(c.show()),!0},addRepoAjax:function(a){if(this.newRecord())return;debug("Ajaxily adding %s",a),$.post(this.url+"/repo/"+a)},removeRepo:function(a){debug("Removing %s",a);if(!a||$.inArray(a,this.repos())==-1)return!1;var b=$(".repositories li:visible a").filter(function(){return $(this).find("span").text()==a}),c=function(){b.parents("li:first").remove()},d=function(){b.parent().find(".remove-repository").show().removeClass("remove").html('<img class="dingus" src="/images/modules/ajax/error.png">').end().find(".spinner").hide()};return this.newRecord()?c():(b.parent().find(".remove-repository").after('<img class="dingus spinner" src="/images/spinners/octocat-spinner-64.gif" width="32" />').hide(),this.removeRepoAjax(a,c,d)),!0},removeRepoAjax:function(a,b,c){if(this.newRecord())return;debug("Ajaxily removing %s",a),$.ajax({type:"DELETE",url:this.url+"/repo/"+a,success:b,error:c})},users:function(){return $.makeArray($(".usernames li:visible").map(function(){return $(this).find("a:first").text()}))},addUser:function(a){debug("Adding %s",a);if(!a||$.inArray(a,this.users())>-1)return!1;this.addUserAjax(a);var b=$(".usernames").find("li:first").clone(),c=b.find("input[type=hidden]");return b.find("img").attr("src","/"+a+".png"),b.find("a:first").attr("href","/"+a).text(a),c.length>0&&c.val(a).attr("disabled",!1),$(".usernames").append(b.show()),!0},removeUser:function(a){debug("Removing %s",a);if(!a||$.inArray(a,this.users())==-1)return!1;var b=$(".usernames li:visible a:contains("+a+")"),c=function(){b.parents("li:first").remove()};return this.newRecord()?c():(b.parent().find(".remove-user").spin().remove(),$("#spinner").addClass("remove"),this.removeUserAjax(a,c)),!0},addUserAjax:function(a){if(this.newRecord())return;debug("Ajaxily adding %s",a),$.post(this.url+"/member/"+a)},removeUserAjax:function(a,b){if(this.newRecord())return;debug("Ajaxily removing %s",a),$.ajax({type:"DELETE",url:this.url+"/member/"+a,success:b})}},$(function(){if(!$(".js-team")[0])return;var a=new GitHub.Team($(".js-team").data("team")),b=$(".add-username-form input"),c=$(".add-repository-form input"),d=$(".add-username-form button"),e=$(".add-repository-form button"),f=null;b.on("autocomplete:search",function(a){f&&f.abort();var b=$(this).val();if(b===""){$("#add-user-autocomplete ul").empty(),$("#add-user-autocomplete").trigger("autocomplete:change");return}f=$.ajax({type:"GET",data:{q:b},url:"/autocomplete/users",dataType:"html",success:function(a){f=null,$("#add-user-autocomplete ul").html(a),$("#add-user-autocomplete").trigger("autocomplete:change")}})}),b.on("autocomplete:autocompleted:changed",function(a){b.attr("data-autocompleted")?d.removeAttr("disabled"):d.attr("disabled","disabled")}),c.on("autocomplete:search",function(){f&&f.abort();var b=$(this).val();if(b===""){$("#add-repo-autocomplete ul").empty(),$("#add-repo-autocomplete").trigger("autocomplete:change");return}f=$.ajax({type:"GET",data:{q:b,limit:10},url:a.orgUrl+"/autocomplete/repos",dataType:"html",success:function(a){f=null,$("#add-repo-autocomplete ul").html(a),$("#add-repo-autocomplete").trigger("autocomplete:change")}})}),c.on("autocomplete:autocompleted:changed",function(a){c.attr("data-autocompleted")?e.removeAttr("disabled"):e.attr("disabled","disabled")}),$(document).on("click",".remove-repository",function(){return a.removeRepo($(this).attr("data-repo")),!1}),$(document).on("click",".remove-user",function(){return a.removeUser($(this).prev().text()),!1}),$(".add-username-form button").click(function(){var b=$(this).parent(),c=b.find(":text"),d=c.val();return debug("Trying to add %s...",d),!d||!c.attr("data-autocompleted")?!1:(c.val(""),a.addUser(d),!1)}),$(".js-team").on("submit",function(a){var b=$(document.activeElement);if(b.is(".add-username-form input"))return b.closest(".add-username-form").find("button").click(),!1});var g,h=function(){g=$(this).attr("data-visibility")};$("#add-repo-autocomplete").on("navigation:open","[data-autocomplete-value]",h),$("#add-repo-autocomplete").on("click","[data-autocomplete-value]",h),$(".add-repository-form button").click(function(){var b=$(this).parent(),c=b.find(":text"),d=c.val();return debug("Trying to add %s...",d),!d||!c.attr("data-autocompleted")?!1:(c.val(""),a.addRepo(d,g),!1)}),$(".js-team").on("submit",function(a){var b=$(document.activeElement);if(b.is(".add-repository-form input"))return b.closest(".add-repository-form").find("button").click(),!1})}),function(){$.pageUpdate(function(){var a;if(!(a=document.getElementById("read_more")))return;return $(a).toggle($("#slider #readme").length!==0)})}.call(this),function(){var a,b;$.pageUpdate(function(){var a;if(!(a=document.getElementById("slider")))return;return setTimeout(function(){var b;if(b=$(a).find(".js-tree-finder-field")[0]){b.blur();if($(b).is(":visible"))return b.focus()}},0)}),$.pageUpdate(function(){var b,c,d,e;e=$(this).find(".js-tree-finder-field");for(c=0,d=e.length;c<d;c++)b=e[c],a(b)}),b=null,a=function(c,d){var e,f,g,h,i,j,k,l,m,n,o,p;if(!(l=document.getElementById($(c).attr("data-results"))))return;if(!(g=$(l).data("tree-finder-list"))){b==null&&(b=$.ajax({url:$(l).attr("data-url"),cache:!0,success:function(b){return $(l).data("tree-finder-list",b.paths),a(c)},complete:function(){return b=null}}));return}m=$(l).find(".js-tree-browser-result-template").html(),j=$(l).find(".js-tree-finder-results"),d==null&&(d=$(c).val()),d?(h=$.fuzzyRegexp(d),k=$.fuzzySort(g,d)):k=g,k=k.slice(0,50),e=function(){var a,b,c;c=[];for(a=0,b=k.length;a<b;a++)f=k[a],c.push(m.replace(/\$path/g,encodeURI(f)));return c}(),j.html(e.join()),p=j.find(".tree-browser-result a");for(n=0,o=p.length;n<o;n++)i=p[n],$.fuzzyHighlight(i,d,h);j.navigation("focus")},$(document).on("focusin",".js-tree-finder-field",function(){return a(this),$(this).on("throttled:input.treeFinder",function(){return a(this)}),$(this).on("keydown.treeFinder",function(a){if(a.hotkey==="esc")return history.back(),a.preventDefault()}),$(this).on("blur.treeFinder",function(){return $(this).off(".treeFinder")})})}.call(this),function(){var a,b,c,d,e,f,g,h,i,j,k=this;if(!Modernizr.history)return;if(navigator.userAgent.match(/(iPod|iPhone|iPad)/))return;a=function(){function a(){var b=this;this.popStateHandler=function(c){return a.prototype.popStateHandler.apply(b,arguments)},this.clickHandler=function(c){return a.prototype.clickHandler.apply(b,arguments)}}return a.prototype.cache={},a.prototype.clickHandler=function(a){var b,e;if(a.which===2||a.metaKey||a.ctrlKey)return;a.preventDefault();if(c)return;e=a.currentTarget.href;if(e===window.location.href)return;this.state||(this.state={id:(new Date).getTime()-1,direction:"forward",url:window.location.href},window.history.replaceState(this.state,"")),this.cache[this.state.id]=$("#slider").clone()[0],b=$(a.currentTarget).attr("data-direction")||"forward",this.state={id:(new Date).getTime(),direction:b,url:e},window.history.pushState(this.state,"",e),typeof _gaq!="undefined"&&_gaq!==null&&_gaq.push(["_trackPageview"]),d(this.state,this.cache[this.state.id],this.state.direction)},a.prototype.popStateHandler=function(a){var b;if(!(b=a.state))return;if(!document.getElementById("slider"))return;if(b!=null?b.id:void 0)return this.state&&this.stateTransition(this.state,b),this.state=b},a.prototype.stateTransition=function(a,b){var c;return a.id<b.id?c=b.direction:c=a.direction==="forward"?"back":"forward",this.cache[a.id]=$("#slider").clone()[0],d(b,this.cache[b.id],c)},a}(),i=new a,$(document).on("click","#slider .js-slide-to",i.clickHandler),$(window).on("popstate",i.popStateHandler),$.pageUpdate(function(){var a,b,c,d,e,f;if(!(b=$(this).find(".frames")[0]))return;a=$(b).find(".frame")[0];if(e=$(a).attr("data-title"))document.title=e;(f=$(a).attr("data-permalink-url"))&&$("link[rel=permalink]").attr("href",f),d=Math.min($(window).height(),$(a).height()),c=Math.max(d,$(b).height()),$(b).css("min-height",c)}),c=!1,g=function(a,b,d,e){var f,g;if(c)return;return c=!0,g=400,f=function(){return c=!1,$(b).siblings().remove(),typeof e=="function"?e():void 0},d==="back"?($(b).css("marginLeft","-1200px"),$(a).before(b),$(b).animate({marginLeft:"0"},g,f)):($(b).css("marginLeft","0"),$(a).after(b),$(a).animate({marginLeft:"-1200px"},g,f))},h=function(a,b,c,d){var e,h,i,j,k,l,m=this;return i=$("#js-frame-loading-template").clone().show(),l=c==="back"?350:500,j=i.find(".js-frame-loading-spinner").hide(),setTimeout(function(){return j.show()},l),k=2,h=null,e=function(){if(--k===0)return d(i,h)},$.ajax({url:""+b.url+"?slide=1",cache:!0,beforeSend:function(a){return a.setRequestHeader("X-PJAX","true")},success:function(a){return h=$($.parseHTML(a)).find("#slider")[0],e()},error:function(){return $(a).html("<h3>Something went wrong.</h3>")}}),g(a,i[0],c,e),f()},d=function(a,c,d){var f;return f=b($("#slider")),c?e(f,c,d):h(f,a,d,e)},e=function(a,c,d){var e,f,h;return h=$("#slider"),e=$(b(c)).clone()[0],(f=$(c).find(".frame-meta")[0])&&h.find(".frame-meta").replaceWith(f),d?g(a,e,d,function(){return h.pageUpdate().pageChange()}):($(a).replaceWith(e),h.pageUpdate().pageChange())},b=function(a){var b;b=$(a).find(".frames > .frame");if(b.length===1)return b[0];throw b.length>1?"multiple frames":"no frames"},f=function(){if(!j(".breadcrumb:visible"))return $(".breadcrumb:visible").scrollTo({duration:50})},j=function(a){var b,c,d,e;return c=$(window).scrollTop(),b=c+$(window).height(),e=$(a).offset().top,d=e+$(a).height(),d>=c&&e<=b}}.call(this),function(){$(document).on("click",".js-toggle-recovery",function(a){return $(".recovery-codes").toggleClass("is-hidden"),$('form[action="/sessions/two_factor"]').toggleClass("is-hidden")})}.call(this),$(document).on("click","#facebox .rename-warning button",function(){return $("#facebox .rename-warning, #facebox .rename-form").toggle(),!1}),$.pageUpdate(function(){$(".js-repo-filter").repoList()}),function(){$(function(){var a;return $("#load-readme").click(function(){var b,c,d,e,f,g;return c=$("#gollum-editor-body"),b=$("#editor-body-buffer"),e=$("#undo-load-readme"),g=b.text(),a(c,b),d=$(this),d.prop("disabled",!0),d.text(d.data("readme-name")+" loaded"),e.show(),f=function(){return $(this).val()!==g&&e.hide(),c.off("change keyup",f)},c.on("change keyup",f),!1}),$("#undo-load-readme").click(function(){var b;return a($("#gollum-editor-body"),$("#editor-body-buffer")),b=$("#load-readme"),b.prop("disabled",!1),b.text("Load "+b.data("readme-name")),$(this).hide(),!1}),a=function(a,b){var c,d,e;return c=$(a),d=$(b),e=c.val(),c.val(d.text()),d.text(e)}})}.call(this),$(document).on("click",".ajax_paginate a",function(){var a=$(this).parent(".ajax_paginate"),b=a.parent();return a.hasClass("loading")?!1:(a.addClass("loading"),$.ajax({url:$(this).attr("href"),complete:function(){a.removeClass("loading")},success:function(c){a.replaceWith(c),b.pageUpdate()}}),!1)}),function(){var a=this;if(!Modernizr.canvas)return;GitHub.ParticipationGraph=function(){function a(b){var c,d,e,f,g,h,i,j=this;this.onSuccess=function(b){return a.prototype.onSuccess.apply(j,arguments)},this.el=$(b),this.canvas=b.getContext("2d"),e=window.devicePixelRatio||1,d=this.canvas.webkitBackingStorePixelRatio||this.canvas.mozBackingStorePixelRatio||this.canvas.msBackingStorePixelRatio||this.canvas.oBackingStorePixelRatio||this.canvas.backingStorePixelRatio||1,h=e/d,h!==1&&(i=b.width,f=b.height,b.width=i*h,b.height=f*h,b.style.width=i+"px",b.style.height=f+"px",this.canvas.scale(h,h)),c=this.el.data("color-all"),g=this.el.data("color-owner"),c!=null&&(this.colors.all=c),g!=null&&(this.colors.owner=g),this.barMaxHeight=this.el.height(),this.barWidth=(this.el.width()-52)/52,this.refresh()}return a.prototype.colors={all:"#cacaca",owner:"#336699"},a.prototype.getUrl=function(){return this.el.data("source")},a.prototype.setData=function(a){var b,c;this.data=a;if(((b=this.data)!=null?b.all:void 0)==null||((c=this.data)!=null?c.owner:void 0)==null)this.data=null;this.scale=this.getScale(this.data)},a.prototype.getScale=function(a){var b,c,d,e,f;if(a==null)return;b=a.all[0],f=a.all;for(d=0,e=f.length;d<e;d++)c=f[d],c>b&&(b=c);return b>=this.barMaxHeight?(this.barMaxHeight-.1)/b:1},a.prototype.refresh=function(){$.ajax({url:this.getUrl(),dataType:"json",success:this.onSuccess})},a.prototype.onSuccess=function(a){this.setData(a),this.draw()},a.prototype.draw=function(){if(this.data==null)return;this.drawCommits(this.data.all,this.colors.all),this.drawCommits(this.data.owner,this.colors.owner)},a.prototype.drawCommits=function(a,b){var c,d,e,f,g,h,i,j;for(e=i=0,j=a.length;i<j;e=++i)c=a[e],f=this.barWidth,d=c*this.scale,g=e*(this.barWidth+1),h=this.barMaxHeight-d,this.canvas.fillStyle=b,this.canvas.fillRect(g,h,f,d)},a}(),$(document).pageUpdate(function(){return $(this).find(".participation-graph").each(function(){if($(this).is(":hidden"))return $(this).removeClass("disabled"),new GitHub.ParticipationGraph($(this).find("canvas")[0])})})}.call(this),$(function(){var a=$("table.billing-plans"),b=a.find("tr.selected .choose_plan"),c=a.find("tr.current"),d=$("#plan"),e=$("#credit_card_fields"),f=function(b){var c=b;a.find("tr.selected, tr.selected .choose_plan").removeClass("selected"),b.addClass("selected"),b.find(".choose_plan").addClass("selected"),d.val(c.attr("data-name")),requiredFields=e.find("input[required]"),c.attr("data-cost")==0?(e.hide(),requiredFields.attr("required",!1)):(e.show(),requiredFields.attr("required",!0))};$(document).on("click",".choose_plan",function(a){return f($(this).closest("tr")),!1}),$(".selected .choose_plan").click()}),function(){$.pageUpdate(function(){var a,b,c,d;b=$(".js-plaxify");if(b.length>0){for(c=0,d=b.length;c<d;c++)a=b[c],$(a).plaxify({xRange:$(a).data("xrange")||0,yRange:$(a).data("yrange")||0,invert:$(a).data("invert")||!1});return $.plax.enable()}})}.call(this),function(){var a,b,c,d,e;$(document).on("click",".js-releases-field a.remove",function(a){var b;return b=$(this).closest("li"),b.addClass("delete"),b.find("input.destroy").val("true"),!1}),$(document).on("click",".js-releases-field a.undo",function(a){var b;return b=$(this).closest("li"),b.removeClass("delete"),b.find("input.destroy").val(""),!1}),$(document).on("click",".js-tag-event-expander",function(a){return $(this).closest(".tag-events").removeClass("is-collapsed")}),b=["is-default","is-saving","is-saved","is-failed"],c=function(a,c){return a.removeClass(b.join(" ")),a.addClass(c),c==="is-saving"?a.attr("disabled","disabled"):a.removeAttr("disabled")},$(document).on("click",".js-save-draft",function(a,b){var d,e,f,g,h,i;return $("#release_draft").val("1"),d=$(this),g=d.closest("form"),f=$("#delete_release_confirm form"),h=g.data("repo-url"),i=g.attr("action"),e=g.serialize(),c(d,"is-saving"),$.ajax({url:i,type:"POST",data:e,dataType:"json",success:function(a){var e,i;e=""+h+"/releases/"+a.tag_name,g.attr("action",e),f.attr("action",e),window.history.replaceState(null,document.title,""+e+"/edit"),i=$("#release_id"),i.val()||(i.val(a.id),g.append('<input type="hidden" id="release_method" name="_method" value="put" />')),c(d,"is-saved"),setTimeout(function(){return c(d,"is-default")},5e3);if(b)return b()},complete:function(){},error:function(a){return c(d,"is-failed")}}),
  a.preventDefault()}),$(document).on("click",".js-publish-release",function(a){return $("#release_draft").val("0")}),e=["is-loading","is-empty","is-valid","is-invalid","is-duplicate","is-pending"],d=function(a){var b;return b=$(".js-release-tag"),b.removeClass(e.join(" ")),b.addClass(a)},a=function(a){if(!a.val())return;if(a.val()===a.attr("data-last-checked"))return;return d("is-loading"),$.ajax({url:a.attr("data-url"),type:"GET",data:{tag_name:a.val()},dataType:"json",success:function(b){if(b.status==="duplicate"&&parseInt(a.attr("data-existing-id"))===parseInt(b.release_id)){d("is-valid");return}return $(".js-release-tag .js-edit-release-link").attr("href",b.url),d("is-"+b.status)},error:function(a){return d("is-invalid")},complete:function(){return a.attr("data-last-checked",a.val())}})},$(document).on("blur",".js-release-tag-field",function(b){return a($(this))}),$(function(){return a($(".js-release-tag-field"))})}.call(this),function(){var a,b,c,d,e,f,g,h,i,j;e={load:null,hello:null,loading:null,loaded:null,ready:null,helloTimer:null,loadTimer:null},a=$(".js-render-target"),h=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"].reduce(function(a,b){return""+a+" "+b}),g=function(){e.load=e.hello=e.loading=e.loaded=e.ready=null,e.helloTimer&&(clearTimeout(e.helloTimer),e.helloTimer=null);if(e.loadTimer)return clearTimeout(e.loadTimer),e.loadTimer=null},c=function(){var a,b;return a=6,b=30,e.load=Date.now(),e.helloTimer=setTimeout(j(function(){return!e.hello}),a*1e3),e.loadTimer=setTimeout(j(),b*1e3)},i=function(){var b,c,d;if(!a.length)return;if(!(b=a.find("iframe")).length)return;if(!(d=b.get(0).contentWindow))return;if(d.postMessage==null)return;return c={type:"render:timing",body:{timing:e,format:a.data("type")}},d.postMessage(JSON.stringify(c),"*")},b=function(){var a,b,c;return i(),a=e.hello-e.load,b=e.loading-e.hello,c=e.loaded-e.loading,debug("Render init delay: "+a+"ms Render ready: "+b+"ms Load Time: "+c+"ms")},f=function(){return a.addClass("is-render-requested")},d=function(b){return a.removeClass(h),a.addClass("is-render-failed"),b!=null&&a.addClass("is-render-failed-"+b),g()},j=function(b){return b==null&&(b=function(){return!0}),function(){if(!a.is(":visible"))return;if(a.hasClass("is-render-ready"))return;if(a.hasClass("is-render-failed"))return;if(a.hasClass("is-render-failed-fatally"))return;if(!b())return;return debug("Render timeout: "+JSON.stringify(e)+" Now: "+Date.now()),d()}},$.pageUpdate(function(){var b;if((b=$(".js-render-target")).length&&!e.load)return a=b,g(),c(),$(".render-viewer-trigger").length||a.addClass("is-render-automatic"),a.hasClass("is-render-automatic")&&f(),$(".render-viewer-trigger").on("click",function(a){return a.preventDefault(),f()})}),$(window).on("message",function(c){var f,i,j,k,l,m;l=c.originalEvent,i=l.data,j=l.origin;if(!(a.length>0))return;if(!i||!j)return;if(j!==a.data("host"))throw new Error("Bad message origin: "+j);m=function(){try{return JSON.parse(i)}catch(a){return i}}(),k=m.type,f=m.body;if(!k||!f)return;if(k==="render")switch(f){case"hello":return e.hello=Date.now(),e.loading=e.loaded=null;case"error":return d();case"error:fatal":return d("fatal");case"loading":return a.removeClass(h),a.addClass("is-render-loading"),e.loading=Date.now();case"loaded":return a.removeClass(h),a.addClass("is-render-loaded"),e.loaded=Date.now();case"ready":return a.removeClass(h),a.addClass("is-render-ready"),e.ready=Date.now(),b(),g();default:return debug("Unknown message ["+k+"]=>'"+f+"'")}})}.call(this),function(){$(function(){var a,b;return a=/[^0-9A-Za-z_\.]/g,b=$(".js-form-note"),$("input.js-repository-name").on("keyup",function(c){var d;d=$(this),b.html("Will be created as <code>"+d.val().replace(a,"-")+"</code>");if(a.test(d.val())){if(b.is(":hidden"))return b.fadeIn()}else if(!d.val())return b.fadeOut()})})}.call(this),function(){$(document).on("click",".js-toggle-lang-stats",function(a){var b,c;return $(".js-stats-switcher-viewport").toggleClass("is-revealing-lang-stats"),c=$(this).attr("original-title"),b="",c.match("Show")?b=c.replace("Show","Hide"):b=c.replace("Hide","Show"),$(".js-toggle-lang-stats").attr("title",b),$(this).trigger("mouseover"),a.preventDefault()})}.call(this),function(){$(function(){$(".js-user-filter").length&&$(".js-user-filter").click(function(a){a.preventDefault();if($(this).hasClass("selected"))return;$(".js-user-filter").removeClass("selected"),$("img.avatar").removeClass("almost-hidden"),$(this).addClass("selected");if($(this).attr("rel")==="owners")return $("img.avatar.member").addClass("almost-hidden");if($(this).attr("rel")==="members")return $("img.avatar.owner").addClass("almost-hidden")}),$(".js-app-tab").length&&$(".js-app-tab").click(function(a){a.preventDefault();if($(this).hasClass("selected"))return;return $(".js-app-tab").removeClass("selected"),$(this).addClass("selected"),$(this).attr("rel")==="all"?($("#all-apps").show(),$("#private-repo-access-apps").hide(),$("#limited-access-apps").hide()):$(this).attr("rel")==="private-access"?($("#private-repo-access-apps").show(),$("#all-apps").hide(),$("#limited-access-apps").hide()):($("#limited-access-apps").show(),$("#private-repo-access-apps").hide(),$("#all-apps").hide())});if($(".js-org-security-tab").length)return $(".js-org-security-tab").click(function(a){a.preventDefault();if($(this).hasClass("selected"))return;return $(".js-org-security-tab").removeClass("selected"),$(this).addClass("selected"),$(this).attr("rel")==="apps"?($("#oauth-application-security").show(),$("#oauth-ssh-key-security").hide()):($("#oauth-ssh-key-security").show(),$("#oauth-application-security").hide())})})}.call(this),function(){$(function(){if($(".js-settings-next").length===0)return!1;$("#page-settings").on("click",".js-add-email",function(a){return $(this).toggle(),$("#add-email-form").fadeIn(200).find(":text").focus(),!1}),$("#page-settings").on("click",".js-add-email-cancel",function(a){return $(".js-add-email").toggle(),$("#add-email-form").hide().find(":text").val(""),!1}),$(document).on("click",".js-notification-global-toggle",function(a){var b,c,d;return d=$(this).attr("data-url"),b=this.checked,c={},c[this.name]=b?"1":"0",$.ajax({url:$(this).attr("data-url"),type:"PUT",data:c,success:function(){return b?$(this).parent("p").removeClass("ignored"):$(this).parent("p").addClass("ignored")}})}),$(document).on("change",".js-notifications-settings input[type=checkbox]",function(a){var b;return b=$(this),b.parents("li").append('<img class="spinner" src="'+GitHub.Ajax.spinner+'" width="16" />'),$.ajax({url:b.parents(".js-notifications-settings").attr("data-toggle-url"),type:"POST",data:b.parents(".js-notifications-settings").serialize(),complete:function(){return b.parents("li").find("img").remove()}})}),$(document).on("click","button.dummy",function(a){return $(this).prev(".success").show().fadeOut(500),!1}),$(document).on("ajaxSend",".js-remove-item",function(a){return $(this).spin().hide()}),$(document).on("ajaxComplete",".js-remove-item",function(a){return $(this).parents("li").stopSpin()}),$(document).on("ajaxSuccess",".js-remove-item",function(a){return $(this).parents("li").remove()}),$(document).on("ajaxSuccess",".js-toggle-visibility",function(a,b,c,d){return $("#settings-emails").children(".settings-email.primary").toggleClass("private",d.visibility==="private")}),$(document).on("ajaxSend",".js-remove-key",function(a){return $(this).addClass("disabled").find("span").text("Deleting…")}),$(document).on("ajaxError",".js-remove-key",function(a){return $(this).removeClass("disabled").find("span").text("Error. Try again.")}),$(document).on("ajaxSuccess",".js-remove-key",function(a){$(this).parents("li").remove();if($(".js-ssh-keys-box li").length===0)return $(".js-no-ssh-keys").show()}),$(document).on("click",".js-leave-collaborated-repo",function(a){var b,c,d,e;return c=$(a.currentTarget),d=c.parent("div").parent("div").attr("data-repo"),e=$('ul.repositories li[data-repo="'+d+'"]'),b=c.parents("div.full-button"),b.addClass("no-bg"),b.html('<img src="'+GitHub.Ajax.spinner+'" width="16" />'),$.ajax({url:"/account/leave_repo/"+d,type:"POST",success:function(){return $.facebox.close(),e.fadeOut()},error:function(){return b.html('<img src="/images/modules/ajax/error.png">')}}),!1});if($(".js-name-change-in-progress").length)return $.ajaxPoll({url:$(".js-name-change-in-progress").attr("data-poll-url"),dataType:"json",success:function(a){return(a!=null?a.url:void 0)?window.location=a.url:a?this.resume():location.reload()},error:function(){return $(".js-name-change-in-progress").hide(),$(".js-name-change-error").show()}})}),$(document).on("ajaxSuccess",".js-unsubscribe-from-newsletter form",function(a,b){return $(".js-unsubscribe-from-newsletter .message").toggle()}),$(document).on("click",".js-show-new-ssh-key-form",function(){return $(".js-new-ssh-key-box").toggle().find(":text").focus(),!1}),$(document).on("click",".js-delete-oauth-application-image",function(){var a,b,c;return a=$(this).closest(".js-uploadable-container"),a.removeClass("has-uploaded-logo"),b=a.find("img.js-image-field"),c=a.find("input.js-oauth-application-logo-id"),b.attr("src",""),c.val(""),!1}),$.pageUpdate(function(){return $(this).find("dl.autosave").each(function(){return $(this).autosaveField()})})}.call(this),$(function(){$(".plan").dblclick(function(){var a=$(this).find("a.button");a.length>0&&(document.location=a.attr("href"))}),$("#signup_form").submit(function(){$("#signup_button").attr("disabled",!0).find("span").text("Creating your GitHub account...")})}),function(){$(document).on("ajaxSuccess",".js-social-container",function(a,b,c,d){return $(this).find(".js-social-count").text(d.count)})}.call(this),function(){$(function(){var a,b;if(b=$(".js-current-repository").attr("href"))return a={path:"/",expires:1},$.cookie("spy_repo",b.substr(1),a),$.cookie("spy_repo_at",new Date,a)})}.call(this),function(){$(document).on("click",".js-approve-ssh-key",function(a){var b;return b=$(this),b.addClass("disabled").find("span").text("Approving…"),$.ajax({url:b.attr("href"),type:"POST",success:function(){return b.parents("li").addClass("approved")},error:function(){return b.removeClass("disabled").find("span").text("Error. Try Again")}}),!1}),$(document).on("click",".js-reject-ssh-key",function(a){var b;return b=$(this),b.addClass("disabled").find("span").text("Rejecting…"),$.ajax({url:b.attr("href"),type:"DELETE",success:function(){return b.parents("li").addClass("rejected")},error:function(){return b.removeClass("disabled").find("span").text("Error. Try Again")}}),!1})}.call(this),function(){$.support.pjax&&!location.search&&!location.hash&&$(function(){var a,b,c;a=(c=document.getElementById("issues-dashboard"))!=null?c:document.getElementById("issues_list");if(b=$(a).attr("data-url"))return window.history.replaceState(null,document.title,b)})}.call(this),function(){$(function(){return $(document).on("ajaxBeforeSend",".js-auto-subscribe-toggle",function(){return $(this).find("label").append('<img src="'+GitHub.Ajax.spinner+'" width="16" />')}),$(document).on("ajaxError",".js-auto-subscribe-toggle",function(){return $(this).find("label img").remove(),$(this).find("label").append('<img src="/images/modules/ajax/error.png">')}),$(document).on("ajaxSuccess",".js-auto-subscribe-toggle",function(){return $(this).find("label img").remove()}),$(document).on("ajaxBeforeSend",".js-unignore-form, .js-ignore-form",function(){return $(this).closest(".subscription-row").addClass("loading")}),$(document).on("ajaxError",".js-unignore-form, .js-ignore-form",function(){return $(this).closest(".subscription-row").removeClass("loading"),$(this).find(".minibutton").addClass("danger").attr("title","There was a problem unignoring this repo.")}),$(document).on("ajaxSuccess",".js-unignore-form",function(){return $(this).closest(".subscription-row").removeClass("loading").addClass("unsubscribed")}),$(document).on("ajaxSuccess",".js-ignore-form",function(){return $(this).closest(".subscription-row").removeClass("loading unsubscribed")}),$(document).on("ajaxBeforeSend",".js-unsubscribe-form, .js-subscribe-form",function(){return $(this).closest(".subscription-row").addClass("loading")}),$(document).on("ajaxError",".js-unsubscribe-form, .js-subscribe-form",function(){return $(this).closest(".subscription-row").removeClass("loading"),$(this).find(".minibutton").addClass("danger").attr("title","There was a problem with unsubscribing :(")}),$(document).on("ajaxSuccess",".js-unsubscribe-form",function(){return $(this).closest(".subscription-row").removeClass("loading").addClass("unsubscribed")}),$(document).on("ajaxSuccess",".js-subscribe-form",function(){return $(this).closest(".subscription-row").removeClass("loading unsubscribed")})})}.call(this),function(){var a,b=this;a=function(){function b(a){var c=this;this.textarea=a,this.onNavigationOpen=function(a){return b.prototype.onNavigationOpen.apply(c,arguments)},this.onNavigationKeyDown=function(a){return b.prototype.onNavigationKeyDown.apply(c,arguments)},this.onKeyUp=function(){return b.prototype.onKeyUp.apply(c,arguments)},this.teardown=function(){return b.prototype.teardown.apply(c,arguments)},$(this.textarea).on("focusout:delayed.suggester",this.teardown),$(this.textarea).on("keyup.suggester",this.onKeyUp),this.suggester=document.getElementById($(this.textarea).attr("data-suggester")),$(this.suggester).on("navigation:keydown.suggester","[data-value]",this.onNavigationKeyDown),$(this.suggester).on("navigation:open.suggester","[data-value]",this.onNavigationOpen),this.loadSuggestions()}var a;return b.prototype.types={mention:{search:"fuzzy",limit:5,className:"mention-suggestions",match:/(^|\s)@([a-z0-9\-_\/]*)$/i,replace:"$1@$value "},emoji:{search:"prefix",limit:5,className:"emoji-suggestions",match:/(^|\s):([a-z0-9\-\+_]*)$/i,replace:"$1:$value: "},hashed:{search:"fuzzy-hashed",limit:5,className:"hashed-suggestions",match:/(^|\s)\#([a-z0-9\-_\/]*)$/i,replace:"$1#$value "}},a=function(a){var b,c;if(((b=a.match(/`{3,}/g))!=null?b.length:void 0)%2)return!0;if(((c=a.match(/`/g))!=null?c.length:void 0)%2)return!0},b.prototype.teardown=function(){this.deactivate(),$(this.textarea).off(".suggester"),$(this.suggester).off(".suggester")},b.prototype.onKeyUp=function(){if(this.checkQuery())return!1},b.prototype.onNavigationKeyDown=function(a){switch(a.hotkey){case"tab":return this.onNavigationOpen(a),!1;case"esc":return this.deactivate(),!1}},b.prototype.onNavigationOpen=function(a){var b,c,d;return d=$(a.target).attr("data-value"),c=this.textarea.value.substring(0,this.textarea.selectionEnd),b=this.textarea.value.substring(this.textarea.selectionEnd),c=c.replace(this.type.match,this.type.replace.replace("$value",d)),this.textarea.value=c+b,this.deactivate(),this.textarea.focus(),this.textarea.selectionStart=c.length,this.textarea.selectionEnd=c.length,!1},b.prototype.checkQuery=function(){var a,b,c;c=this.searchQuery(),b=c[0],a=c[1];if(b!=null&&a!=null){if(a===this.query)return;return this.type=b,this.query=a,this.search(b,a)?this.activate():this.deactivate(),this.query}this.type=this.query=null,this.deactivate()},b.prototype.activate=function(){if($(this.suggester).is(".active"))return;$(this.suggester).addClass("active"),$(this.suggester).css($(this.textarea).textareaSelectionPosition()),$(this.textarea).addClass("js-navigation-enable"),$(this.suggester).navigation("push"),$(this.suggester).navigation("focus")},b.prototype.deactivate=function(){$(this.suggester).removeClass("active"),$(this.suggester).find(".suggestions").hide(),$(this.textarea).removeClass("js-navigation-enable"),$(this.suggester).navigation("pop")},b.prototype.search=function(a,b){var c,d;c=$(this.suggester).find("ul."+a.className);if(!c[0])return;return d=function(){switch(a.search){case"fuzzy-hashed":return c.fuzzyFilterSortList("#"+b,{limit:a.limit});case"fuzzy":return c.fuzzyFilterSortList(b,{limit:a.limit});default:return c.prefixFilterList(b,{limit:a.limit})}}(),d>0?(c.show(),$(this.suggester).navigation("focus"),!0):!1},b.prototype.searchQuery=function(){var b,c,d,e,f;d=this.textarea.value.substring(0,this.textarea.selectionEnd);if(a(d))return[];f=this.types;for(c in f){e=f[c];if(b=d.match(e.match))return[e,b[2]]}return[]},b.prototype.loadSuggestions=function(){var a=this;if($(this.suggester).children().length)return;return $.ajax({url:$(this.suggester).attr("data-url"),success:function(b){return $(a.suggester).html(b),a.type=a.query=null,a.checkQuery()}})},b}(),$(document).on("focusin:delayed","textarea[data-suggester]",function(){new a(this)})}.call(this),$(function(){$(".remove-team").click(function(){if(!confirm("Are you POSITIVE you want to remove this team?"))return!1;var a=$(this).parents("li.team");return $.ajax({type:"DELETE",url:this.href,success:function(){a.remove()}}),$(this).spin().remove(),!1})}),$(function(){function d(a,b){arguments.length<2&&(b=location.href);if(arguments.length>0&&a!=""){if(a=="#")var c=new RegExp("[#]([^$]*)");else if(a=="?")var c=new RegExp("[?]([^#$]*)");else var c=new RegExp("[?&]"+a+"=([^&#]*)");var d=c.exec(b);return d==null?"":d[1]}b=b.split("?");var d={};return b.length>1&&(b=b[1].split("#"),b.length>1&&(d.hash=b[1]),$.each(b[0].split("&"),function(a,b){b=b.split("="),d[b[0]]=b[1]})),d}var a=$.cookie("tracker"),b=null;a==null&&(b=document.referrer?document.referrer:"direct");var c=d();c.utm_campaign&&$.trim(c.utm_campaign)!=""&&(b=c.utm_campaign),c.referral_code&&$.trim(c.referral_code)!=""&&(b=c.referral_code),b!=null&&$.cookie("tracker",b,{expires:7,path:"/"})}),function(){$(function(){var a;if(!$(".page-two-factor-auth").length)return;return $(document).on("click",".js-resend-auth-code",function(){return a("/sessions/two_factor/resend")}),$(document).on("change",'input[type="radio"]',function(){var a;return a=$(".js-country-code-container").find('.selected input[type="radio"]'),a.prop("checked",!0)}),$(document).on("click",".js-send-two-factor-code",function(){var b,c;return b=$('.select-menu-item.selected input[type="radio"]').val(),c=b+$(".js-sms-number").val(),a("/settings/two_factor_authentication/send_sms?number="+c)}),a=function(a){return $("body").addClass("is-sending"),$("body").removeClass("is-sent is-not-sent"),$.ajax({url:a,type:"POST",success:function(){return $("body").addClass("is-sent"),$("body").removeClass("is-sending")},error:function(){return $("body").addClass("is-not-sent"),$("body").removeClass("is-sending")}}),!1}})}.call(this),$(function(){function a(a,b){var c=Math.min(a.canvas.width,b.canvas.width),d=Math.min(a.canvas.height,b.canvas.height),e=a.getImageData(0,0,c,d),f=b.getImageData(0,0,c,d),g=e.data,h=f.data,i,j,k,l=h.length,m,n,o,p,q,r,s,t;for(k=0;k<l;k+=4)i=g[k+3]/255,j=h[k+3]/255,s=i+j-i*j,h[k+3]=s*255,m=g[k]/255*i,p=h[k]/255*j,n=g[k+1]/255*i,q=h[k+1]/255*j,o=g[k+2]/255*i,r=h[k+2]/255*j,t=255/s,h[k]=(m+p-2*Math.min(m*j,p*i))*t,h[k+1]=(n+q-2*Math.min(n*j,q*i))*t,h[k+2]=(o+r-2*Math.min(o*j,r*i))*t;b.putImageData(f,0,0)}if($("#files .image").length){var b=$("#files .file:has(.onion-skin)"),c=[];$.each(b,function(d,e){function E(){A++,H();if(A>=z){var a=f.find(".progress");a.is(":visible")?a.fadeOut(250,function(){G()}):(a.hide(),G())}}function F(a){var b=w.find(".active"),c=w.find(".active").first().index(),d=x.eq(c),e=w.children().eq(a);if(e.hasClass("active")==0&&e.hasClass("disabled")==0){b.removeClass("active"),e.addClass("active");if(e.is(":visible")){var g=e.position(),h=e.outerWidth(),i=String(g.left+h/2)+"px 0px";w.css("background-image","url(/images/modules/commit/menu_arrow.gif)"),w.css("background-position",i)}A>=2&&(animHeight=parseInt(x.eq(a).css("height"))+127,f.css("height",animHeight),d.animate({opacity:"hide"},250,"swing",function(){x.eq(a).fadeIn(250)}))}}function G(){var b=858,e=Math.max(B.width,C.width),k=Math.max(B.height,C.height),l=0,x=1;B.marginHoriz=Math.floor((e-B.width)/2),B.marginVert=Math.floor((k-B.height)/2),C.marginHoriz=Math.floor((e-C.width)/2),C.marginVert=Math.floor((k-C.height)/2),$.each($.getUrlVars(),function(a,b){b==f.attr("id")&&(diffNum=parseInt(b.replace(/\D*/g,"")),y=$.getUrlVar(b)[0],l=$.getUrlVar(b)[1]/100,c[diffNum].view=$.getUrlVar(b)[0],c[diffNum].pct=$.getUrlVar(b)[1],c[diffNum].changed=!0)});var z=1;e>(b-30)/2&&(z=(b-30)/2/e),m.attr({width:B.width*z,height:B.height*z}),n.attr({width:C.width*z,height:C.height*z}),g.find(".deleted-frame").css({margin:B.marginVert*z+"px "+B.marginHoriz*z+"px",width:B.width*z+2,height:B.height*z+2}),g.find(".added-frame").css({margin:C.marginVert*z+"px "+C.marginHoriz*z+"px",width:C.width*z+2,height:C.height*z+2}),g.find(".aWMeta").eq(0).text(C.width+"px"),g.find(".aHMeta").eq(0).text(C.height+"px"),g.find(".dWMeta").eq(0).text(B.width+"px"),g.find(".dHMeta").eq(0).text(B.height+"px"),C.width!=B.width&&(g.find(".aWMeta").eq(0).addClass("a-green"),g.find(".dWMeta").eq(0).addClass("d-red")),C.height!=B.height&&(g.find(".aHMeta").eq(0).addClass("a-green"),g.find(".dHMeta").eq(0).addClass("d-red"));var A=1,D;e>b-12&&(A=(b-12)/e),D=0,D=e*A+3,o.attr({width:B.width*A,height:B.height*A}),p.attr({width:C.width*A,height:C.height*A}),h.find(".deleted-frame").css({margin:B.marginVert*A+"px "+B.marginHoriz*A+"px",width:B.width*A+2,height:B.height*A+2}),h.find(".added-frame").css({margin:C.marginVert*A+"px "+C.marginHoriz*A+"px",width:C.width*A+2,height:C.height*A+2}),h.find(".swipe-shell").css({width:e*A+3+"px",height:k*A+4+"px"}),h.find(".swipe-frame").css({width:e*A+18+"px",height:k*A+30+"px"}),h.find(".swipe-bar").css("left",l*D+"px"),f.find(".swipe .swipe-shell").css("width",D-D*l),h.find(".swipe-bar").on("mousedown",function(a){var b=$(this),e=$(this).parent(),g=0,h=e.width()-b.width();a.preventDefault(),$("body").css({cursor:"pointer"}),$(document).on("mousemove.swipe",function(a){a.preventDefault();var g=a.clientX-e.offset().left;g<0&&(g=0),g>h&&(g=h),b.css({left:g});var i=Math.round(g/(parseInt(f.find(".swipe-frame").css("width"))-15)*1e4)/1e4;f.find(".swipe .swipe-shell").css("width",D-D*i),c[d].pct=i*100,c[d].changed=!0}),$(document).on("mouseup.swipe",function(){$(document).off(".swipe"),$("body").css({cursor:"auto"}),I()})});var E=1;e>b-12&&(E=(b-12)/e),q.attr({width:B.width*E,height:B.height*E}),r.attr({width:C.width*E,height:C.height*E}),i.find(".deleted-frame").css({margin:B.marginVert*E+"px "+B.marginHoriz*E+"px",width:B.width*E+2,height:B.height*E+2}),i.find(".added-frame").css({margin:C.marginVert*E+"px "+C.marginHoriz*E+"px",width:C.width*E+2,height:C.height*E+2}),i.find(".onion-skin-frame").css({width:e*E+4+"px",height:k*E+30+"px"}),f.find(".dragger").css("left",x*262+"px"),f.find(".onion-skin .added-frame").css("opacity",x),f.find(".onion-skin .added-frame img").css("opacity",x),f.find(".dragger").on("mousedown",function(a){var b=$(this),e=$(this).parent(),g=0,h=e.width()-b.width();a.preventDefault(),$("body").css({cursor:"pointer"}),$(document).on("mousemove.dragger",function(a){a.preventDefault();var g=a.clientX-e.offset().left;g<0&&(g=0),g>h&&(g=h),b.css({left:g});var i=Math.round(g/262*100)/100;f.find(".onion-skin .added-frame").css("opacity",i),f.find(".onion-skin .added-frame img").css("opacity",i),c[d].pct=i*100,c[d].changed=!0}),$(document).on("mouseup.dragger",function(){$(document).off(".dragger"),$("body").css({cursor:"auto"}),I()})});var G=1;e>b-4&&(G=(b-4)/e),Modernizr.canvas&&(s.attr({width:e*G,height:k*G}),t.attr({width:e*G,height:k*G}),j.find(".added-frame").css({width:e*G+2,height:k*G+2}),j.find(".deleted-frame").css({width:e*G+2,height:k*G+2}),u.drawImage(B,B.marginHoriz*G,B.marginVert*G,B.width*G,B.height*G),v.drawImage(C,C.marginHoriz*G,C.marginVert*G,C.width*G,C.height*G),a(v,u)),g.css("height",k*z+30),h.css("height",k*A+30),i.css("height",k*A+30),j.css("height",k*A+30),w.children().removeClass("disabled"),F(y)}function H(){var a=A/z*100+"%";f.find(".progress-bar").animate({width:a},250,"swing")}function I(){var a="?";$.each(c,function(b,c){c["changed"]==1&&(b!=0&&(a+="&"),a+="diff-"+b+"="+c.view+"-"+Math.round(c.pct))}),Modernizr.history&&window.history.replaceState({},"",a)}var f=b.eq(d),g=f.find(".two-up").eq(0),h=f.find(".swipe").eq(0),i=f.find(".onion-skin").eq(0),j=f.find(".difference").eq(0),k=f.find(".deleted"),l=f.find(".added"),m=k.eq(0),n=l.eq(0),o=k.eq(1),p=l.eq(1),q=k.eq(2),r=l.eq(2),s=f.find("canvas.deleted").eq(0),t=f.find("canvas.added").eq(0),u,v,w=f.find("ul.view-modes-menu"),x=f.find(".view"),y=0,z=f.find(".asset").length,A=0,B=new Image,C=new Image;c.push({name:f.attr("id"),view:0,pct:0,changed:!1}),Modernizr.canvas?(u=s[0].getContext("2d"),v=t[0].getContext("2d")):w.children().eq(3).addClass("hidden"),f.find(".two-up").hide(),f.find(".two-up p").removeClass("hidden"),f.find(".progress").removeClass("hidden"),f.find(".view-modes").removeClass("hidden"),B.src=f.find(".deleted").first().attr("src"),C.src=f.find(".added").first().attr("src"),m.attr("src",B.src).load(function(){E()}),n.attr("src",C.src).load(function(){E()}),o.attr("src",B.src).load(function(){E()}),p.attr("src",C.src).load(function(){E()}),q.attr("src",B.src).load(function(){E()}),r.attr("src",C.src).load(function(){E()});var D=!0;w.children("li").click(function(){var a=$(this).index();(a==1||a==2)&&D&&(D=!1),F(a),c[d].view=a,c[d].changed=!0,I()}),$.extend({getUrlVars:function(){var a=[],b,c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var d=0;d<c.length;d++)b=c[d].split("="),b[1]&&(b[1]=b[1].split("-")),a.push(b[0]),a[b[0]]=b[1];return a},getUrlVar:function(a){return $.getUrlVars()[a]}})})}}),$(function(){function b(){var c=$("#current-version").val();c&&$.get("_current",function(d){c==d?setTimeout(b,5e3):a||($("#gollum-error-message").text("Someone has edited the wiki since you started. Please reload this page and re-apply your changes."),$("#gollum-error-message").show(),$("#gollum-editor-submit").attr("disabled","disabled"),$("#gollum-editor-submit").attr("value","Cannot Save, Someone Else Has Edited"))})}$("#see-more-elsewhere").click(function(){return $(".seen-elsewhere").show(),$(this).remove(),!1});var a=!1;$("#gollum-editor-body").each(b),$("#gollum-editor-submit").click(function(){a=!0});var c=[];$("form#history input[type=submit]").attr("disabled",!0),$("form#history input[type=checkbox]").change(function(){var a=$(this).val(),b=$.inArray(a,c);if(b>-1)c.splice(b,1);else{c.push(a);if(c.length>2){var d=c.shift();$("input[value="+d+"]").prop("checked",!1)}}$("form#history tr.commit").removeClass("selected"),$("form#history input[type=submit]").attr("disabled",!0);if(c.length==2){$("form#history input[type=submit]").attr("disabled",!1);var e=!1;$("form#history tr.commit").each(function(){e&&$(this).addClass("selected"),$(this).find("input:checked").length>0&&(e=!e),e&&$(this).addClass("selected")})}})});