var cull=function(){"use strict";function e(e){return!!e&&"object"==typeof e&&"number"==typeof e.length&&!e.tagName}function n(e){return"[object Array]"===P.call(e)?e:"[object Arguments]"===P.call(e)?M.call(e):"undefined"==typeof e||null===e?[]:M.call(arguments)}function t(e,n){var t,r;for(t=0,r=n.length;r>t;++t)e(n[t],t,n);return n}function r(e){return"function"==typeof e}function o(e,n,t){var r,o=0,i=t,a=n;for(2===arguments.length&&(i=n,a=i[0],o=1),"string"==typeof i&&(i=i.split("")),r=i.length;r>o;++o)a=e(a,i[o]);return a}function i(e,n){var t,r;for(t=0,r=n.length;r>t;++t)if(!e(n[t]))return!1;return!0}function a(e,n){var t,r;for(t=0,r=n.length;r>t;++t)if(e(n[t]))return!0;return!1}function u(e,n){var t,r,o,i;for(t=0,r=n.length;r>t;++t)if(e(n[t])?o=!0:i=!0,o&&i)return!0;return!1}function s(e){return e.trim&&e.trim()||e.replace(/^\s+|\s+$/,"")}function c(e){return e}function l(e){return"undefined"!=typeof e&&null!==e}function f(e){return function(n){return e.call(this,n)}}function p(e){return function(n){return n[e]}}function d(e,t){return function(r){return r[e].apply(r,n(t))}}function h(e){return function(n){return e===n}}function m(e,t){var r=n(e);return function(){for(var e=r.length,n=arguments;e--;)n=[r[e].apply(t||this,n)];return n[0]}}function g(){var e=arguments;return function(n){return n.apply(this,e)}}function v(e){var n=M.call(arguments,1);return function(){return e.apply(this,n.concat(M.call(arguments)))}}function y(e,n){var t="string"==typeof n?e[n]:n,r=M.call(arguments,2);return function(){return t.apply(e,r.concat(M.call(arguments)))}}function w(n){var t,r,o=[];for(t=0,r=n.length;r>t;t++)o=o.concat(e(n[t])?w(n[t]):n[t]);return o}function b(e,n){var t,r;for(t=0,r=n.length;r>t;++t)if(e===n[t])return t;return-1}function x(e){var n,t,r=[];for(n=0,t=e.length;t>n;++n)b(e[n],r)<0&&r.push(e[n]);return r}function E(e,n){var t,r;for(t=0,r=n.length;r>t;++t)if(e(n[t]))return n[t]}function _(e,n){var t,r,o=[];for(t=0,r=n.length;r>t;++t)e(n[t])&&o.push(n[t]);return o}function q(e,n){return _(function(e){return b(e,n)<0},e)}function C(e){var n,t=[];for(n in e)e.hasOwnProperty(n)&&t.push(n);return t}function A(e){var n,t=[];for(n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function S(e,n){var t,r,o=[];for(t=0,r=n.length;r>t;t++)o.push(e(n[t]));return o}function j(e){return function(){return!e.apply(this,arguments)}}function k(e,n){return _(j(e),n)}function N(e,t){return n(e).concat(n(t))}function T(e,n){var t,r,o=[];for(t=0,r=n.length;r>t;t+=e)o.push(n.slice(t,t+e));return o}function $(e,n){return I(S(e,I(n)))}function H(e,n){return o(N,S(e,n))}function L(e,n){var t,r,o=[];for(t=0,r=n.length;r>t;t+=1)o.push(n[t]),r-1>t&&o.push(e);return o}function z(e,n,t){var r=e[n];e[n]=function(){var e=r.apply(this,arguments),n=t.apply(this,[e].concat(M.call(arguments)));return"undefined"!=typeof n?n:e}}function O(e,n,t){var r=e[n];e[n]=function(){return t.apply(this,arguments),r.apply(this,arguments)}}function R(e,n,t){var r=v(t,e[n]);e[n]=function(){return r.apply(this,arguments)}}var M=Array.prototype.slice,P=Object.prototype.toString,I=v(_,l);return{trim:s,doall:t,reduce:o,all:i,some:a,onlySome:u,isFunction:r,isList:e,toList:n,identity:c,defined:l,unary:f,prop:p,func:d,eq:h,compose:m,callWith:g,partial:v,bind:y,keys:C,values:A,concat:N,flatten:w,uniq:x,first:E,select:_,negate:j,reject:k,seldef:I,map:S,mapdef:$,mapcat:H,partition:T,difference:q,interpose:L,indexOf:b,after:z,before:O,around:R}}(this);"function"==typeof require&&"undefined"!=typeof module&&(module.exports=cull);var dome=function(e){function n(t){if(e.isList(t))return e.flatten(e.map(n,t));for(var r=[],o=t.firstChild;o;)1===o.nodeType&&r.push(o),o=o.nextSibling;return r}function t(e){return document.getElementById(e)}function r(e,n){var t=n||document;if(t.getElementsByClassName)return t.getElementsByClassName(e);var r,o,i=t.getElementsByTagName("*"),a=[],u=new RegExp("(^|\\s)"+e+"(\\s|$)");for(r=0,o=i.length;o>r;++r)u.test(i[r].className)&&a.push(i[r]);return a}function o(e){e.parentNode.removeChild(e)}function i(e,n){e.parentNode&&(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e))}function a(e,n){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return t.test(n.className)}function u(n,t){return e.isList(t)?e.doall(e.partial(u,n),t):(a(n,t)||(t.className=e.trim(t.className+" "+n)),void 0)}function s(n,t){if(e.isList(t))return e.doall(e.partial(s,n),t);if(a(n,t)){var r=new RegExp("\\b"+n+"\\b","g");t.className=e.trim(t.className.replace(r,""))}}function c(e){var n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;var t="";for(e=e.firstChild;e;e=e.nextSibling)t+=c(e);return t}return 3===n||4===n?e.nodeValue:""}function l(n){var t=document.createDocumentFragment();return e.doall(e.bind(t,"appendChild"),e.toList(n)),t}function f(e){return e?("number"!=typeof e._dome_uuid&&(e._dome_uuid=w++),e._dome_uuid):null}function p(e,n){if(!n||!e)return!1;var t=f(e);if(b[t]||(b[t]={}),b[t][f(n)])return!0;for(var r=[];n&&n!==e;)r.push(f(n)),n=n.parentNode;for(var o=!!n,i=0,a=r.length;a>i;i++)b[t][r[i]]=o;return o}function d(e,n){var t;e=e||{};for(t in e)e.hasOwnProperty(t)&&(n.setAttribute("data-"+t,e[t]),n["data-"+t]=e[t])}function h(e,n){return n.getAttribute("data-"+e)}function m(e,n){var t,r;e=e||{};for(t in e)e.hasOwnProperty(t)&&(r=E[t],r?r(n,e[t]):n[t]=e[t])}function g(n,t){n=e.toList(n);var r,o;for(r=0,o=n.length;o>r;++r)"string"==typeof n[r]?t.appendChild(document.createTextNode(n[r])):t.appendChild(n[r])}function v(e,n){n.innerHTML="",g(e,n)}var y,w=0,b={},x=function(n){return null!==n&&"undefined"!=typeof n&&("undefined"!=typeof n.nodeType||"string"==typeof n||e.isList(n))},E={style:function(e,n){var t;for(t in n)n.hasOwnProperty(t)&&(e.style[t]=n[t])},data:function(e,n){d(n,e)}};return y=function(e,n,t){if(!t&&x(n))return y(e,{},n);var r=document.createElement(e);return m(n,r),g(t||[],r),r},y.toString=function(){return"dome.el()"},e.doall(function(n){y[n]=e.partial(y,n)},["a","br","div","fieldset","form","h2","h3","h4","h5","img","input","label","li","p","span","strong","textarea","ul","span","select","option","ol","iframe","table","tr","td","pre","button","i"]),{propmap:E,el:y,setProp:m,append:g,setContent:v,children:n,id:t,byClass:r,remove:o,replace:i,frag:l,text:c,data:{get:h,set:d},cn:{has:a,add:u,rm:s},uuid:f,contains:p}}(this.cull);!function(e,n){function t(e,n){return/^(?:function|object|unknown)$/.test(typeof e[n])}function r(e,n){return function(t){n.call(c[e],t||window.event)}}function o(e,n){return{handler:n,wrappedHandler:r(e,n)}}function i(e,n,t,r){a(n,t,function(n){e(n.target,t,n)&&r.call(n.target,n)})}var a,u,s=function(){if("undefined"!=typeof document.documentElement.uniqueID)return function(e){return e.uniqueID};var e=0;return function(n){return n.__uniqueID||(n.__uniqueID="uniqueID__"+e,e+=1),n.__uniqueID}}(),c={},l=document.documentElement;if(t(l,"addEventListener")&&t(l,"removeEventListener")&&t(window,"addEventListener")&&t(window,"removeEventListener"))a=function(e,n,t){return e.addEventListener(n,t,!1),{cancel:function(){u(e,n,t)}}},u=function(e,n,t){e.removeEventListener(n,t,!1)};else if(t(l,"attachEvent")&&t(l,"detachEvent")&&t(window,"attachEvent")&&t("detachEvent")){var f={};a=function(e,n,t){var r=s(e);c[r]=e,f[r]||(f[r]={}),f[r][n]||(f[r][n]=[]);var i=o(r,t);return f[r][n].push(i),e.attachEvent("on"+n,i.wrappedHandler),{cancel:function(){u(e,n,t)}}},u=function(n,t,r){var o=s(n);f[o]&&f[o][t]&&(f[o][t]=e.select(function(e){return e.handler!==r?!0:(n.detachEvent("on"+t,e.wrappedHandler),void 0)},f[o][t]))}}i.bycn=function(t,r,o,a){i(e.partial(n.cn.has,t),r,o,a)},dome.events={mouseenter:function(e,n){var t=null,r=a(e,"mouseover",function(r){t!==e&&(n.call(e,r),t=e)}),o=a(e,"mouseout",function(n){var r=n.relatedTarget||n.toElement;try{r&&!r.nodeName&&(r=r.parentNode)}catch(n){return}e===r||dome.contains(e,r)||(t=null)});return{cancel:function(){r.cancel(),o.cancel()}}},mouseleave:function(e,n){return a(e,"mouseout",function(t){dome.contains(e,t.relatedTarget)||e===t.relatedTarget||n.call(e,t)})}},dome.on=function(e,n,t){return dome.events[n]?dome.events[n](e,t):a(e,n,t)},dome.off=u,dome.delegate=i,dome.propmap.events=function(n,t){e.doall(function(e){a(n,e,t[e])},e.keys(t))}}(cull,dome),!function(e,n,t){function r(e,t){var r,o=n.createElement(e||"div");for(r in t)o[r]=t[r];return o}function o(e){for(var n=1,t=arguments.length;t>n;n++)e.appendChild(arguments[n]);return e}function i(e,n,t,r){var o=["opacity",n,~~(100*e),t,r].join("-"),i=.01+100*(t/r),a=Math.max(1-(1-e)/n*(100-i),e),u=f.substring(0,f.indexOf("Animation")).toLowerCase(),s=u&&"-"+u+"-"||"";return d[o]||(h.insertRule("@"+s+"keyframes "+o+"{"+"0%{opacity:"+a+"}"+i+"%{opacity:"+e+"}"+(i+.01)+"%{opacity:1}"+(i+n)%100+"%{opacity:"+e+"}"+"100%{opacity:"+a+"}"+"}",h.cssRules.length),d[o]=1),o}function a(e,n){var r,o,i=e.style;if(i[n]!==t)return n;for(n=n.charAt(0).toUpperCase()+n.slice(1),o=0;o>1):parseInt(i.left,10)+s)+"px",top:("auto"==i.top?t.y-n.y+(e.offsetHeight>>1):parseInt(i.top,10)+s)+"px"})),a.setAttribute("aria-role","progressbar"),o.lines(a,o.opts),!f){var l=0,p=i.fps,d=p/i.speed,h=(1-i.opacity)/(d*i.trail/100),m=d/i.lines;!function g(){l++;for(var e=i.lines;e;e--){var n=Math.max(1-(l+e*m)%d*h,i.opacity);o.opacity(a,i.lines-e,n,i)}o.timeout=o.el&&setTimeout(g,~~(1e3/p))}()}return o},stop:function(){var e=this.el;return e&&(clearTimeout(this.timeout),e.parentNode&&e.parentNode.removeChild(e),this.el=t),this},lines:function(e,n){function t(e,t){return u(r(),{position:"absolute",width:n.length+n.width+"px",height:n.width+"px",background:e,boxShadow:t,transformOrigin:"left",transform:"rotate("+~~(360/n.lines*s+n.rotate)+"deg) translate("+n.radius+"px"+",0)",borderRadius:(n.corners*n.width>>1)+"px"})}for(var a,s=0;s',n)}var n=u(r("group"),{behavior:"url(#default#VML)"});!a(n,"transform")&&n.adj?(h.addRule(".spin-vml","behavior:url(#default#VML)"),l.prototype.lines=function(n,t){function r(){return u(e("group",{coordsize:c+" "+c,coordorigin:-s+" "+-s}),{width:c,height:c})}function i(n,i,a){o(f,o(u(r(),{rotation:360/t.lines*n+"deg",left:~~i}),o(u(e("roundrect",{arcsize:t.corners}),{width:s,height:t.width,left:t.radius,top:-t.width>>1,filter:a}),e("fill",{color:t.color,opacity:t.opacity}),e("stroke",{opacity:0}))))}var a,s=t.length+t.width,c=2*s,l=2*-(t.width+t.length)+"px",f=u(r(),{position:"absolute",top:l,left:l});if(t.shadow)for(a=1;a<=t.lines;a++)i(a,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(a=1;a<=t.lines;a++)i(a);return o(n,f)},l.prototype.opacity=function(e,n,t,r){var o=e.firstChild;r=r.shadow&&r.lines||0,o&&n+r>>0,c=Math.max(0,Math.min(t,y)),f=[],l=y-c+1,p=[],d=a(),c)for(g=d.progress,m=function(e){p.push(e),--l||(h=m=v,d.reject(p))},h=function(e){f.push(e),--c||(h=m=v,d.resolve(f))},w=0;y>w;++w)w in n&&e(n[w],s,u,g);else d.resolve(f);return d.promise.then(r,o,i)})}function c(e,n,t,r){function o(e){return n?n(e[0]):e[0]}return s(e,1,o,t,r)}function l(e,n,t,r){return g(1,arguments),p(e,y).then(n,t,r)}function f(){return p(arguments,y)}function p(n,t){return e(n,function(n){var r,o,i,u,s,c;if(i=o=n.length>>>0,r=[],c=a(),i)for(u=function(n,o){e(n,t).then(function(e){r[o]=e,--i||c.resolve(r)},c.reject)},s=0;o>s;s++)s in n?u(n[s],s):--i;else c.resolve(r);return c.promise})}function d(n,t){var r=b.call(arguments,1);return e(n,function(n){var o;return o=n.length,r[0]=function(n,r,i){return e(n,function(n){return e(r,function(e){return t(n,e,i,o)})})},w.apply(n,r)})}function h(n,t,r){var o=arguments.length>2;return e(n,function(e){return e=o?r:e,t.resolve(e),e},function(e){return t.reject(e),i(e)},t.progress)}function m(e,n){for(var t,r=0;t=e[r++];)t(n)}function g(e,n){for(var t,r=n.length;r>e;)if(t=n[--r],null!=t&&"function"!=typeof t)throw new Error("arg "+r+" must be a function")}function v(){}function y(e){return e}var w,b,x;return e.defer=a,e.resolve=n,e.reject=t,e.join=f,e.all=l,e.map=p,e.reduce=d,e.any=c,e.some=s,e.chain=h,e.isPromise=u,r.prototype={always:function(e,n){return this.then(e,e,n)},otherwise:function(e){return this.then(x,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(n){return l(n,function(n){return e.apply(x,n)})})}},b=[].slice,w=[].reduce||function(e){var n,t,r,o,i;if(i=0,n=Object(this),o=n.length>>>0,t=arguments,t.length<=1)for(;;){if(i in n){r=n[i++];break}if(++i>=o)throw new TypeError}else r=t[1];for(;o>i;++i)i in n&&(r=e(r,n[i],i,n));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),("function"==typeof define&&define.amd&&function(e){define(e)}||"object"==typeof module&&function(e){module.exports=e()}||function(e){this.bane=e()})(function(){"use strict";function e(e,n,t){var r,o=t.length;if(o>0)for(r=0;o>r;++r)t[r](e,n);else setTimeout(function(){throw n.message=e+" listener threw error: "+n.message,n},0)}function n(e){if("function"!=typeof e)throw new TypeError("Listener is not function");return e}function t(e){return e.supervisors||(e.supervisors=[]),e.supervisors}function r(e,n){return e.listeners||(e.listeners={}),n&&!e.listeners[n]&&(e.listeners[n]=[]),n?e.listeners[n]:e.listeners}function o(e){return e.errbacks||(e.errbacks=[]),e.errbacks}function i(i){function u(n,t,r){try{t.listener.apply(t.thisp||i,r)}catch(a){e(n,a,o(i))}}return i=i||{},i.on=function(e,o,i){return"function"==typeof e?t(this).push({listener:e,thisp:o}):(r(this,e).push({listener:n(o),thisp:i}),void 0)},i.off=function(e,n){var i,a,u,s;if(!e){i=t(this),i.splice(0,i.length),a=r(this);for(u in a)a.hasOwnProperty(u)&&(i=r(this,u),i.splice(0,i.length));return i=o(this),i.splice(0,i.length),void 0}if("function"==typeof e?(i=t(this),n=e):i=r(this,e),!n)return i.splice(0,i.length),void 0;for(u=0,s=i.length;s>u;++u)if(i[u].listener===n)return i.splice(u,1),void 0},i.once=function(e,n,t){var r=function(){i.off(e,r),n.apply(this,arguments)};i.on(e,r,t)},i.bind=function(e,n){var t,r,o;if(n)for(r=0,o=n.length;o>r;++r){if("function"!=typeof e[n[r]])throw new Error("No such method "+n[r]);this.on(n[r],e[n[r]],e)}else for(t in e)"function"==typeof e[t]&&this.on(t,e[t],e);return e},i.emit=function(e){var n,o,i=t(this),s=a.call(arguments);for(n=0,o=i.length;o>n;++n)u(e,i[n],s);for(i=r(this,e).slice(),s=a.call(arguments,1),n=0,o=i.length;o>n;++n)u(e,i[n],s)},i.errback=function(e){this.errbacks||(this.errbacks=[]),this.errbacks.push(n(e))},i}var a=Array.prototype.slice;return{createEventEmitter:i}}),function(e,n,t){"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd?define(t):n[e]=t()}("reqwest",this,function(){function handleReadyState(e,n,t){return function(){e&&4==e[readyState]&&(e.onreadystatechange=noop,twoHundo.test(e.status)?n(e):t(e))}}function setHeaders(e,n){var t,r=n.headers||{};r.Accept=r.Accept||defaultHeaders.accept[n.type]||defaultHeaders.accept["*"],n.crossOrigin||r[requestedWith]||(r[requestedWith]=defaultHeaders.requestedWith),r[contentType]||(r[contentType]=n.contentType||defaultHeaders.contentType);for(t in r)r.hasOwnProperty(t)&&e.setRequestHeader(t,r[t])}function setCredentials(e,n){"undefined"!=typeof n.withCredentials&&"undefined"!=typeof e.withCredentials&&(e.withCredentials=!!n.withCredentials)}function generalCallback(e){lastValue=e}function urlappend(e,n){return e+(/\?/.test(e)?"&":"?")+n}function handleJsonp(e,n,t,r){var o=uniqid++,i=e.jsonpCallback||"callback",a=e.jsonpCallbackName||reqwest.getcallbackPrefix(o),u=new RegExp("((^|\\?|&)"+i+")=([^&]+)"),s=r.match(u),c=doc.createElement("script"),l=0,f=-1!==navigator.userAgent.indexOf("MSIE 10.0");s?"?"===s[3]?r=r.replace(u,"$1="+a):a=s[3]:r=urlappend(r,i+"="+a),win[a]=generalCallback,c.type="text/javascript",c.src=r,c.async=!0,"undefined"==typeof c.onreadystatechange||f||(c.event="onclick",c.htmlFor=c.id="_reqwest_"+o),c.onload=c.onreadystatechange=function(){return c[readyState]&&"complete"!==c[readyState]&&"loaded"!==c[readyState]||l?!1:(c.onload=c.onreadystatechange=null,c.onclick&&c.onclick(),e.success&&e.success(lastValue),lastValue=void 0,head.removeChild(c),l=1,void 0)},head.appendChild(c)}function getRequest(e,n,t){var r,o=(e.method||"GET").toUpperCase(),i="string"==typeof e?e:e.url,a=e.processData!==!1&&e.data&&"string"!=typeof e.data?reqwest.toQueryString(e.data):e.data||null;return"jsonp"!=e.type&&"GET"!=o||!a||(i=urlappend(i,a),a=null),"jsonp"==e.type?handleJsonp(e,n,t,i):(r=xhr(),r.open(o,i,!0),setHeaders(r,e),setCredentials(r,e),r.onreadystatechange=handleReadyState(r,n,t),e.before&&e.before(r),r.send(a),r)}function Reqwest(e,n){this.o=e,this.fn=n,init.apply(this,arguments)}function setType(e){var n=e.match(/\.(json|jsonp|html|xml)(\?|$)/);return n?n[1]:"js"}function init(o,fn){function complete(e){for(o.timeout&&clearTimeout(self.timeout),self.timeout=null;self._completeHandlers.length>0;)self._completeHandlers.shift()(e)}function success(resp){var r=resp.responseText;if(r)switch(type){case"json":try{resp=win.JSON?win.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp);self._fulfillmentHandlers.length>0;)self._fulfillmentHandlers.shift()(resp);complete(resp)}function error(e,n,t){for(self._responseArgs.resp=e,self._responseArgs.msg=n,self._responseArgs.t=t,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(e,n,t);complete(e)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this,type=o.type||setType(this.url);fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort()},o.timeout)),o.success&&this._fulfillmentHandlers.push(function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest(o,success,error)}function reqwest(e,n){return new Reqwest(e,n)}function normalize(e){return e?e.replace(/\r?\n/g,"\r\n"):""}function serial(e,n){var t=e.name,r=e.tagName.toLowerCase(),o=function(e){e&&!e.disabled&&n(t,normalize(e.attributes.value&&e.attributes.value.specified?e.value:e.text))};if(!e.disabled&&t)switch(r){case"input":if(!/reset|button|image|file/i.test(e.type)){var i=/checkbox/i.test(e.type),a=/radio/i.test(e.type),u=e.value;(!(i||a)||e.checked)&&n(t,normalize(i&&""===u?"on":u))}break;case"textarea":n(t,normalize(e.value));break;case"select":if("select-one"===e.type.toLowerCase())o(e.selectedIndex>=0?e.options[e.selectedIndex]:null);else for(var s=0;e.length&&so;++o)if(!uinit.areEqual(n[o],r[o]))return!1;return!0}function o(e,o,i,a){i.reloading?e.emit("reloading",i):e.emit("loading",i);var u=n(o,i.depends||[]),s=when.defer();return when.all(u).then(function(n){var o=(a?[a]:[]).concat(n),u=i.serializeArgs.apply(i,o);if(i.reloading&&r(i,u))return e.emit("skip",i),s.resolve();t(i,u);try{var c=i.action.apply(null,o);(c||i.nullable)&&(i.loaded=!0,i.result=c,e.emit("loaded",i,c))}catch(l){e.emit("error",i,l)}s.resolve()},function(n){e.emit("error",i,n),s.resolve()}),s.promise}function i(e,n){var t=b.partial(o,e,e.features,n);return n.elements?when.all(b.map(t,dome.byClass(n.elements,e.context))):t()}function a(n,t){return!t.lazy&&!t.loaded&&t.action&&e(n,t)}function u(e){return e&&e.lazy&&!e.loaded}function s(e,n){var t=function(n){return e[n]};return b.uniq(b.reduce(function(e,n){return e.concat(b.select(u,b.map(t,n.depends||[])))},[],n))}function c(e,n){return b.doall(function(e){b.doall(function(t){e[t]=n[t]},b.keys(n))},e)}function l(e){return c(e,{lazy:!1,wasLazy:!0})}function f(e){b.doall(function(e){e.action&&(e.loaded=!1,delete e.reloading),e.wasLazy&&(delete e.wasLazy,e.lazy=!0)},e)}function p(e,n){e.listeners&&e.listeners.pending&&b.doall(b.bind(e,"emit","pending"),b.select(function(e){return!e.ready&&!e.loaded&&!e.reloading},n))}function d(e,n,t){function r(){var o=b.first(u,c);return o?(i(e,o).then(function(){if(!o.loaded){var e=b.indexOf(o,c);c=c.slice(0,e).concat(c.slice(e+1))}r()}),void 0):(p(e,n),"function"==typeof t?t():null)}var o=l(s(e.features,n)),u=b.partial(a,e.features),c=b.uniq(o.concat(n));r()}function h(e,n){if(e[n])throw new Error("Cannot add duplicate "+n)}function m(){return b.map(function(e){return x.features[e]||{name:e,type:"Unknown"}},this.depends||[])}function g(e,n){n.hasOwnProperty("nullable")||(n.nullable=!0),n.hasOwnProperty("serializeArgs")||(n.serializeArgs=function(){return b.map(function(e){return e&&e.tagName&&e.appendChild?dome.uuid(e):e},arguments)}),n.dependencies=m,e.features[n.name]=n,e.tryPending()}function v(e,n){var t,r=[],o=b.values(n);do t=r.length,cull.doall(function(e){r=r.concat(b.select(function(n){return b.indexOf(e,n.depends||[])>=0},o))},e),r=b.uniq(r),e=b.map(b.prop("name"),r);while(t!==r.length);return r}function y(e,n,t){if("function"==typeof e&&(t=n,n=e,e=n.name),!e)throw new Error("Name cannot be blank");var r=t||{};return r.name=e,r.action=n,r}function w(e,n){var t=v([n],e.features);f(t),b.doall(function(e){e.reloading=!0},t),d(e,t)}var b=cull;t.cache={};var x;return x=bane.createEventEmitter({features:{},env:function(e,n){null!==n&&void 0!==n&&this.nullableEnv(e,n)},nullableEnv:function(e,n){var t=!!this.env[e];t||h(this.features,e);var r=n!==this.env[e];this.env[e]=n,g(this,{name:e,result:n,loaded:!0}),t&&this.loaded&&r&&w(this,e)},data:function(e,n,t){var r=y(e,n,t);return h(this.features,r.name),"boolean"!=typeof r.lazy&&(r.lazy=!0),"boolean"!=typeof r.nullable&&(r.nullable=!1),g(this,r)},feature:function(e,n,t){var r=y(e,n,t);if(h(this.features,r.name),"function"!=typeof r.action)throw new Error("Cannot add feature "+r.name+", action is not a function ("+typeof r.action+")");g(this,r)},scanEnvAttrs:function(e,n){for(var t,r,o,i,a=e.getElementsByTagName("*"),u=[e].concat([].slice.call(a,0)),s=0,c=u.length;c>s;++s)for(r=u[s].attributes,o=0,i=r.length;i>o;++o)t=r.item(o),0===t.nodeName.indexOf(n)&&this.env(t.nodeName.slice(n.length),t.nodeValue)},load:function(e){this.loaded&&f(b.values(this.features)),this.loaded=!0,this.context=e,this.tryPending()},tryPending:function(){this.loaded&&(this.emit("init"),d(this,b.values(this.features)))}})},this.uinit.areEqual=function(e,n){return e===n};var Showdown={extensions:{}},forEach=Showdown.forEach=function(e,n){if("function"==typeof e.forEach)e.forEach(n);else{var t,r=e.length;for(t=0;r>t;t++)n(e[t],t,e)}},stdExtName=function(e){return e.replace(/[_-]||\s/g,"").toLowerCase()};Showdown.converter=function(e){var n,t,r,o=0,i=[],a=[];if("undefind"!=typeof module&&"undefined"!=typeof exports&&"undefind"!=typeof require){var u=require("fs");if(u){var s=u.readdirSync((__dirname||".")+"/extensions").filter(function(e){return~e.indexOf(".js")}).map(function(e){return e.replace(/\.js$/,"")});Showdown.forEach(s,function(e){var n=stdExtName(e);Showdown.extensions[n]=require("./extensions/"+e)})}}if(this.makeHtml=function(e){return n={},t={},r=[],e=e.replace(/~/g,"~T"),e=e.replace(/\$/g,"~D"),e=e.replace(/\r\n/g,"\n"),e=e.replace(/\r/g,"\n"),e="\n\n"+e+"\n\n",e=M(e),e=e.replace(/^[ \t]+$/gm,""),Showdown.forEach(i,function(n){e=f(n,e)}),e=C(e),e=d(e),e=p(e),e=m(e),e=O(e),e=e.replace(/~D/g,"$$"),e=e.replace(/~T/g,"~"),Showdown.forEach(a,function(n){e=f(n,e)}),e},e&&e.extensions){var c=this;Showdown.forEach(e.extensions,function(e){if("string"==typeof e&&(e=Showdown.extensions[stdExtName(e)]),"function"!=typeof e)throw"Extension '"+e+"' could not be loaded. It was either not found or is not a valid extension.";Showdown.forEach(e(c),function(e){e.type?"language"===e.type||"lang"===e.type?i.push(e):("output"===e.type||"html"===e.type)&&a.push(e):a.push(e)})})}var l,f=function(e,n){if(e.regex){var t=new RegExp(e.regex,"g");return n.replace(t,e.replace)}return e.filter?e.filter(n):void 0},p=function(e){return e+="~0",e=e.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|(?=~0))/gm,function(e,r,o,i,a){return r=r.toLowerCase(),n[r]=$(o),i?i+a:(a&&(t[r]=a.replace(/"/g,""")),"")}),e=e.replace(/~0/,"")},d=function(e){return e=e.replace(/\n/g,"\n\n"),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,h),e=e.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|style|section|header|footer|nav|article|aside)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm,h),e=e.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,h),e=e.replace(/(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g,h),e=e.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,h),e=e.replace(/\n\n/g,"\n")},h=function(e,n){var t=n;return t=t.replace(/\n\n/g,"\n"),t=t.replace(/^\n/,""),t=t.replace(/\n+$/g,""),t="\n\n~K"+(r.push(t)-1)+"K\n\n"},m=function(e){e=E(e);var n=A("
");return e=e.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,n),e=e.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,n),e=e.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,n),e=_(e),e=q(e),e=N(e),e=d(e),e=T(e)},g=function(e){return e=S(e),e=v(e),e=H(e),e=b(e),e=y(e),e=L(e),e=$(e),e=k(e),e=e.replace(/ +\n/g,"
\n")},v=function(e){var n=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;return e=e.replace(n,function(e){var n=e.replace(/(.)<\/?code>(?=.)/g,"$1`"); return n=P(n,"\\`*_")})},y=function(e){return e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,w),e=e.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,w),e=e.replace(/(\[([^\[\]]+)\])()()()()()/g,w)},w=function(e,r,o,i,a,u,s,c){void 0==c&&(c="");var l=r,f=o,p=i.toLowerCase(),d=a,h=c;if(""==d)if(""==p&&(p=f.toLowerCase().replace(/ ?\n/g," ")),d="#"+p,void 0!=n[p])d=n[p],void 0!=t[p]&&(h=t[p]);else{if(!(l.search(/\(\s*\)$/m)>-1))return l;d=""}d=P(d,"*_");var m='"},b=function(e){return e=e.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,x),e=e.replace(/(!\[(.*?)\]\s?\([ \t]*()?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,x)},x=function(e,r,o,i,a,u,s,c){var l=r,f=o,p=i.toLowerCase(),d=a,h=c;if(h||(h=""),""==d){if(""==p&&(p=f.toLowerCase().replace(/ ?\n/g," ")),d="#"+p,void 0==n[p])return l;d=n[p],void 0!=t[p]&&(h=t[p])}f=f.replace(/"/g,"""),d=P(d,"*_");var m=''+f+''+g(t)+"")}),e=e.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(e,t){return A('

'+g(t)+"

")}),e=e.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(e,t,r){var o=t.length;return A("'+g(r)+"")})},_=function(e){e+="~0";var n=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;return o?e=e.replace(n,function(e,n,t){var r=n,o=t.search(/[*+-]/g)>-1?"ul":"ol";r=r.replace(/\n{2,}/g,"\n\n\n");var i=l(r);return i=i.replace(/\s+$/,""),i="<"+o+">"+i+"\n"}):(n=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,e=e.replace(n,function(e,n,t,r){var o=n,i=t,a=r.search(/[*+-]/g)>-1?"ul":"ol",i=i.replace(/\n{2,}/g,"\n\n\n"),u=l(i);return u=o+"<"+a+">\n"+u+"\n"})),e=e.replace(/~0/,"")};l=function(e){return o++,e=e.replace(/\n{2,}$/,"\n"),e+="~0",e=e.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(e,n,t,r,o){var i=o,a=n;return a||i.search(/\n{2,}/)>-1?i=m(R(i)):(i=_(R(i)),i=i.replace(/\n$/,""),i=g(i)),"
  • "+i+"
  • \n"}),e=e.replace(/~0/g,""),o--,e};var q=function(e){return e+="~0",e=e.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(e,n,t){var r=n,o=t;return r=j(R(r)),r=M(r),r=r.replace(/^\n+/g,""),r=r.replace(/\n+$/g,""),r="
    "+r+"\n
    ",A(r)+o}),e=e.replace(/~0/,"")},C=function(e){return e+="~0",e=e.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(e,n,t){var r=n,o=t;return o=j(o),o=M(o),o=o.replace(/^\n+/g,""),o=o.replace(/\n+$/g,""),o="
    "+o+"\n
    ",A(o)}),e=e.replace(/~0/,"")},A=function(e){return e=e.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(r.push(e)-1)+"K\n\n"},S=function(e){return e=e.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(e,n,t,r){var o=r;return o=o.replace(/^([ \t]*)/g,""),o=o.replace(/[ \t]*$/g,""),o=j(o),n+""+o+""})},j=function(e){return e=e.replace(/&/g,"&"),e=e.replace(//g,">"),e=P(e,"*_{}[]\\",!1)},k=function(e){return e=e.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),e=e.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2")},N=function(e){return e=e.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(e,n){var t=n;return t=t.replace(/^[ \t]*>[ \t]?/gm,"~0"),t=t.replace(/~0/g,""),t=t.replace(/^[ \t]+$/gm,""),t=m(t),t=t.replace(/(^|\n)/g,"$1 "),t=t.replace(/(\s*
    [^\r]+?<\/pre>)/gm,function(e,n){var t=n;return t=t.replace(/^  /gm,"~0"),t=t.replace(/~0/g,"")}),A("
    \n"+t+"\n
    ")})},T=function(e){e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,"");for(var n=e.split(/\n{2,}/g),t=[],o=n.length,i=0;o>i;i++){var a=n[i];a.search(/~K(\d+)K/g)>=0?t.push(a):a.search(/\S/)>=0&&(a=g(a),a=a.replace(/^([ \t]*)/g,"

    "),a+="

    ",t.push(a))}o=t.length;for(var i=0;o>i;i++)for(;t[i].search(/~K(\d+)K/)>=0;){var u=r[RegExp.$1];u=u.replace(/\$/g,"$$$$"),t[i]=t[i].replace(/~K\d+K/,u)}return t.join("\n\n")},$=function(e){return e=e.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),e=e.replace(/<(?![a-z\/?\$!])/gi,"<")},H=function(e){return e=e.replace(/\\(\\)/g,I),e=e.replace(/\\([`*_{}\[\]()>#+-.!])/g,I)},L=function(e){return e=e.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'
    $1'),e=e.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(e,n){return z(O(n))})},z=function(e){var n=[function(e){return"&#"+e.charCodeAt(0)+";"},function(e){return"&#x"+e.charCodeAt(0).toString(16)+";"},function(e){return e}];return e="mailto:"+e,e=e.replace(/./g,function(e){if("@"==e)e=n[Math.floor(2*Math.random())](e);else if(":"!=e){var t=Math.random();e=t>.9?n[2](e):t>.45?n[1](e):n[0](e)}return e}),e=''+e+"",e=e.replace(/">.+:/g,'">')},O=function(e){return e=e.replace(/~E(\d+)E/g,function(e,n){var t=parseInt(n);return String.fromCharCode(t)})},R=function(e){return e=e.replace(/^(\t|[ ]{1,4})/gm,"~0"),e=e.replace(/~0/g,"")},M=function(e){return e=e.replace(/\t(?=\t)/g," "),e=e.replace(/\t/g,"~A~B"),e=e.replace(/~B(.+?)~A/g,function(e,n){for(var t=n,r=4-t.length%4,o=0;r>o;o++)t+=" ";return t}),e=e.replace(/~A/g," "),e=e.replace(/~B/g,"")},P=function(e,n,t){var r="(["+n.replace(/([\[\]\\])/g,"\\$1")+"])";t&&(r="\\\\"+r);var o=new RegExp(r,"g");return e=e.replace(o,I)},I=function(e,n){var t=n.charCodeAt(0);return"~E"+t+"E"}},"undefined"!=typeof module&&(module.exports=Showdown),"function"==typeof define&&define.amd&&define("showdown",function(){return Showdown}),function(e){"function"==typeof define&&define.amd?define([],e):this.timeago=e()}(function(){function e(e,n,t,r){var o="function"==typeof n?n(r,t):n,i=e.numbers&&e.numbers[r]||r;return o.replace(/%d/i,i)}function n(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(e){this.locale=e;for(var n in o)"undefined"==typeof this.locale[n]&&(this.locale[n]=o[n])}var r,o={prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]};return t.prototype=r={locale:o,locales:{en:o},configure:function(e){var n=new t(e||r.locales.en);return n},relative:function(e){return this.inWords((new Date).getTime()-e.getTime())},inWords:function(t){var r=this.locale,o=r.prefixAgo,i=r.suffixAgo;0>t&&(o=r.prefixFromNow,i=r.suffixFromNow);var a=Math.abs(t)/1e3,u=a/60,s=u/60,c=s/24,l=c/365,f=45>a&&e(r,r.seconds,t,Math.round(a))||90>a&&e(r,r.minute,t,1)||45>u&&e(r,r.minutes,t,Math.round(u))||90>u&&e(r,r.hour,t,1)||24>s&&e(r,r.hours,t,Math.round(s))||42>s&&e(r,r.day,t,1)||30>c&&e(r,r.days,t,Math.round(c))||45>c&&e(r,r.month,t,1)||365>c&&e(r,r.months,t,Math.round(c/30))||1.5>l&&e(r,r.year,t,1)||e(r,r.years,t,Math.round(l));return f=[o,f,i].join("string"==typeof r.wordSeparator?r.wordSeparator:""),n(f)},parse:function(e){var t=n(e);return t=t.replace(/\.\d+/,""),t=t.replace(/-/,"/").replace(/-/,"/"),t=t.replace(/T/," ").replace(/Z/," UTC"),t=t.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),new Date(t)}},r});// Set up a global, shared app instance this.gts=this.gts||{},this.gts.app=this.uinit(),function(){var e=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};this.uinit.areEqual=function t(n,r){if(n===r)return!0;if(e(n)||!e(r))return n.length!==r.length;var i,s;for(i=0,s=n.length;i '+s+": "+(i&&i[0]||r)})}function i(n){var r=e.input({type:"text",className:"gts-ref-input"}),i=e.form({className:"gts-ref-input",events:{submit:function(e){e.preventDefault(),window.location=t(n,r.value)}}},[r]);return e.li({className:"gts-dropdown-input",events:{click:function(e){e.stopPropagation()}}},[e.strong(["Enter ref: ",i])])}function s(n,r,i){var s=[e.li({className:"dropdown-label"},[e.strong(n)])];return cull.reduce(function(n,r){var s=t(i,r[1]);return n.push(e.li(e.a({href:s},r[0]))),n},s,r.sort())}function o(t,n){return e.ul({className:"dropdown-menu"},[i(n)].concat(s("Branches",t.heads||[],n)).concat(s("Tags",t.tags||[],n)))}function u(t,n,i){return e.div({className:"dropdown gts-branch-selector pull-right"},[r(t,n),o(t,i)])}function a(e,t,n,r){var i=u(t,n,r);e.parentNode.insertBefore(i,e),e.parentNode.removeChild(e),this.gts.dropdown(i)}return a.build=u,a.getCurrentRef=n,a}(dome.el),this.gts=this.gts||{},this.gts.treeHistory=function(e,t){function n(e,t){return e.getElementsByTagName(t)}function s(t,n){return e.select(function(e){return e.name===t},n)[0]}function o(e){if(!Date.parse)return"";var t=new Date(Date.parse(e));return i[t.getMonth()]+" "+t.getDate()+" "+t.getFullYear()}function u(e){var t,n;for(t=0,n=e.length;t Watch',e.href=t.watchPath)}function o(e,t){gts.request({url:t.unwatchPath,method:"delete",type:"js",headers:{Accept:"application/javascript, text/javascript"},success:function(n){t.watching=!1,s(e,t)},error:function(){e.innerHTML="Failed, try watching again"}})}function u(e,t){gts.request({url:t.watchPath,method:"post",type:"text",headers:{Accept:"application/javascript, text/javascript"},success:function(n){t.watching=!0,t.unwatchPath=n.getResponseHeader("location"),s(e,t)},error:function(){e.innerHTML="Failed, try unwatching again"}})}function a(e,t){gts.loading(e),t.watching?o(e,t):u(e,t)}function f(e,t){var n=dome.el("a",{className:"btn"});dome.replace(e,n),s(n,t),dome.on(n,"click",function(e){e.preventDefault(),e.stopPropagation(),a(n,t)})}function l(e,t){if(!t.clonePath)return;dome.replace(e,dome.el("a",{href:t.clonePath,className:"btn"},"Clone"))}function c(e,t){if(!t.requestMergePath)return;dome.replace(e,dome.el("li",{className:"pull-right"},[dome.el("a",{href:t.requestMergePath},[dome.el("i",{className:"icon icon-random"})," Request merge"])]))}return i.build=r,f.watch=u,f.unwatch=o,f.toggleState=a,f.render=s,{admin:i,watching:f,cloning:l,mergeRequest:c}}(dome.el),this.gts=this.gts||{},this.gts.railsLinks=function(e,t){dome.on(document.body,"click",function(n){var r=dome.data.get("method",n.target);if(!r||r==="get")return!0;n.preventDefault(),n.stopPropagation();var i=n.target.href,s=dome.el("form",{method:"post",action:i,style:{display:"none"}},[dome.el("input",{name:"_method",value:r,type:"hidden"}),dome.el("input",{name:e,value:t,type:"hidden"})]);document.body.appendChild(s),s.submit()})},this.gts=this.gts||{},this.gts.cloneNameSuggestion=function(){function e(e,t){var n=/s$/.test(e)?e:e+"s";return n+"-"+t}return function(n){function f(){if(u.value&&cull.indexOf(u.value,a)<0)return;if(i.checked){u.value=a[0];return}if(s.checked){var t=o.options[o.selectedIndex];u.value=e(t.innerHTML,r)}}var r=dome.data.get("gts-repository-to-clone",n),i=dome.id("repository_owner_type_user"),s=dome.id("repository_owner_type_group"),o=dome.id("repository_owner_id_group_select"),u=dome.id("repository_name"),a=cull.reduce(function(t,n){return t.concat(e(n.innerHTML,r))},[e(dome.data.get("gts-owner",i),r)],o.options);dome.on(i,"click",f),dome.on(s,"click",f),dome.on(o,"change",f),f()}}(),this.gts=this.gts||{},this.gts.loading=function(e,t){dome.cn.add("loading",e),e.innerHTML="",t=t||{};var n=(new Spinner({lines:t.hasOwnProperty("lines")?t.lines:8,length:t.hasOwnProperty("length")?t.length:2,width:t.hasOwnProperty("width")?t.width:2,radius:t.hasOwnProperty("radius")?t.radius:3,color:t.color||"#000",speed:t.hasOwnProperty("speed")?t.speed:1,trail:t.hasOwnProperty("trail")?t.trail:100,shadow:t.hasOwnProperty("shadow")?t.shadow:!1})).spin();n.el.style.top=t.topPos||"10px",e.appendChild(n.el);var r=t.hasOwnProperty("text")?t.text:"Loading...";if(r){var i=document.createElement("span");i.innerHTML=r,e.appendChild(i)}},this.gts=this.gts||{},this.gts.oidRefInterpolator=function(e,t,n){var r=this.gts.refSelector.getCurrentRef("heads",e.innerHTML,t);r&&(e.title=r[1],e.innerHTML=r[0])},this.gts=this.gts||{},this.gts.comments=function(e){function t(t){var n=this.gts.timeago(e.span({title:t.createdAt}));return t.createdAt===t.updatedAt?n:e.span([n,"(edited ",this.gts.timeago(e.span({title:t.updatedAt})),")"])}function n(e){console.log("Edit")}function r(t){if(!t.editPath)return"";var r=e.a({href:t.editPath,events:{click:function(e){e.preventDefault(),e.stopPropagation(),n(r.parentNode.parentNode)}}},"Edit comment");return r}function i(n){var i=n.author;return e.div({className:"gts-comment"},[e.p({innerHTML:n.body}),e.p([e.img({src:i.avatarPath}),e.a({href:i.profilePath},i.name),t(n),r(n)])])}function s(e,t){if(e.length===0)return;t.style.display="block";var n=document.createElement("div");t.appendChild(n),dome.setContent(cull.map(i,e),n)}function o(e){return e<10?"0"+e:e}function u(t,n){n.style.display="block";var r=dome.byClass("gts-comment-author-ph",n)[0];if(!r)return r;var i=new Date;return dome.replace(r,e.p([e.img({src:t.avatarPath}),e.a({href:t.profilePath},t.name)," "+o(i.getHours())+":"+o(i.getMinutes())]))}return{renderComments:s,renderComment:i,personalizeForm:u}}(dome.el),this.gts=this.gts||{},this.gts.slugify=function(){function e(e){return e.toLowerCase().replace(/[^a-z0-9_\-]+/g,"-").replace(/^\-|\-$/g,"")}function t(t,n){return n===""||e(t)===n}return function(r,i){function o(){t(s,i.value)&&(i.value=e(r.value),s=r.value)}var s=r.value;dome.on(r,"keyup",o),dome.on(r,"focus",o),o()}}(),this.gts=this.gts||{},this.gts.selectDetails=function(e){function n(n){t.innerHTML=dome.data.get("description",e.options[e.selectedIndex])}var t=document.getElementById(dome.data.get("target",e));if(!t)return;dome.on(e,"change",n),n()},gts.app.env("url",window.location.href),gts.app.env("redirect",function(e){window.location=e}),window.hasOwnProperty("onpopstate")&&(window.onpopstate=function(e){gts.app.env("url",window.location.href)}),cull.doall(function(e){e.name==="csrf-param"&>s.app.env("csrf-param",e.content),e.name==="csrf-token"&>s.app.env("csrf-token",e.content)},document.getElementsByTagName("meta")),gts.request=function(e){e.headers=e.headers||{},e.headers["X-CSRF-Token"]=gts.app.env["csrf-token"],reqwest(e)},function(){var e=document.getElementById("project_title");e&>s.app.env("project-title-input",e),e=document.getElementById("project_slug"),e&>s.app.env("project-slug-input",e)}(),gts.app.data("ref-url-template",function(e,t){return gts.url.templatize(e,{ref:t})},{depends:["url","current-ref"],serializeArgs:function(e,t){return[e.split("#")[0],t]}}),gts.app.data("repository-refs",this.gts.jsonRequest,{depends:["repository-refs-url"]}),gts.app.data("current-ref",gts.url.currentRef,{depends:["url"]}),gts.app.data("user-repo-view-state",gts.cache(gts.userRepoViewState),{depends:["user-repository-path"]}),gts.app.data("current-user",cull.prop("user"),{depends:["user-repo-view-state"]}),gts.app.data("current-repository",cull.prop("repository"),{depends:["user-repo-view-state"]}),gts.app.data("repository-watch",cull.prop("watch"),{depends:["current-repository"]}),gts.app.data("repository-admin",cull.prop("admin"),{depends:["current-repository"]}),gts.app.data("blob-region",gts.blob.regionFromUrl,{depends:["url"]}),gts.app.feature("google-analytics",gts.googleAnalytics,{depends:["analytics-account","analytics-domain-name"]}),gts.app.feature("dropdown",gts.dropdown,{elements:["dropdown"]}),gts.app.feature("ref-selector",gts.refSelector,{elements:["gts-ref-selector-ph"],depends:["repository-refs","current-ref","ref-url-template"]}),gts.app.feature("oid-ref-interpolator",gts.oidRefInterpolator,{elements:["gts-oid"],depends:["repository-refs","ref-url-template"]}),gts.app.feature("tree-history",gts.treeHistory,{elements:["gts-tree-explorer"],depends:["tree-history-url"]}),gts.app.feature("commit-linker",gts.commitLinker,{elements:["gts-body"],depends:["commit-url-template","redirect"]}),gts.app.feature("profile-menu",gts.profileMenu,{elements:["login_button"],depends:["current-user"]}),gts.app.feature("clone-url-selection",gts.cloneUrlSelection,{elements:["gts-repo-urls"]}),gts.app.feature("highlight-region",gts.blob.highlightRegion,{elements:["gts-lines"],depends:["blob-region"]}),gts.app.feature("track-blob-focus",gts.blob.trackFocus,{elements:["gts-lines"],depends:["redirect"]}),gts.app.feature("live-markdown-preview",gts.liveMarkdownPreview,{elements:["gts-live-markdown-preview"]}),gts.app.feature("timeago",gts.timeago.periodic(6e4),{elements:["timeago"]}),gts.app.feature("collapse",gts.collapse),gts.app.feature("clone-name-suggestion",gts.cloneNameSuggestion,{elements:["clone-repository-form"]}),gts.app.feature("loading",gts.loading,{elements:["loading"]}),gts.app.feature("rails-links",gts.railsLinks,{depends:["csrf-param","csrf-token"]}),gts.app.feature("repository-admin-menu",gts.repository.admin,{elements:["gts-repository-admin-ph"],depends:["repository-admin"]}),gts.app.feature("repository-watching",gts.repository.watching,{elements:["gts-watch-repository-ph"],depends:["repository-watch"]}),gts.app.feature("repository-cloning",gts.repository.cloning,{elements:["gts-clone-repository-ph"],depends:["current-repository"]}),gts.app.feature("repository-merge-request",gts.repository.mergeRequest,{elements:["gts-request-merge-ph"],depends:["current-repository"]}),gts.app.feature("slugify-project-title",gts.slugify,{depends:["project-title-input","project-slug-input"]}),gts.app.feature("select-details",gts.selectDetails,{elements:["gts-option-details"]}),setTimeout(function(){gts.app.scanEnvAttrs(document.body,"data-gts-env-"),gts.app.load(document.documentElement)},10);