upjs-rails 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/dist/up-bootstrap.js +9 -17
  4. data/dist/up-bootstrap.min.js +1 -1
  5. data/dist/up.js +384 -458
  6. data/dist/up.min.js +2 -2
  7. data/lib/assets/javascripts/up/boot.js.coffee +2 -2
  8. data/lib/assets/javascripts/up/browser.js.coffee +2 -2
  9. data/lib/assets/javascripts/up/bus.js.coffee +39 -88
  10. data/lib/assets/javascripts/up/flow.js.coffee +25 -33
  11. data/lib/assets/javascripts/up/form.js.coffee +2 -2
  12. data/lib/assets/javascripts/up/history.js.coffee +8 -7
  13. data/lib/assets/javascripts/up/layout.js.coffee +19 -18
  14. data/lib/assets/javascripts/up/link.js.coffee +2 -2
  15. data/lib/assets/javascripts/up/magic.js.coffee +41 -27
  16. data/lib/assets/javascripts/up/modal.js.coffee +74 -57
  17. data/lib/assets/javascripts/up/motion.js.coffee +11 -10
  18. data/lib/assets/javascripts/up/navigation.js.coffee +11 -10
  19. data/lib/assets/javascripts/up/popup.js.coffee +19 -16
  20. data/lib/assets/javascripts/up/proxy.js.coffee +17 -16
  21. data/lib/assets/javascripts/up/tooltip.js.coffee +28 -14
  22. data/lib/assets/javascripts/up/util.js.coffee +14 -22
  23. data/lib/assets/javascripts/up-bootstrap/layout-ext.js.coffee +5 -6
  24. data/lib/assets/javascripts/up-bootstrap/modal-ext.js.coffee +8 -8
  25. data/lib/assets/javascripts/up-bootstrap/navigation-ext.js.coffee +2 -5
  26. data/lib/assets/javascripts/up.js.coffee +0 -1
  27. data/lib/upjs/rails/version.rb +1 -1
  28. data/spec_app/Gemfile.lock +1 -1
  29. data/spec_app/spec/javascripts/up/bus_spec.js.coffee +43 -6
  30. data/spec_app/spec/javascripts/up/flow_spec.js.coffee +1 -1
  31. data/spec_app/spec/javascripts/up/history_spec.js.coffee +3 -3
  32. data/spec_app/spec/javascripts/up/layout_spec.js.coffee +9 -11
  33. data/spec_app/spec/javascripts/up/link_spec.js.coffee +7 -9
  34. data/spec_app/spec/javascripts/up/magic_spec.js.coffee +5 -5
  35. data/spec_app/spec/javascripts/up/modal_spec.js.coffee +8 -10
  36. data/spec_app/spec/javascripts/up/navigation_spec.js.coffee +13 -13
  37. data/spec_app/spec/javascripts/up/popup_spec.js.coffee +1 -5
  38. data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +51 -52
  39. data/spec_app/spec/javascripts/up/tooltip_spec.js.coffee +19 -5
  40. data/spec_app/spec/javascripts/up/util_spec.js.coffee +14 -23
  41. metadata +1 -3
  42. data/lib/assets/javascripts/up/slot.js.coffee +0 -63
  43. data/spec_app/spec/javascripts/up/slot_spec.js.coffee +0 -16
data/dist/up.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,E,P,D,O,z,U,j,M,F,W,L,I,N,R,H,q,J,K,B,X,_,G,V,Q,Z,Y,tt,et,nt,rt,ot,ut,it,at,st,lt,ct,pt,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,$t,xt,St,Ct,At,Tt,Et,Pt,Dt,Ot,zt,Ut,jt;return ot=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},o=function(t){return t=f(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),$.ajax(t)},G=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ct=function(t,e){var n,r,o;return n=null,V(t)?(n=$("<a>").attr({href:t}).get(0),M(n.hostname)&&(n.href=n.href)):n=Ot(t),r=n.protocol+"//"+n.hostname,G(n.protocol,n.port)||(r+=":"+n.port),o=n.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),r+=o,(null!=e?e.hash:void 0)===!0&&(r+=n.hash),(null!=e?e.search:void 0)!==!1&&(r+=n.search),r},lt=function(t){return t?t.toUpperCase():"GET"},e=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;for(h=t.split(/[ >]/),r=null,c=p=0,d=h.length;d>p;c=++p){for(i=h[c],u=i.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),v="div",o=[],l=null,f=0,m=u.length;m>f;f++)switch(a=u[f],a[0]){case".":o.push(a.substr(1));break;case"#":l=a.substr(1);break;default:v=a}s="<"+v,o.length&&(s+=' class="'+o.join(" ")+'"'),l&&(s+=' id="'+l+'"'),s+=">",e=$(s),n&&e.appendTo(n),0===c&&(r=e),n=e}return r},m=function(t,e){var n;return n=document.createElement(t),X(e)&&(n.innerHTML=e),n},y=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},jt=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},S=function(){var e,n,r,o;throw n=1<=arguments.length?t.call(arguments,0):[],n[0]="[UP] "+n[0],(o=up.browser).puts.apply(o,["error"].concat(t.call(n))),r=A.apply(null,n),e=gt($(".up-error"))||$('<div class="up-error"></div>').prependTo("body"),e.addClass("up-error"),e.text(r),new Error(r)},r=/\%[odisf]/g,A=function(){var e,n,o,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,o=80,u.replace(r,function(){var t,r;return n+=1,t=e[n],r=typeof t,"string"===r?(t=t.replace(/\s+/g," "),t.length>o&&(t=t.substr(0,o)+"\u2026"),t='"'+t+'"'):t="undefined"===r?"undefined":"number"===r||"function"===r?t.toString():JSON.stringify(t),t.length>o&&(t=t.substr(0,o)+" \u2026",("object"===r||"function"===r)&&(t+=" }")),t})},v=function(t){var e,n,r,o,u,i,a;for(y("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},h=function(t){var e,n,r,o,u,i,a,s,l,c,p,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=m("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=m("head"),s.appendChild(a),c=m("title",p[1]),a.appendChild(c)),s):m("div",t)},T=$.extend,Dt=$.trim,w=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},nt=w,z=function(t){return t},Et=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},J=function(t){return null===t},Q=function(t){return void 0===t},W=function(t){return!Q(t)},q=function(t){return Q(t)||J(t)},N=function(t){return!q(t)},M=function(t){return q(t)||B(t)&&0===Object.keys(t).length||0===t.length},gt=function(t,e){return null==e&&(e=X),e(t)?t:null},X=function(t){return!M(t)},I=function(t){return"function"==typeof t},V=function(t){return"string"==typeof t},K=function(t){return"number"==typeof t},R=function(t){return"object"==typeof t&&!!t},B=function(t){return R(t)||"function"==typeof t},L=function(t){return!(!t||1!==t.nodeType)},H=function(t){return t instanceof jQuery},_=function(t){return B(t)&&I(t.then)},F=function(t){return _(t)&&I(t.resolve)},U=function(t){return N(t)?t:void 0},j=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Pt=function(t){return Array.prototype.slice.call(t)},f=function(t){return j(t)?t.slice():T({},t)},Ot=function(t){return H(t)?t.get(0):t},ut=function(t,e){return T(f(t),e)},vt=function(t,e){var n,r,o,u;if(o=t?f(t):{},e)for(r in e)n=e[r],u=o[r],N(u)?B(n)&&B(u)&&(o[r]=vt(u,n)):o[r]=n;return o},ht=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,I(i)&&(i=i()),N(i)){u=i;break}return u},b=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},u=function(t,e){var n;return n=b(t,e),W(n)},l=function(t){return St(t,N)},zt=function(t){var e;return e={},St(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},St=function(t,e){var n;return n=[],w(t,function(t){return e(t)?n.push(t):void 0}),n},yt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),b(o,X)},st=function(t){return setTimeout(t,0)},tt=function(t){return t[t.length-1]},s=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},xt=ot(function(){var t,e,n;return t=$("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),dt=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Tt=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):dt(r)},O=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),M(n)?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},g=function(t,e,r){var o,u,i,a,s,l;return o=$(t),up.browser.canCssAnimation()?(r=vt(r,{duration:300,delay:0,easing:"ease"}),u=$.Deferred(),a={"transition-property":Object.keys(e).join(", "),"transition-duration":r.duration+"ms","transition-delay":r.delay+"ms","transition-timing-function":r.easing},s=O(o),l=Tt(o,a),o.css(e),u.then(s),u.then(l),o.data(n,u),u.then(function(){return o.removeData(n)}),i=setTimeout(function(){return u.resolve()},r.duration+r.delay),u.then(function(){return clearTimeout(i)}),u):(o.css(e),kt())},n="up-animation-promise",P=function(t){return $(t).each(function(){var t;return(t=$(this).data(n))?t.resolve():void 0})},rt=function(t,e){var n,r,o,u,i,a;return e=vt(e,{relative:!1,inner:!1,full:!1}),e.relative?e.relative===!0?u=t.position():(n=$(e.relative),i=t.offset(),n.is(document)?u=i:(o=n.offset(),u={left:i.left-o.left,top:i.top-o.top})):u=t.offset(),r={left:u.left,top:u.top},e.inner?(r.width=t.width(),r.height=t.height()):(r.width=t.outerWidth(),r.height=t.outerHeight()),e.full&&(a=s(),r.right=a.width-(r.left+r.width),r.bottom=a.height-(r.top+r.height)),r},d=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],n.specified?i.push(e.attr(n.name,n.value)):i.push(void 0);return i},E=function(t,e){return t.find(e).addBack(e)},C=function(t){return 27===t.keyCode},At=function(t,e){return 0===t.indexOf(e)},x=function(t,e){return t.indexOf(e)===t.length-e.length},p=function(t,e){return t.indexOf(e)>=0},a=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},et=function(t){return t.getResponseHeader("X-Up-Location")},it=function(t){return t.getResponseHeader("X-Up-Method")},mt=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Z=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},Y=function(t){var e;return e=Q(t.button)||0===t.button,e&&Z(t)},kt=function(){var t;return t=$.Deferred(),t.resolve(),t},$t=function(){return kt().promise()},pt=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},wt=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=$.when.apply($,e),n.resolve=function(){return w(e,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},n},Ct=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],q(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},bt=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},k=function(){return $([])},at=function(t){var e,n,r,o,i,a,s;for(i={},s=[],n=[],r=0,o=t.length;o>r;r++)a=t[r],V(a)?s.push(a):n.push(a);return i.parsed=n,s.length&&(e=s.join(", "),i.parsed.push(e)),i.select=function(){return i.find(void 0)},i.find=function(t){var e,n,r,o,u,a;for(n=k(),u=i.parsed,r=0,o=u.length;o>r;r++)a=u[r],e=t?t.find(a):$(a),n=n.add(e);return n},i.findWithSelf=function(t){var e;return e=i.find(t),i.doesMatch(t)&&(e=e.add(t)),e},i.doesMatch=function(t){var e;return e=$(t),u(i.parsed,function(t){return e.is(t)})},i.seekUp=function(t){var e,n,r;for(r=$(t),e=r,n=void 0;e.length;){if(i.doesMatch(e)){n=e;break}e=e.parent()}return n||k()},i},i=function(e){var n,r,o,u,i,a,s,l,c,p,d,m;return null==e&&(e={}),d=void 0,r=function(){return d={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],y.apply(null,n)):void 0},a=function(){return Object.keys(d)},l=function(){return q(e.size)?void 0:I(e.size)?e.size():K(e.size)?e.size:S("Invalid size config: %o",e.size)},o=function(){return q(e.expiry)?void 0:I(e.expiry)?e.expiry():K(e.expiry)?e.expiry:S("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},Dt=function(){var t,e,n,r;return r=f(a()),n=l(),n&&r.length>n&&(t=null,e=null,w(r,function(n){var r,o;return r=d[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete d[t]:void 0},n=function(t,e){var n;return n=u(t),W(n)?p(e,n):void 0},m=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),d[n]={timestamp:m(),value:e}},bt=function(t){var e;return e=c(t),delete d[e]},i=function(t){var e,n;return e=o(),e?(n=m()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=c(t),(n=d[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),bt(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:bt,clear:r,keys:a}},c=function(t){var e,n;return null==t&&(t={}),n={ensureKeyExists:function(e){return t.hasOwnProperty(e)||S("Unknown setting %o",e)},reset:function(){var r,o,u,i;for(i=f(Object.getOwnPropertyNames(n)),r=0,u=i.length;u>r;r++)o=i[r],p(e,o)||delete n[o];return n.update(f(t))},update:function(t){var e,r,o;if(t){if(V(t))return n.ensureKeyExists(t),n[t];r=[];for(e in t)o=t[e],n.ensureKeyExists(e),r.push(n[e]=o);return r}return n}},e=Object.getOwnPropertyNames(n),n.reset(),n},Ut=function(t){var e,n;return t=Ot(t),e=t.parentNode,n=Pt(t.childNodes),w(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},ft=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},D=function(t,e){var n,r,o,u;return n=$(t),r=ft(n),o=n.position(),u=r.offset(),n.css({position:"absolute",left:o.left-u.left,top:o.top-u.top+e.scrollTop(),right:"",bottom:""})},{offsetParent:ft,fixedToAbsolute:D,presentAttr:yt,createElement:m,normalizeUrl:ct,normalizeMethod:lt,createElementFromHtml:h,$createElementFromSelector:e,createSelectorFromElement:v,ajax:o,extend:T,copy:f,merge:ut,options:vt,option:ht,error:S,debug:y,warn:jt,each:w,map:nt,identity:z,times:Et,any:u,detect:b,select:St,compact:l,uniq:zt,last:tt,isNull:J,isDefined:W,isUndefined:Q,isGiven:N,isMissing:q,isPresent:X,isBlank:M,presence:gt,isObject:B,isFunction:I,isString:V,isElement:L,isJQuery:H,isPromise:_,isDeferred:F,isHash:R,ifGiven:U,isUnmodifiedKeyEvent:Z,isUnmodifiedMouseEvent:Y,nullJquery:pt,unJquery:Ot,nextFrame:st,measure:rt,temporaryCss:Tt,cssAnimate:g,finishCssAnimate:P,forceCompositing:O,escapePressed:C,copyAttributes:d,findWithSelf:E,contains:p,startsWith:At,endsWith:x,isArray:j,toArray:Pt,castedAttr:a,locationFromXhr:et,methodFromXhr:it,clientSize:s,only:mt,trim:Dt,resolvedPromise:$t,resolvedDeferred:kt,resolvableWhen:wt,setMissingAttrs:Ct,remove:bt,memoize:ot,scrollbarWidth:xt,config:c,cache:i,unwrapElement:Ut,multiSelector:at,emptyJQuery:k,evalConsoleTemplate:A}}(),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(){var e,n,r,o,u,i,a,s,l,c,p,f,d,m;return d=up.util,c=function(t,e){var n,r,o,u,i,a;return null==e&&(e={}),i=d.option(e.method,"get").toLowerCase(),"get"===i?location.href=t:$.rails?(a=e.target,o=$.rails.csrfToken(),r=$.rails.csrfParam(),n=$("<form method='post' action='"+t+"'></form>"),u="<input name='_method' value='"+i+"' type='hidden' />",d.isDefined(r)&&d.isDefined(o)&&(u+="<input name='"+r+"' value='"+o+"' type='hidden' />"),a&&n.attr("target",a),n.hide().append(u).appendTo("body"),n.submit()):error("Can't fake a "+i.toUpperCase()+" request without Rails UJS")},f=function(){var e,n,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],d.isDefined(console[o])||(o="log"),r()?console[o].apply(console,e):(n=d.evalConsoleTemplate.apply(d,e),console[o](n))},m=function(){return location.href},o=d.memoize(function(){return d.isDefined(history.pushState)&&"get"===u()}),i=d.memoize(function(){return d.isUndefined(document.addEventListener)}),a=d.memoize(function(){return i()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),e=d.memoize(function(){return"transition"in document.documentElement.style}),n=d.memoize(function(){return"oninput"in document.createElement("input")}),r=d.memoize(function(){return!a()}),s=d.memoize(function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9}),p=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,d.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},u=d.memoize(function(){return(p("_up_request_method")||"get").toLowerCase()}),l=function(){return!i()&&s()},{url:m,loadPage:c,canPushState:o,canCssAnimation:e,canInputEvent:n,canLogSubstitution:r,isSupported:l,puts:f}}()}.call(this),function(){var t=[].slice;up.bus=function(){var e,n,r,o,u,i,a,s,l;return l=up.util,e={},r={},i=function(){return e=l.copy(r)},n=function(t){return e[t]||(e[t]=[])},a=function(){var t,n,o;r={},o=[];for(n in e)t=e[n],o.push(r[n]=l.copy(t));return o},u=function(t,e){var r,o,u,i;for(i=t.split(" "),o=0,u=i.length;u>o;o++)r=i[o],n(r).push(e);return function(){return s(t,e)}},s=function(t,e){var r,o,u,i,a;for(i=t.split(" "),a=[],o=0,u=i.length;u>o;o++)r=i[o],a.push(l.remove(n(r),e));return a},o=function(){var e,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r=n(o),l.each(r,function(t){return t.apply(null,e)})},u("framework:ready",a),u("framework:reset",i),{on:u,off:s,emit:o}}()}.call(this),function(){var t=[].slice;up.magic=function(){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return g=up.util,e="up-destroyable",n="up-destroyer",f=[],l=null,p=function(t,e,n){var r,o;if(up.browser.isSupported())return r=[t,e,function(t){return n.apply(this,[t,$(this),a(this)])}],f.push(r),(o=$(document)).on.apply(o,r)},i=[],s=null,u=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(u=e.pop(),n=g.options(e[0],{batch:!1}),i.push({selector:r,callback:u,batch:n.batch})):void 0},r=function(t,r,o){var u;return g.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[r,a(r)]),g.isFunction(u)?(r.addClass(e),r.data(n,u)):void 0},o=function(t){var e,n,o,a;for(g.debug("Compiling fragment %o",t),a=[],n=0,o=i.length;o>n;n++)u=i[n],e=g.findWithSelf(t,u.selector),e.length?u.batch?a.push(r(u,e,e.get())):a.push(e.each(function(){return r(u,$(this),this)})):a.push(void 0);return a},c=function(t){return g.findWithSelf(t,"."+e).each(function(){var t,e;return t=$(this),(e=t.data(n))()})},a=function(t){var e,n;return e=$(t),n=e.attr("up-data"),g.isString(n)&&""!==g.trim(n)?JSON.parse(n):{}},v=function(){return l=g.copy(f),s=g.copy(i)},h=function(){var t,e,n,r;for(e=0,n=f.length;n>e;e++)t=f[e],g.contains(l,t)||(r=$(document)).off.apply(r,t);return f=g.copy(l),i=g.copy(s)},m=function(t){var e;return e=$(t),up.bus.emit("fragment:ready",e),e},d=function(t){return p("keydown","body",function(e){return g.escapePressed(e)?t(e):void 0})},up.bus.on("app:ready",function(){return m(document.body)}),up.bus.on("fragment:ready",o),up.bus.on("fragment:destroy",c),up.bus.on("framework:ready",v),up.bus.on("framework:reset",h),{compiler:u,on:p,ready:m,onEscape:d,data:a}}(),up.compiler=up.magic.compiler,up.on=up.magic.on,up.ready=up.magic.ready,up.awaken=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.util.warn("up.awaken has been renamed to up.compiler and will be removed in a future version"),up.compiler.apply(up,e)}}.call(this),function(){up.history=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return h=up.util,e=h.config({popTargets:["body"],restoreScroll:!0}),l=void 0,u=void 0,d=function(){return e.reset(),l=void 0,u=void 0},i=function(t){return h.normalizeUrl(t,{hash:!0})},n=function(){return i(up.browser.url())},r=function(t){return i(t)===n()},a=function(t){return u&&(l=u,u=void 0),u=t},f=function(t,e){return o("replace",t,e)},c=function(t,e){return o("push",t,e)},o=function(e,o,u){var i,s;return u=h.options(u,{force:!1}),u.force||!r(o)?up.browser.canPushState()?(i=e+"State",s=t(),h.debug("Changing history to URL %o (%o)",o,e),window.history[i](s,"",o),a(n())):h.error("This browser doesn't support history.pushState"):void 0},t=function(){return{fromUp:!0}},m=function(t){var r,o;return o=n(),h.debug("Restoring state %o (now on "+o+")",t),r=e.popTargets.join(", "),up.replace(r,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:e.restoreScroll})},s=function(t){var e;return h.debug("History state popped to URL %o",n()),a(n()),up.layout.saveScroll({url:l}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?m(e):h.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(p=function(){return $(window).on("popstate",s),f(n(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?p():setTimeout(p,100)),up.compiler("[up-back]",function(t){return h.isPresent(l)?(h.setMissingAttrs(t,{"up-href":l,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.bus.on("framework:reset",d),{defaults:e.update,push:c,replace:f,url:n,previousUrl:function(){return l},normalizeUrl:i}}()}.call(this),function(){var t=[].slice;up.layout=function(){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y;return m=up.util,r=m.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),i=m.cache({size:30,key:up.history.normalizeUrl}),s=function(){return r.reset(),i.clear()},e="up-scroll-promise",f=function(t,n,u){var i,a,s,l,c;return i=$(t),u=m.options(u),s=m.option(u.duration,r.duration),l=m.option(u.easing,r.easing),o(i),s>0?(a=$.Deferred(),i.data(e,a),a.then(function(){return i.removeData(e),i.finish()}),c={scrollTop:n},i.get(0)===document&&(i=$("html, body")),i.animate(c,{duration:s,easing:l,complete:function(){return a.resolve()}}),a):(i.scrollTop(n),m.resolvedDeferred())},o=function(t){return $(t).each(function(){var t;return(t=$(this).data(e))?t.resolve():void 0})},n=function(){return m.multiSelector(r.anchoredRight).select()},a=function(){var e,n,o,u;return o=function(t,e){var n,r;return n=$(t),r=n.css(e),m.isPresent(r)||m.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},n=function(){var t,e,n,i;for(n=$(r.fixedTop.join(", ")),i=[],t=0,e=n.length;e>t;t++)u=n[t],i.push(o(u,"top"));return i}(),e=function(){var t,e,n,i;for(n=$(r.fixedBottom.join(", ")),i=[],t=0,e=n.length;e>t;t++)u=n[t],i.push(o(u,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(t.call(n))),bottom:Math.max.apply(Math,[0].concat(t.call(e)))}},c=function(t,e){var n,o,u,i,s,l,c,p,d,v,g,y,b,w;return e=m.options(e),n=$(t),o=e.viewport?$(e.viewport):h(n),y=m.option(e.snap,r.snap),w=o.is(document),b=w?m.clientSize().height:o.height(),d=o.scrollTop(),l=d,p=void 0,c=void 0,w?(c=a(),p=0):(c={top:0,bottom:0},p=d),v=function(){return l+c.top},g=function(){return l+b-c.bottom-1},u=m.measure(n,{relative:o}),i=u.top+p,s=i+Math.min(u.height,r.substance)-1,s>g()&&(l+=s-g()),(i<v()||e.top)&&(l=i-c.top),y>l&&(l=0),l!==d?f(o,l,e):m.resolvedDeferred()},v=function(){return m.multiSelector(r.viewports)},h=function(t){var e,n;return e=$(t),n=v().seekUp(e),n.length||m.error("Could not find viewport for %o",e),n},y=function(t){var e;return e=$(t),v().findWithSelf(e)},g=function(){return v().select()},d=function(){var t,e,n,o,u,i,a;for(i={},u=r.viewports,e=0,o=u.length;o>e;e++)a=u[e],t=$(a),t.length&&(n=a,a===document&&(n="document"),i[n]=t.scrollTop());return i},u=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),m.isPresent(r.fixedTop)&&(e=e.add(n.find(r.fixedTop.join(", ")))),m.isPresent(r.fixedBottom)&&(e=e.add(n.find(r.fixedBottom.join(", ")))),e},p=function(t){var e,n;return null==t&&(t={}),n=m.option(t.url,up.history.url()),e=m.option(t.tops,d()),i.set(n,e)},l=function(t){var e,n,r,o,u,a,s,l,c;null==t&&(t={}),o=void 0,t.around?(n=y(t.around),e=h(t.around),o=e.add(n)):o=g(),c=i.get(up.history.url()),a=[];for(u in c)l=c[u],s="document"===u?document:u,r=o.filter(s),a.push(up.scroll(r,l,{duration:0}));return a},up.bus.on("framework:reset",s),{reveal:c,scroll:f,finishScrolling:o,defaults:r.update,viewportOf:h,viewportsWithin:y,viewports:g,scrollTops:d,saveScroll:p,restoreScroll:l,anchoredRight:n,fixedChildren:u}}(),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return g=up.util,m=function(t,e){var n;return n=$(t),g.isPresent(e)&&(e=g.normalizeUrl(e)),n.attr("up-source",e)},h=function(t){var e;return e=$(t).closest("[up-source]"),g.presence(e.attr("up-source"))||up.browser.url()},p=function(t,e,n){var r,o,u;return g.debug("Replace %o with %o (options %o)",t,e,n),n=g.options(n),u=g.presence(t)?t:g.createSelectorFromElement($(t)),up.browser.canPushState()||n.history===!1?(o={url:e,method:n.method,selector:u,cache:n.cache,preload:n.preload},r=up.proxy.ajax(o),r.done(function(t,r,a){var s,l;return(s=g.locationFromXhr(a))&&(g.debug("Location from server: %o",s),l={url:s,method:g.methodFromXhr(a),selector:u},up.proxy.alias(o,l),e=s),n.history!==!1&&(n.history=e),n.source!==!1&&(n.source=e),n.preload?void 0:i(u,t,n)}),r.fail(g.error),r):(n.preload||up.browser.loadPage(e,g.only(n,"method")),g.resolvedPromise())},i=function(t,e,n){var o,u,i,a,c,p,f,d;for(n=g.options(n,{historyMethod:"push"}),n.source=g.option(n.source,n.history),p=l(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),c=s(t,n),f=[],i=0,a=c.length;a>i;i++)d=c[i],u=r(d.selector),o=p.find(d.selector).first(),f.push(v(u,o,d.pseudoClass,d.transition,n));return f},r=function(t){return o(".up-popup "+t)||o(".up-modal "+t)||o(t)||u(t)},u=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),g.error(e,t)},l=function(t){var e;return e=g.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("title"))?t.textContent:void 0},find:function(n){var r;return(r=e.querySelector(n))?$(r):g.error("Could not find selector %o in response %o",n,t)}}},d=function(t,e){return e.reveal?up.reveal(t):g.resolvedDeferred()},n=function(e,n){return"function"==typeof n.insert&&n.insert(e),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&m(e,n.source),n.restoreScroll&&up.layout.restoreScroll({around:e}),t(e),up.ready(e)},v=function(t,r,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=r.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),g.copyAttributes(r,t),n(a.children(),i),d(a,i).then(function(){return up.animate(a,u,i)}).then(function(){g.unwrapElement(a)})):e(t,{animation:function(){return r.insertBefore(t),n(r,i),t.is("body")&&"none"!==u&&g.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,r,u,i)}})},s=function(t,e){var n,r,o,u,i,a,s,l,c,p,f;for(p=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),g.isPresent(p)&&(f=p.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),c=f[o]||g.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:c});return a},t=function(t){var e,n;return n="[autofocus]:last",e=g.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},a=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},o=function(t){var e,n,r,o,u,i;for(o=$(t).get(),n=null,u=0,i=o.length;i>u;u++)if(r=o[u],e=$(r),a(e)){n=e;break}return n},e=function(t,e){var n,r,o;return n=$(t),e=g.options(e,{animation:"none"}),r=up.motion.animateOptions(e),n.addClass("up-destroying"),g.isPresent(e.url)&&up.history.push(e.url),g.isPresent(e.title)&&(document.title=e.title),up.bus.emit("fragment:destroy",n),o=g.presence(e.animation,g.isDeferred)||up.motion.animate(n,e.animation,r),o.then(function(){return n.remove()}),o},c=function(t,e){var n;return e=g.options(e,{cache:!1}),n=e.url||h(t),p(t,n,e)},f=function(){return up.bus.emit("framework:reset")},up.bus.on("app:ready",function(){return m(document.body,up.browser.url())}),{replace:p,reload:c,destroy:e,implant:i,reset:f,first:o}}(),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.reset=up.flow.reset,up.first=up.flow.first}.call(this),function(){up.motion=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k;return w=up.util,o={},a={},b={},s={},i=w.config({duration:300,delay:0,easing:"ease"}),h=function(){return o=w.copy(a),b=w.copy(s),i.reset()},e=function(t,r,o){var i;return i=$(t),c(i),o=n(o),("none"===r||r===!1)&&d(),w.isFunction(r)?u(r(i,o),r):w.isString(r)?e(i,l(r),o):w.isHash(r)?w.cssAnimate(i,r,o):w.error("Unknown animation type %o",r)},n=function(t,e){var n;return null==e&&(e=null),t=w.options(t),n={},n.easing=w.option(t.easing,null!=e?e.attr("up-easing"):void 0,i.easing),n.duration=Number(w.option(t.duration,null!=e?e.attr("up-duration"):void 0,i.duration)),n.delay=Number(w.option(t.delay,null!=e?e.attr("up-delay"):void 0,i.delay)),n},l=function(t){return o[t]||w.error("Unknown animation %o",r)},t="up-ghosting-promise",k=function(e,n,r,o){var u,i,a,s,l,c,p;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(e),w.temporaryCss(n,{display:"none"},function(){return s=m(e,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),w.temporaryCss(e,{display:"none"},function(){return r.reveal&&up.reveal(n,{viewport:u}),i=m(n,u),a=u.scrollTop()}),s.moveTop(a-l),e.hide(),p=w.temporaryCss(n,{visibility:"hidden"}),c=o(s.$ghost,i.$ghost),e.data(t,c),n.data(t,c),c.then(function(){return e.removeData(t),n.removeData(t),s.$bounds.remove(),i.$bounds.remove(),p()}),c},c=function(t){return $(t).each(function(){var t;return t=$(this),w.finishCssAnimate(t),p(t)})},p=function(e){var n;return(n=e.data(t))?(w.debug("Canceling existing ghosting on %o",e),"function"==typeof n.resolve?n.resolve():void 0):void 0},u=function(t,e){return w.isDeferred(t)?t:w.error("Did not return a promise with .then and .resolve methods: %o",e)},f=function(t,r,i,a){var s,l,p,d,m,h;return l=$(t),s=$(r),up.browser.canCssAnimation()?(d=w.only(a,"reveal"),d=w.extend(d,n(a)),c(l),c(s),"none"===i||i===!1||(p=o[i])?(l.hide(),a.reveal&&up.reveal(s),e(s,p||"none",a)):(h=w.presence(i,w.isFunction)||b[i])?k(l,s,d,function(t,e){var n;return n=h(t,e,d),u(n,i)}):w.isString(i)&&i.indexOf("/")>=0?(m=i.split("/"),h=function(t,n,r){return v(e(t,m[0],r),e(n,m[1],r))},f(l,s,h,d)):w.error("Unknown transition %o",i)):(l.hide(),w.resolvedDeferred())},m=function(t,e){var n,r,o,u,i,a,s,l,c;for(u=w.measure(t,{relative:!0,inner:!0}),o=t.clone(),o.find("script").remove(),o.css({position:"static"===t.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),o.addClass("up-ghost"),n=$('<div class="up-bounds"></div>'),n.css({position:"absolute"}),n.css(u),c=u.top,l=function(t){return 0!==t?(c+=t,n.css({top:c})):void 0},o.appendTo(n),n.insertBefore(t),l(t.offset().top-o.offset().top),r=up.layout.fixedChildren(o),a=0,s=r.length;s>a;a++)i=r[a],w.fixedToAbsolute(i,e);return{$ghost:o,$bounds:n,moveTop:l}},y=function(t,e){return b[t]=e},r=function(t,e){return o[t]=e},g=function(){return a=w.copy(o),s=w.copy(b)},v=w.resolvableWhen,d=w.resolvedDeferred,r("none",d),r("fade-in",function(t,n){return t.css({opacity:0}),e(t,{opacity:1},n)}),r("fade-out",function(t,n){return t.css({opacity:1}),e(t,{opacity:0},n)}),r("move-to-top",function(t,n){var r,o;return r=w.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),e(t,{"margin-top":"-"+o+"px"},n)}),r("move-from-top",function(t,n){var r,o;return r=w.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),e(t,{"margin-top":"0px"},n)}),r("move-to-bottom",function(t,n){var r,o;return r=w.measure(t),o=w.clientSize().height-r.top,t.css({"margin-top":"0px"}),e(t,{"margin-top":o+"px"},n)}),r("move-from-bottom",function(t,n){var r,o;return r=w.measure(t),o=w.clientSize().height-r.top,t.css({"margin-top":o+"px"}),e(t,{"margin-top":"0px"},n)}),r("move-to-left",function(t,n){var r,o;return r=w.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),e(t,{"margin-left":"-"+o+"px"},n)}),r("move-from-left",function(t,n){var r,o;return r=w.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),e(t,{"margin-left":"0px"},n)}),r("move-to-right",function(t,n){var r,o;return r=w.measure(t),o=w.clientSize().width-r.left,t.css({"margin-left":"0px"}),e(t,{"margin-left":o+"px"},n)}),r("move-from-right",function(t,n){var r,o;return r=w.measure(t),o=w.clientSize().width-r.left,t.css({"margin-left":o+"px"}),e(t,{"margin-left":"0px"},n)}),r("roll-down",function(t,n){var r,o;return r=t.height(),o=w.temporaryCss(t,{height:"0px",overflow:"hidden"}),e(t,{height:r+"px"},n).then(o)}),y("none",d),y("move-left",function(t,n,r){return v(e(t,"move-to-left",r),e(n,"move-from-right",r))}),y("move-right",function(t,n,r){return v(e(t,"move-to-right",r),e(n,"move-from-left",r))}),y("move-up",function(t,n,r){return v(e(t,"move-to-top",r),e(n,"move-from-bottom",r))}),y("move-down",function(t,n,r){return v(e(t,"move-to-bottom",r),e(n,"move-from-top",r))}),y("cross-fade",function(t,n,r){return v(e(t,"fade-out",r),e(n,"fade-in",r))}),up.bus.on("framework:ready",g),up.bus.on("framework:reset",h),{morph:f,animate:e,animateOptions:n,finish:c,transition:y,animation:r,defaults:i.update,none:d,when:v,prependCopy:m}}(),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){up.proxy=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,E,P;return P=up.util,t=void 0,S=void 0,u=void 0,k=void 0,i=void 0,d=P.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),s=function(t){return w(t),[t.url,t.method,t.data,t.selector].join("|")},a=P.cache({size:function(){return d.cacheSize},expiry:function(){return d.cacheExpiry},key:s,log:"up.proxy"}),m=a.get,T=a.set,C=a.remove,f=a.clear,c=function(){return clearTimeout(S),S=null},l=function(){return clearTimeout(u),u=null},A=function(){return t=null,c(),l(),k=0,d.reset(),i=!1,a.clear()},A(),r=a.alias,w=function(t){return t._normalized||(t.method=P.normalizeMethod(t.method),t.url&&(t.url=P.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},n=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=P.only(t,"url","method","data","selector","_normalized"),r=!0,v(u)||e?(o=m(u))&&!n?r="pending"===o.state():(o=g(u),T(u,o),o.fail(function(){return C(u)})):(f(),o=g(u)),r&&!t.preload&&(b(),o.always(y)),o},e=["GET","OPTIONS","HEAD"],h=function(){return 0===k},o=function(){return k>0},b=function(){var t,e;return e=h(),k+=1,e?(t=function(){return o()?(up.bus.emit("proxy:busy"),i=!0):void 0},d.busyDelay>0?u=setTimeout(t,d.busyDelay):t()):void 0},
2
- y=function(){return k-=1,h()&&i?(up.bus.emit("proxy:idle"),i=!1):void 0},g=function(t){var e;return P.debug("Loading URL %o",t.url),up.bus.emit("proxy:load",t),e=P.ajax(t),e.always(function(){return up.bus.emit("proxy:receive",t)}),e},v=function(t){return w(t),P.contains(e,t.method)},p=function(e){var n,r;return r=parseInt(P.presentAttr(e,"up-delay"))||d.preloadDelay,e.is(t)?void 0:(t=e,c(),n=function(){return x(e),t=null},E(n,r))},E=function(t,e){return S=setTimeout(t,e)},x=function(t,e){var n,r;return n=$(t),e=P.options(e),r=up.link.followMethod(n,e),v({method:r})?(P.debug("Preloading %o",n),e.preload=!0,up.follow(n,e)):(P.debug("Won't preload %o due to unsafe method %o",n,r),P.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:p(e)}),up.bus.on("framework:reset",A),{preload:x,ajax:n,get:m,alias:r,clear:f,remove:C,idle:h,busy:o,defaults:d.update}}()}.call(this),function(){up.link=function(){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){return e=u.options(e),u.option(e.method,t.attr("up-method"),t.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function(){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m;return n=$(t).closest("form"),e=u.options(e),c=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),p=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),p),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:c,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:p}),up.flow.implant(c,t,r)}).fail(function(t,e,n){var i,a;return a=t.responseText,i=u.merge(s,{transition:o}),up.flow.implant(r,a,i)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m;return d=up.util,u=void 0,n=d.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),c=function(){return e(),n.reset()},p=function(t,e,n){var r,o;return o=d.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return d.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),a(e)},a=function(t){var e,n,r,o,u,i,a;if(n=d.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},l=function(){var t;return t=$(".up-popup"),t.attr("up-previous-url",up.browser.url()),t.attr("up-previous-title",document.title)},i=function(){var t;return t=$(".up-popup"),t.removeAttr("up-previous-url"),t.removeAttr("up-previous-title")},o=function(t,e,n){var r,o;return o=d.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=d.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),l(),o.hide(),o},m=function(t,e,n,r,o){return e.show(),p(t,e,n),up.animate(e,r,o)},s=function(t,r){var u,i,a,s,l,c,p,f,h;return u=$(t),r=d.options(r),h=d.option(r.url,u.attr("href")),p=d.option(r.target,u.attr("up-popup"),"body"),c=d.option(r.position,u.attr("up-position"),n.position),s=d.option(r.animation,u.attr("up-animation"),n.openAnimation),f=d.option(r.sticky,d.castedAttr(u,"up-sticky")),l=up.browser.canPushState()?d.option(r.history,d.castedAttr(u,"up-history"),!1):!1,a=up.motion.animateOptions(r,u),e(),i=o(u,p,f),up.replace(p,h,{history:l,insert:function(){return m(u,i,c,s,a)}})},f=function(){return u},e=function(t){var e;return e=$(".up-popup"),e.length?(t=d.options(t,{animation:n.closeAnimation,url:e.attr("up-previous-url"),title:e.attr("up-previous-title")}),u=void 0,up.destroy(e,t)):d.resolvedPromise()},t=function(){return $(".up-popup").is("[up-sticky]")?void 0:(i(),e())},r=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?e():s(n)}),up.on("click","body",function(t,n){var r;return r=$(t.target),r.closest(".up-popup").length||r.closest("[up-popup]").length?void 0:e()}),up.bus.on("fragment:ready",function(e){var n;return r(e)?(n=e.attr("up-source"))?u=n:void 0:t()}),up.magic.onEscape(function(){return e()}),up.on("click","[up-close]",function(t,n){return n.closest(".up-popup").length?(e(),t.preventDefault()):void 0}),up.bus.on("framework:reset",c),{open:s,close:e,source:f,defaults:n.update,contains:r}}()}.call(this),function(){var t=[].slice;up.modal=function(){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return m=up.util,r=m.config({maxWidth:void 0,minWidth:void 0,width:void 0,height:void 0,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),i=void 0,c=function(){return n(),i=void 0,r.reset()},d=function(){var t;return t=r.template,m.isFunction(t)?t(r):t},l=function(){var t;return t=$(".up-modal"),t.attr("up-previous-url",up.browser.url()),t.attr("up-previous-title",document.title)},a=function(){var t;return t=$(".up-modal"),t.removeAttr("up-previous-url"),t.removeAttr("up-previous-title")},u=function(t){var e,n,r,o;return r=$(d()),t.sticky&&r.attr("up-sticky",""),r.attr("up-previous-url",up.browser.url()),r.attr("up-previous-title",document.title),n=r.find(".up-modal-dialog"),m.isPresent(t.width)&&n.css("width",t.width),m.isPresent(t.maxWidth)&&n.css("max-width",t.maxWidth),m.isPresent(t.height)&&n.css("height",t.height),e=r.find(".up-modal-content"),o=m.$createElementFromSelector(t.selector),o.appendTo(e),r.appendTo(document.body),l(),r.hide(),r},h=[],p=function(){var t,e,n,r;return n=m.scrollbarWidth(),t=parseInt($("body").css("padding-right")),e=n+t,r=m.temporaryCss($("body"),{"padding-right":e+"px","overflow-y":"hidden"}),h.push(r),up.layout.anchoredRight().each(function(){var t,e,r,o;return t=$(this),e=parseInt(t.css("right")),r=n+e,o=m.temporaryCss(t,{right:r}),h.push(o)})},v=function(t,e,n){var r;return up.bus.emit("modal:open"),p(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.bus.emit("modal:opened")}),r},s=function(){var e,o,i,a,s,l,c,p,f,d,h,g,y;return s=1<=arguments.length?t.call(arguments,0):[],!m.isObject(s[0])||m.isElement(s[0])||m.isJQuery(s[0])?(e=$(s[0]),f=s[1]):(e=m.nullJquery(),f=s[0]),f=m.options(f),g=m.option(f.url,e.attr("up-href"),e.attr("href")),d=m.option(f.target,e.attr("up-modal"),"body"),y=m.option(f.width,e.attr("up-width"),r.width),p=m.option(f.maxWidth,e.attr("up-max-width"),r.maxWidth),l=m.option(f.height,e.attr("up-height"),r.height),a=m.option(f.animation,e.attr("up-animation"),r.openAnimation),h=m.option(f.sticky,m.castedAttr(e,"up-sticky")),c=up.browser.canPushState()?m.option(f.history,m.castedAttr(e,"up-history"),!0):!1,i=up.motion.animateOptions(f,e),n(),o=u({selector:d,width:y,maxWidth:p,height:l,sticky:h}),up.replace(d,g,{history:c,insert:function(){return v(o,a,i)}})},f=function(){return i},n=function(t){var e,n;return e=$(".up-modal"),e.length?(t=m.options(t,{animation:r.closeAnimation,url:e.attr("up-previous-url"),title:e.attr("up-previous-title")}),i=void 0,up.bus.emit("modal:close"),n=up.destroy(e,t),n.then(function(){for(var t;t=h.pop();)t();return up.bus.emit("modal:closed")}),n):m.resolvedDeferred()},e=function(){return $(".up-modal").is("[up-sticky]")?void 0:(a(),n())},o=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():s(e)}),up.on("click","body",function(t,e){var r;return r=$(t.target),r.closest(".up-modal-dialog").length||r.closest("[up-modal]").length?void 0:n()}),up.bus.on("fragment:ready",function(t){var n;if(o(t)){if(n=t.attr("up-source"))return i=n}else if(!up.popup.contains(t))return e()}),up.magic.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.bus.on("framework:reset",c),{open:s,close:n,source:f,defaults:r.update,contains:o}}()}.call(this),function(){up.tooltip=function(){var t,e,n,r,o;return o=up.util,r=function(t,e,n){var r,u,i;return u=o.measure(t),i=o.measure(e),r=function(){switch(n){case"top":return{left:u.left+.5*(u.width-i.width),top:u.top-i.height};case"bottom":return{left:u.left+.5*(u.width-i.width),top:u.top+u.height};default:return o.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},e=function(t){return o.$createElementFromSelector(".up-tooltip").html(t).appendTo(document.body)},n=function(n,u){var i,a,s,l,c,p;return null==u&&(u={}),i=$(n),c=o.option(u.html,i.attr("up-tooltip"),i.attr("title")),p=o.option(u.position,i.attr("up-position"),"top"),l=o.option(u.animation,o.castedAttr(i,"up-animation"),"fade-in"),s=up.motion.animateOptions(u,i),t(),a=e(c),r(i,a,p),up.animate(a,l,s)},t=function(t){var e;return e=$(".up-tooltip"),e.length?(t=o.options(t,{animation:"fade-out"}),t=o.merge(t,up.motion.animateOptions(t)),up.destroy(e,t)):void 0},up.compiler("[up-tooltip]",function(e){return e.on("mouseover",function(){return n(e)}),e.on("mouseout",function(){return t()})}),up.on("click","body",function(e,n){return t()}),up.bus.on("framework:reset",t),up.magic.onEscape(function(){return t()}),{open:n,close:t}}()}.call(this),function(){up.navigation=function(){var t,e,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return m=up.util,u=m.config({currentClasses:["up-current"]}),c=function(){return u.reset()},i=function(){var t;return t=u.currentClasses,t=t.concat(["up-current"]),t=m.uniq(t),t.join(" ")},t="up-active",e=["a","[up-href]","[up-alias]"],r=e.join(", "),o=function(){var t,n,r;for(r=[],t=0,n=e.length;n>t;t++)d=e[t],r.push(d+"[up-instant]");return r}().join(", "),n="."+t,l=function(t){return m.isPresent(t)?m.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},f=function(t){var e,n,r,o,u,i,a,s,c,p;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],c=m.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=l(a),s.push(a));return s},v=function(t){var e,n,r,o;return t=m.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return m.contains(t,e)},n=function(e){return m.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return m.detect(t,r)},{matchesAny:o}},s=function(){var t,e;return t=v([l(up.browser.url()),l(up.modal.source()),l(up.popup.source())]),e=i(),m.each($(r),function(n){var r,o;return r=$(n),o=f(r),t.matchesAny(o)?r.addClass(e):r.removeClass(e)})},p=function(e){return h(),e=a(e),e.addClass(t)},a=function(t){return m.presence(t.parents(r))||t},h=function(){return $(n).removeClass(t)},up.on("click",r,function(t,e){return m.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?p(e):void 0}),up.on("mousedown",o,function(t,e){return m.isUnmodifiedMouseEvent(t)?p(e):void 0}),up.bus.on("fragment:ready",function(){return h(),s()}),up.bus.on("fragment:destroy",function(t){return t.is(".up-modal, .up-popup")?s():void 0}),up.bus.on("framework:reset",c),{defaults:u.update}}()}.call(this),function(){up.slot=function(){var t,e,n;return n=up.util,e=function(t){return""!==n.trim(t.html())},t=function(t){return n.findWithSelf(t,"[up-slot]").each(function(){var t;return t=$(this),e(t)?void 0:t.hide()})},up.bus.on("fragment:ready",t)}()}.call(this),function(){up.browser.isSupported()&&(up.bus.emit("framework:ready"),$(document).on("ready",function(){return up.bus.emit("app:ready")}))}.call(this),function(){}.call(this);
1
+ (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,P,E,D,j,$,z,U,O,M,F,W,L,I,Q,N,R,H,q,B,J,G,X,_,K,V,Z,Y,tt,et,nt,rt,ot,ut,it,at,st,lt,pt,ct,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,xt,St,Ct,At,Tt,Pt,Et,Dt,jt,$t,zt,Ut,Ot,Mt;return ut=function(e){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],r?n:(r=!0,n=e.apply(null,o))}},u=function(t){return t=m(t),t.selector&&(t.headers={"X-Up-Selector":t.selector}),e.ajax(t)},K=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ct=function(t,n){var r,o,u;return r=null,V(t)?(r=e("<a>").attr({href:t}).get(0),F(r.hostname)&&(r.href=r.href)):r=zt(t),o=r.protocol+"//"+r.hostname,K(r.protocol,r.port)||(o+=":"+r.port),u=r.pathname,"/"!==u[0]&&(u="/"+u),(null!=n?n.stripTrailingSlash:void 0)===!0&&(u=u.replace(/\/$/,"")),o+=u,(null!=n?n.hash:void 0)===!0&&(o+=r.hash),(null!=n?n.search:void 0)!==!1&&(o+=r.search),o},pt=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,c=f=0,m=v.length;m>f;c=++f){for(a=v[c],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],p=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===c&&(o=n),r=n}return o},v=function(t,e){var n;return n=document.createElement(t),X(e)&&(n.innerHTML=e),n},w=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["debug",n].concat(t.call(e)))},Mt=function(){var e,n,r;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n="[UP] "+n,(r=up.browser).puts.apply(r,["warn",n].concat(t.call(e)))},A=function(){var n,r,o,u;throw r=1<=arguments.length?t.call(arguments,0):[],r[0]="[UP] "+r[0],(u=up.browser).puts.apply(u,["error"].concat(t.call(r))),o=P.apply(null,r),n=yt(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,P=function(){var e,n,r,u;return e=1<=arguments.length?t.call(arguments,0):[],u=e[0],n=0,r=80,u.replace(o,function(){var t,o;return n+=1,t=e[n],o=typeof t,"string"===o?(t=t.replace(/\s+/g," "),t.length>r&&(t=t.substr(0,r)+"\u2026"),t='"'+t+'"'):t="undefined"===o?"undefined":"number"===o||"function"===o?t.toString():JSON.stringify(t),t.length>r&&(t=t.substr(0,r)+" \u2026",("object"===o||"function"===o)&&(t+=" }")),t})},y=function(t){var e,n,r,o,u,i,a;for(w("Creating selector from element %o",t),n=(e=t.attr("class"))?e.split(" "):[],r=t.attr("id"),a=t.prop("tagName").toLowerCase(),r&&(a+="#"+r),o=0,i=n.length;i>o;o++)u=n[o],a+="."+u;return a},g=function(t){var e,n,r,o,u,i,a,s,l,p,c,f;return l=function(t){return"<"+t+"(?: [^>]*)?>"},i=function(t){return"</"+t+">"},e="(?:.|\\n)*?",u=function(t){return"("+t+")"},f=new RegExp(l("head")+e+l("title")+u(e)+i("title")+e+i("body"),"i"),o=new RegExp(l("body")+u(e)+i("body"),"i"),(r=t.match(o))?(s=document.createElement("html"),n=v("body",r[1]),s.appendChild(n),(c=t.match(f))&&(a=v("head"),s.appendChild(a),p=v("title",c[1]),a.appendChild(p)),s):v("div",t)},E=e.extend,$t=e.trim,x=function(t,e){var n,r,o,u,i;for(i=[],n=o=0,u=t.length;u>o;n=++o)r=t[n],i.push(e(r,n));return i},rt=x,U=function(t){return t},Dt=function(t,e){var n,r,o,u;for(u=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)u.push(e(n));return u},B=function(t){return null===t},Z=function(t){return void 0===t},L=function(t){return!Z(t)},q=function(t){return Z(t)||B(t)},N=function(t){return!q(t)},F=function(t){return q(t)||G(t)&&0===Object.keys(t).length||0===t.length},yt=function(t,e){return null==e&&(e=X),e(t)?t:null},X=function(t){return!F(t)},Q=function(t){return"function"==typeof t},V=function(t){return"string"==typeof t},J=function(t){return"number"==typeof t},R=function(t){return"object"==typeof t&&!!t},G=function(t){return R(t)||"function"==typeof t},I=function(t){return!(!t||1!==t.nodeType)},H=function(t){return t instanceof jQuery},_=function(t){return G(t)&&Q(t.then)},W=function(t){return _(t)&&Q(t.resolve)},O=function(t){return N(t)?t:void 0},M=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},jt=function(t){return Array.prototype.slice.call(t)},m=function(t){return M(t)?t.slice():E({},t)},zt=function(t){return H(t)?t.get(0):t},it=function(t,e){return E(m(t),e)},gt=function(t,e){var n,r,o,u;if(o=t?m(t):{},e)for(r in e)n=e[r],u=o[r],N(u)?G(n)&&G(u)&&(o[r]=gt(u,n)):o[r]=n;return o},vt=function(){var e,n,r,o,u,i;for(n=1<=arguments.length?t.call(arguments,0):[],u=void 0,r=0,o=n.length;o>r;r++)if(e=n[r],i=e,Q(i)&&(i=i()),N(i)){u=i;break}return u},k=function(t,e){var n,r,o,u;for(u=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=n;break}return u},i=function(t,e){var n;return n=k(t,e),L(n)},c=function(t){return At(t,N)},Ut=function(t){var e;return e={},At(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},At=function(t,e){var n;return n=[],x(t,function(t){return e(t)?n.push(t):void 0}),n},bt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,u;for(u=[],t=0,o=r.length;o>t;t++)n=r[t],u.push(e.attr(n));return u}(),k(o,X)},lt=function(t){return setTimeout(t,0)},et=function(t){return t[t.length-1]},p=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ct=ut(function(){var t,n,r;return t=e("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),t.appendTo(document.body),n=t.get(0),r=n.offsetWidth-n.clientWidth,t.remove(),r}),mt=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Et=function(t,e,n){var r,o;return o=t.css(Object.keys(e)),t.css(e),r=function(){return t.css(o)},n?(n(),r()):mt(r)},z=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),F(n)?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},b=function(t,n,o){var u,i,a,s,l,p;return u=e(t),up.browser.canCssAnimation()?(o=gt(o,{duration:300,delay:0,easing:"ease"}),i=e.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":o.duration+"ms","transition-delay":o.delay+"ms","transition-timing-function":o.easing},l=z(u),p=Et(u,s),u.css(n),i.then(l),i.then(p),u.data(r,i),i.then(function(){return u.removeData(r)}),a=setTimeout(function(){return i.resolve()},o.duration+o.delay),i.then(function(){return clearTimeout(a)}),i):(u.css(n),xt())},r="up-animation-promise",j=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},ot=function(t,n){var r,o,u,i,a,s;return n=gt(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=t.position():(r=e(n.relative),a=t.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=t.offset(),o={left:i.left,top:i.top},n.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),n.full&&(s=p(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},h=function(t,e){var n,r,o,u,i;for(u=t.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],n.specified?i.push(e.attr(n.name,n.value)):i.push(void 0);return i},D=function(t,e){return t.find(e).addBack(e)},T=function(t){return 27===t.keyCode},Pt=function(t,e){return 0===t.indexOf(e)},C=function(t,e){return t.indexOf(e)===t.length-e.length},d=function(t,e){return t.indexOf(e)>=0},l=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},nt=function(t){return t.getResponseHeader("X-Up-Location")},at=function(t){return t.getResponseHeader("X-Up-Method")},ht=function(){var e,n,r,o,u,i;for(i=arguments[0],o=2<=arguments.length?t.call(arguments,1):[],e={},n=0,u=o.length;u>n;n++)r=o[n],i.hasOwnProperty(r)&&(e[r]=i[r]);return e},Y=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},tt=function(t){var e;return e=Z(t.button)||0===t.button,e&&Y(t)},xt=function(){var t;return t=e.Deferred(),t.resolve(),t},St=function(){return xt().promise()},ft=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},kt=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return x(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},Tt=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],q(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},wt=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},S=function(){return e([])},st=function(t){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=t.length;u>o;o++)s=t[o],V(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(t){var n,r,o,u,i,s;for(r=S(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=t?t.find(s):e(s),r=r.add(n);return r},a.findWithSelf=function(t){var e;return e=a.find(t),a.doesMatch(t)&&(e=e.add(t)),e},a.doesMatch=function(t){var n;return n=e(t),i(a.parsed,function(t){return n.is(t)})},a.seekUp=function(t){var n,r,o;for(o=e(t),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||S()},a},s=function(e){var n,r,o,u,i,a,s,l,p,c,f,d;return null==e&&(e={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?t.call(arguments,0):[],e.log?(n[0]="["+e.log+"] "+n[0],w.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return q(e.size)?void 0:Q(e.size)?e.size():J(e.size)?e.size:A("Invalid size config: %o",e.size)},o=function(){return q(e.expiry)?void 0:Q(e.expiry)?e.expiry():J(e.expiry)?e.expiry:A("Invalid expiry config: %o",e.expiry)},p=function(t){return e.key?e.key(t):t.toString()},$t=function(){var t,e,n,r;return r=m(a()),n=l(),n&&r.length>n&&(t=null,e=null,x(r,function(n){var r,o;return r=f[n],o=r.timestamp,!e||e>o?(t=n,e=o):void 0}),t)?delete f[t]:void 0},n=function(t,e){var n;return n=u(t),L(n)?c(e,n):void 0},d=function(){return(new Date).valueOf()},c=function(t,e){var n;return n=p(t),f[n]={timestamp:d(),value:e}},wt=function(t){var e;return e=p(t),delete f[e]},i=function(t){var e,n;return e=o(),e?(n=d()-t.timestamp,n<o()):!0},u=function(t,e){var n,r;return null==e&&(e=void 0),r=p(t),(n=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),wt(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:c,remove:wt,clear:r,keys:a}},f=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return E(e,t)},e.reset(),Object.preventExtensions(e),e},Ot=function(t){var e,n;return t=zt(t),e=t.parentNode,n=jt(t.childNodes),x(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},dt=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},$=function(t,n){var r,o,u,i;return r=e(t),o=dt(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},a=function(t){var e,n,r;return e=t.toString(),r=new RegExp("\\(([^\\)]*)\\)"),(n=e.match(r))?n[1].split(/\s*,\s*/):A("Could not parse argument names of %o",t)},{argNames:a,offsetParent:dt,fixedToAbsolute:$,presentAttr:bt,createElement:v,normalizeUrl:ct,normalizeMethod:pt,createElementFromHtml:g,$createElementFromSelector:n,createSelectorFromElement:y,ajax:u,extend:E,copy:m,merge:it,options:gt,option:vt,error:A,debug:w,warn:Mt,each:x,map:rt,identity:U,times:Dt,any:i,detect:k,select:At,compact:c,uniq:Ut,last:et,isNull:B,isDefined:L,isUndefined:Z,isGiven:N,isMissing:q,isPresent:X,isBlank:F,presence:yt,isObject:G,isFunction:Q,isString:V,isElement:I,isJQuery:H,isPromise:_,isDeferred:W,isHash:R,ifGiven:O,isUnmodifiedKeyEvent:Y,isUnmodifiedMouseEvent:tt,nullJquery:ft,unJquery:zt,nextFrame:lt,measure:ot,temporaryCss:Et,cssAnimate:b,finishCssAnimate:j,forceCompositing:z,escapePressed:T,copyAttributes:h,findWithSelf:D,contains:d,startsWith:Pt,endsWith:C,isArray:M,toArray:jt,castedAttr:l,locationFromXhr:nt,methodFromXhr:at,clientSize:p,only:ht,trim:$t,resolvedPromise:St,resolvedDeferred:xt,resolvableWhen:kt,setMissingAttrs:Tt,remove:wt,memoize:ut,scrollbarWidth:Ct,config:f,cache:s,unwrapElement:Ot,multiSelector:st,emptyJQuery:S,evalConsoleTemplate:P}}($),up.error=up.util.error,up.warn=up.util.warn,up.debug=up.util.debug}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h;return m=up.util,c=function(t,n){var r,o,u,i,a,s;return null==n&&(n={}),a=m.option(n.method,"get").toLowerCase(),"get"===a?location.href=t:e.rails?(s=n.target,u=e.rails.csrfToken(),o=e.rails.csrfParam(),r=e("<form method='post' action='"+t+"'></form>"),i="<input name='_method' value='"+a+"' type='hidden' />",m.isDefined(o)&&m.isDefined(u)&&(i+="<input name='"+o+"' value='"+u+"' type='hidden' />"),s&&r.attr("target",s),r.hide().append(i).appendTo("body"),r.submit()):error("Can't fake a "+a.toUpperCase()+" request without Rails UJS")},d=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],m.isDefined(console[r])||(r="log"),o()?console[r].apply(console,e):(n=m.evalConsoleTemplate.apply(m,e),console[r](n))},h=function(){return location.href},u=m.memoize(function(){return m.isDefined(history.pushState)&&"get"===i()}),a=m.memoize(function(){return m.isUndefined(document.addEventListener)}),s=m.memoize(function(){return a()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),n=m.memoize(function(){return"transition"in document.documentElement.style}),r=m.memoize(function(){return"oninput"in document.createElement("input")}),o=m.memoize(function(){return!s()}),l=m.memoize(function(){var t,n,r,o;return o=e.fn.jquery,r=o.split("."),t=parseInt(r[0]),n=parseInt(r[1]),t>=2||1===t&&n>=9}),f=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,m.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},i=m.memoize(function(){return(f("_up_request_method")||"get").toLowerCase()}),p=function(){return!a()&&l()},{url:h,loadPage:c,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:p,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u;return u=up.util,n=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),u.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},r=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),!r.isDefaultPrevented()},o=function(){return up.bus.emit("up:framework:reset")},{emit:n,nobodyPrevents:r,reset:o}}(jQuery),up.reset=up.bus.reset}.call(this),function(){var t=[].slice;up.magic=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b;return y=up.util,n="up-destroyable",r="up-destroyer",m=[],p=null,b=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,s(r)])}},d=function(){var n,r,o,u,i;return n=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(o=y.copy(n),u=o.length-1,r=o[u],o[u]=b(r),m.push(o),(i=e(document)).on.apply(i,o)):void 0},a=[],l=null,i=function(){var e,n,r;return r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(i=e.pop(),n=y.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return y.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),y.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(y.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=y.findWithSelf(t,i.selector),n.length?i.batch?s.push(o(i,n,n.get())):s.push(n.each(function(){return o(i,e(this),this)})):s.push(void 0);return s},c=function(t){return y.findWithSelf(t,"."+n).each(function(){var t,n;return t=e(this),(n=t.data(r))()})},s=function(t){var n,r;return n=e(t),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){return p=y.copy(m),l=y.copy(a)},v=function(){var t,n,r,o;for(n=0,r=m.length;r>n;n++)t=m[n],y.contains(p,t)||(o=e(document)).off.apply(o,t);return m=y.copy(p),a=y.copy(l)},f=function(t){var n;return n=e(t),up.bus.emit("up:fragment:inserted",{$element:n}),n},h=function(t){return d("keydown","body",function(e){return y.escapePressed(e)?t(e):void 0})},d("ready",function(){return f(document.body)}),d("up:fragment:inserted",function(t){return u(t.$element)}),d("up:fragment:destroy",function(t){return c(t.$element)}),d("up:framework:boot",g),d("up:framework:reset",v),{compiler:i,on:d,hello:f,onEscape:h,data:s}}(jQuery),up.compiler=up.magic.compiler,up.on=up.magic.on,up.hello=up.magic.hello,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),p=void 0,i=void 0,m=function(){return n.reset(),p=void 0,i=void 0},a=function(t){return v.normalizeUrl(t,{hash:!0})},r=function(){return a(up.browser.url())},o=function(t){return a(t)===r()},s=function(t){return i&&(p=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},c=function(t,e){return u("push",t,e)},u=function(t,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=t+"State",a=e(),v.debug("Changing history to URL %o (%o)",n,t),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},e=function(){return{fromUp:!0}},h=function(t){var e,o;return o=r(),v.debug("Restoring state %o (now on "+o+")",t),e=n.popTargets.join(", "),up.replace(e,o,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})},l=function(t){var e;return v.debug("History state popped to URL %o",r()),s(r()),up.layout.saveScroll({url:p}),e=t.originalEvent.state,(null!=e?e.fromUp:void 0)?h(e):v.debug("Discarding unknown state %o",e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(t){return v.isPresent(p)?(v.setMissingAttrs(t,{"up-href":p,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:c,replace:d,url:r,previousUrl:function(){return p},normalizeUrl:a}}(jQuery)}.call(this),function(){var t=[].slice;up.layout=function(e){var n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b;return h=up.util,o=h.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),a=h.cache({size:30,key:up.history.normalizeUrl}),l=function(){return o.reset(),a.clear()},n="up-scroll-promise",d=function(t,r,i){var a,s,l,p,c;return a=e(t),i=h.options(i),l=h.option(i.duration,o.duration),p=h.option(i.easing,o.easing),u(a),l>0?(s=e.Deferred(),a.data(n,s),s.then(function(){return a.removeData(n),a.finish()}),c={scrollTop:r},a.get(0)===document&&(a=e("html, body")),a.animate(c,{duration:l,easing:p,complete:function(){return s.resolve()}}),s):(a.scrollTop(r),h.resolvedDeferred())},u=function(t){return e(t).each(function(){var t;return(t=e(this).data(n))?t.resolve():void 0})},r=function(){return h.multiSelector(o.anchoredRight).select()},s=function(){var n,r,u,i;return u=function(t,n){var r,o;return r=e(t),o=r.css(n),h.isPresent(o)||h.error("Fixed element %o must have a CSS attribute %o",r,n),parseInt(o)+r.height()},r=function(){var t,n,r,a;for(r=e(o.fixedTop.join(", ")),a=[],t=0,n=r.length;n>t;t++)i=r[t],a.push(u(i,"top"));return a}(),n=function(){var t,n,r,a;for(r=e(o.fixedBottom.join(", ")),a=[],t=0,n=r.length;n>t;t++)i=r[t],a.push(u(i,"bottom"));return a}(),{top:Math.max.apply(Math,[0].concat(t.call(r))),bottom:Math.max.apply(Math,[0].concat(t.call(n)))}},c=function(t,n){var r,u,i,a,l,p,c,f,m,g,y,b,w,k;return n=h.options(n),r=e(t),u=n.viewport?e(n.viewport):v(r),b=h.option(n.snap,o.snap),k=u.is(document),w=k?h.clientSize().height:u.height(),m=u.scrollTop(),p=m,f=void 0,c=void 0,k?(c=s(),f=0):(c={top:0,bottom:0},f=m),g=function(){return p+c.top},y=function(){return p+w-c.bottom-1},i=h.measure(r,{relative:u}),a=i.top+f,l=a+Math.min(i.height,o.substance)-1,l>y()&&(p+=l-y()),(a<g()||n.top)&&(p=a-c.top),b>p&&(p=0),p!==m?d(u,p,n):h.resolvedDeferred()},g=function(){return h.multiSelector(o.viewports)},v=function(t){var n,r;return n=e(t),r=g().seekUp(n),r.length||h.error("Could not find viewport for %o",n),r},b=function(t){var n;return n=e(t),g().findWithSelf(n)},y=function(){return g().select()},m=function(){var t,n,r,u,i,a,s;for(a={},i=o.viewports,n=0,u=i.length;u>n;n++)s=i[n],t=e(s),t.length&&(r=s,s===document&&(r="document"),a[r]=t.scrollTop());return a},i=function(t){var n,r;return null==t&&(t=void 0),t||(t=document.body),r=e(t),n=r.find("[up-fixed]"),h.isPresent(o.fixedTop)&&(n=n.add(r.find(o.fixedTop.join(", ")))),h.isPresent(o.fixedBottom)&&(n=n.add(r.find(o.fixedBottom.join(", ")))),n},f=function(t){var e,n;return null==t&&(t={}),n=h.option(t.url,up.history.url()),e=h.option(t.tops,m()),a.set(n,e)},p=function(t){var e,n,r,o,u,i,s,l,p;null==t&&(t={}),o=void 0,t.around?(n=b(t.around),e=v(t.around),o=e.add(n)):o=y(),p=a.get(up.history.url()),i=[];for(u in p)l=p[u],s="document"===u?document:u,r=o.filter(s),i.push(up.scroll(r,l,{duration:0}));return i},up.on("up:framework:reset",l),{reveal:c,scroll:d,finishScrolling:u,config:o,defaults:function(){return h.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:v,viewportsWithin:b,viewports:y,scrollTops:m,saveScroll:f,restoreScroll:p,anchoredRight:r,fixedChildren:i}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;return g=up.util,m=function(e,n){var r;return r=t(e),g.isPresent(n)&&(n=g.normalizeUrl(n)),r.attr("up-source",n)},h=function(e){var n;return n=t(e).closest("[up-source]"),g.presence(n.attr("up-source"))||up.browser.url()},f=function(e,n,r){var o,u,i;return g.debug("Replace %o with %o (options %o)",e,n,r),r=g.options(r),i=g.presence(e)?e:g.createSelectorFromElement(t(e)),up.browser.canPushState()||r.history===!1?(u={url:n,method:r.method,selector:i,cache:r.cache,preload:r.preload},o=up.proxy.ajax(u),o.done(function(t,e,o){var s,l;return(s=g.locationFromXhr(o))&&(g.debug("Location from server: %o",s),l={url:s,method:g.methodFromXhr(o),selector:i},up.proxy.alias(u,l),n=s),r.history!==!1&&(r.history=n),r.source!==!1&&(r.source=n),r.preload?void 0:a(i,t,r)}),o.fail(g.error),o):(r.preload||up.browser.loadPage(n,g.only(r,"method")),g.resolvedPromise())},a=function(t,e,n){var r,u,i,a,s,c,f,d;for(n=g.options(n,{historyMethod:"push"}),n.source=g.option(n.source,n.history),c=p(e),n.title||(n.title=c.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(t,n),f=[],i=0,a=s.length;a>i;i++)d=s[i],u=o(d.selector),r=c.find(d.selector).first(),f.push(v(u,r,d.pseudoClass,d.transition,n));return f},o=function(t){return u(".up-popup "+t)||u(".up-modal "+t)||u(t)||i(t)},i=function(t){var e;return e="Could not find selector %o in current body HTML","#"===e[0]&&(e+=" (avoid using IDs)"),g.error(e,t)},p=function(e){var n;return n=g.createElementFromHtml(e),{title:function(){var t;return null!=(t=n.querySelector("title"))?t.textContent:void 0},find:function(r){var o;return(o=n.querySelector(r))?t(o):g.error("Could not find selector %o in response %o",r,e)}}},d=function(t,e){return e.reveal?up.reveal(t):g.resolvedDeferred()},r=function(t,n){return"function"==typeof n.insert&&n.insert(t),n.history&&(n.title&&(document.title=n.title),up.history[n.historyMethod](n.history)),n.source!==!1&&m(t,n.source),n.restoreScroll&&up.layout.restoreScroll({around:t}),e(t),up.hello(t)},v=function(t,e,o,u,i){var a,s;return u||(u="none"),up.motion.finish(t),o?(s="before"===o?"prepend":"append",a=e.contents().wrap('<span class="up-insertion"></span>').parent(),t[s](a),g.copyAttributes(e,t),r(a.children(),i),d(a,i).then(function(){return up.animate(a,u,i)}).then(function(){g.unwrapElement(a)})):n(t,{animation:function(){return e.insertBefore(t),r(e,i),t.is("body")&&"none"!==u&&g.error("Cannot apply transitions to body-elements (%o)",u),up.morph(t,e,u,i)}})},l=function(t,e){var n,r,o,u,i,a,s,l,p,c,f;for(c=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),g.isPresent(c)&&(f=c.split(n)),a=[],o=u=0,i=r.length;i>u;o=++u)s=r[o],l=s.match(/^(.+?)(?:\:(before|after))?$/),p=f[o]||g.last(f),a.push({selector:l[1],pseudoClass:l[2],transition:p});return a},e=function(t){var e,n;return n="[autofocus]:last",e=g.findWithSelf(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},s=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},u=function(e){var n,r,o,u,i,a;for(u=t(e).get(),r=null,i=0,a=u.length;a>i;i++)if(o=u[i],n=t(o),s(n)){r=n;break}return r},n=function(e,n){var r,o,u;return r=t(e),up.bus.nobodyPrevents("up:fragment:destroy",{$element:r})?(n=g.options(n,{animation:"none"}),o=up.motion.animateOptions(n),r.addClass("up-destroying"),g.isPresent(n.url)&&up.history.push(n.url),g.isPresent(n.title)&&(document.title=n.title),u=g.presence(n.animation,g.isDeferred)||up.motion.animate(r,n.animation,o),u.then(function(){return up.bus.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},c=function(t,e){var n;return e=g.options(e,{cache:!1}),n=e.url||h(t),f(t,n,e)},up.on("ready",function(){return m(document.body,up.browser.url())}),{replace:f,reload:c,destroy:n,implant:a,first:u}}(jQuery),up.replace=up.flow.replace,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first}.call(this),function(){up.motion=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x;return k=up.util,u={},s={},w={},l={},a=k.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=k.copy(s),w=k.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),c(a),u=r(u),("none"===o||o===!1)&&m(),k.isFunction(o)?i(o(a,u),o):k.isString(o)?n(a,p(o),u):k.isHash(o)?k.cssAnimate(a,o,u):k.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=k.options(t),n={},n.easing=k.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(k.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(k.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},p=function(t){return u[t]||k.error("Unknown animation %o",t)},e="up-ghosting-promise",x=function(t,n,r,o){var u,i,a,s,l,p,c;return s=void 0,i=void 0,l=void 0,a=void 0,u=up.layout.viewportOf(t),k.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),k.temporaryCss(t,{display:"none"},function(){return r.reveal&&up.reveal(n,{viewport:u}),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),c=k.temporaryCss(n,{visibility:"hidden"}),p=o(s.$ghost,i.$ghost),t.data(e,p),n.data(e,p),p.then(function(){return t.removeData(e),n.removeData(e),s.$bounds.remove(),i.$bounds.remove(),c()}),p},c=function(e){return t(e).each(function(){var e;return e=t(this),k.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(k.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return k.isDeferred(t)?t:k.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,p,f,m,h,v;return p=t(e),l=t(o),up.browser.canCssAnimation()?(m=k.only(s,"reveal"),m=k.extend(m,r(s)),c(p),c(l),"none"===a||a===!1||(f=u[a])?(p.hide(),s.reveal&&up.reveal(l),n(l,f||"none",s)):(v=k.presence(a,k.isFunction)||w[a])?x(p,l,m,function(t,e){var n;return n=v(t,e,m),i(n,a)}):k.isString(a)&&a.indexOf("/")>=0?(h=a.split("/"),v=function(t,e,r){return g(n(t,h[0],r),n(e,h[1],r))},d(p,l,v,m)):k.error("Unknown transition %o",a)):(p.hide(),k.resolvedDeferred())},h=function(e,n){var r,o,u,i,a,s,l,p,c;for(i=k.measure(e,{relative:!0,inner:!0}),u=e.clone(),u.find("script").remove(),u.css({position:"static"===e.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),c=i.top,p=function(t){return 0!==t?(c+=t,r.css({top:c})):void 0},u.appendTo(r),r.insertBefore(e),p(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],k.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:p}},b=function(t,e){return w[t]=e},o=function(t,e){return u[t]=e},y=function(){return s=k.copy(u),l=k.copy(w)},g=k.resolvableWhen,m=k.resolvedDeferred,o("none",m),o("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),o("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),o("move-to-top",function(t,e){var r,o;return r=k.measure(t),o=r.top+r.height,t.css({"margin-top":"0px"}),n(t,{"margin-top":"-"+o+"px"},e)}),o("move-from-top",function(t,e){var r,o;return r=k.measure(t),o=r.top+r.height,t.css({"margin-top":"-"+o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-bottom",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().height-r.top,t.css({"margin-top":"0px"}),n(t,{"margin-top":o+"px"},e)}),o("move-from-bottom",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().height-r.top,t.css({"margin-top":o+"px"}),n(t,{"margin-top":"0px"},e)}),o("move-to-left",function(t,e){var r,o;return r=k.measure(t),o=r.left+r.width,t.css({"margin-left":"0px"}),n(t,{"margin-left":"-"+o+"px"},e)}),o("move-from-left",function(t,e){var r,o;return r=k.measure(t),o=r.left+r.width,t.css({"margin-left":"-"+o+"px"}),n(t,{"margin-left":"0px"},e)}),o("move-to-right",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().width-r.left,t.css({"margin-left":"0px"}),n(t,{"margin-left":o+"px"},e)}),o("move-from-right",function(t,e){var r,o;return r=k.measure(t),o=k.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)}),o("roll-down",function(t,e){var r,o;return r=t.height(),o=k.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),b("none",m),b("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),b("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),b("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),b("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),b("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",y),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:c,transition:b,animation:o,config:a,defaults:function(){return k.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:m,when:g,prependCopy:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){up.proxy=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y,b,w,k,x,S,C,A,T,P,E,D;return D=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=D.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5}),l=function(t){return k(t),[t.url,t.method,t.data,t.selector].join("|")},s=D.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=s.get,P=s.set,A=s.remove,d=s.clear,c=function(){return clearTimeout(C),C=null},p=function(){return clearTimeout(i),i=null},T=function(){return e=null,c(),p(),x=0,m.reset(),a=!1,s.clear()},T(),o=s.alias,k=function(t){return t._normalized||(t.method=D.normalizeMethod(t.method),t.url&&(t.url=D.normalizeUrl(t.url)),t.selector||(t.selector="body"),t._normalized=!0),t},r=function(t){var e,n,r,o,u;return e=t.cache===!0,n=t.cache===!1,u=D.only(t,"url","method","data","selector","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),P(u,o),o.fail(function(){return A(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){
2
+ return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.bus.emit("up:proxy:busy"),a=!0):void 0},m.busyDelay>0?i=setTimeout(t,m.busyDelay):t()):void 0},b=function(){return x-=1,v()&&a?(up.bus.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return D.debug("Loading URL %o",t.url),up.bus.emit("up:proxy:load",t),e=D.ajax(t),e.always(function(){return up.bus.emit("up:proxy:receive",t)}),e},g=function(t){return k(t),D.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(D.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,c(),n=function(){return S(t),e=null},E(n,r))},E=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=D.options(n),o=up.link.followMethod(r,n),g({method:o})?(D.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(D.debug("Won't preload %o due to unsafe method %o",r,o),D.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(t,e){return up.link.childClicked(t,e)?void 0:f(e)}),up.on("up:framework:reset",T),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:A,idle:v,busy:u,config:m,defaults:function(){return D.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery)}.call(this),function(){up.link=function($){var childClicked,follow,followMethod,makeFollowable,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target"),"body"),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),u.castedAttr(n,"up-animation")),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){return e=u.options(e),u.option(e.method,t.attr("up-method"),t.attr("data-method"),"get").toUpperCase()},up.on("click","a[up-target], [up-href][up-target]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.on("mousedown","a[up-instant], [up-href][up-instant]",function(t,e){return shouldProcessLinkEvent(t,e)?(t.preventDefault(),follow(e)):void 0}),childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},shouldProcessLinkEvent=function(t,e){return u.isUnmodifiedMouseEvent(t)&&!childClicked(t,e)},makeFollowable=function(t){var e;return e=$(t),u.isMissing(e.attr("up-target"))&&u.isMissing(e.attr("up-follow"))?e.attr("up-follow",""):void 0},up.on("click","a[up-follow], [up-href][up-follow]",function(t,e){return shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?t.preventDefault():(t.preventDefault(),follow(e)):void 0}),up.compiler("[up-expand]",function(t){var e,n,r,o,i,a,s,l;for(o=t.find("a, [up-href]").get(0),o||u.error("No link to expand within %o",t),l=/^up-/,a={},a["up-href"]=$(o).attr("href"),s=o.attributes,n=0,r=s.length;r>n;n++)e=s[n],i=e.name,i.match(l)&&(a[i]=e.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}),up.compiler("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),e={"up-preload":"true","up-instant":"true"},n===!0?e["up-follow"]="":e["up-target"]=n,u.setMissingAttrs(t,e),t.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,childClicked:childClicked,followMethod:followMethod}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){up.form=function($){var observe,submit,u;return u=up.util,submit=function(t,e){var n,r,o,i,a,s,l,p,c,f,d,m;return n=$(t).closest("form"),e=u.options(e),p=u.option(e.target,n.attr("up-target"),"body"),r=u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),i=u.option(e.history,u.castedAttr(n,"up-history"),!0),c=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),c),a=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),s={},s.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),s.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),s.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),s=u.extend(s,up.motion.animateOptions(e,n)),m=u.option(e.cache,u.castedAttr(n,"up-cache")),d=u.option(e.url,n.attr("action"),up.browser.url()),n.addClass("up-active"),up.browser.canPushState()||i===!1?(l={url:d,method:a,data:n.serialize(),selector:p,cache:m},f=function(t){var e;return d=void 0,u.isGiven(i)&&(i===!1||u.isString(i)?d=i:(e=u.locationFromXhr(t))?d=e:"GET"===l.type&&(d=l.url+"?"+l.data)),u.option(d,!1)},up.proxy.ajax(l).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(s,{history:f(n),transition:c}),up.flow.implant(p,t,r)}).fail(function(t,e,n){var i,a;return a=t.responseText,i=u.merge(s,{transition:o}),up.flow.implant(r,a,i)})):void n.get(0).submit()},observe=function(fieldOrSelector,options){var $field,callback,callbackPromise,callbackTimer,changeEvents,check,clearTimer,codeOnChange,delay,knownValue,nextCallback,runNextCallback;return $field=$(fieldOrSelector),options=u.options(options),delay=u.option($field.attr("up-delay"),options.delay,0),delay=parseInt(delay),knownValue=null,callback=null,callbackTimer=null,(codeOnChange=$field.attr("up-observe"))?callback=function(value,$field){return eval(codeOnChange)}:options.change?callback=options.change:u.error("up.observe: No change callback given"),callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var t;return nextCallback?(t=nextCallback(),nextCallback=null,t):void 0},check=function(){var t,e;return e=$field.val(),t=u.isNull(knownValue),knownValue===e||(knownValue=e,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($field.get(0),[e,$field])},callbackTimer=setTimeout(function(){return callbackPromise.then(function(){var t;return t=runNextCallback(),callbackPromise=u.isPromise(t)?t:u.resolvedPromise()})},delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$field.on(changeEvents,check),check(),clearTimer},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),{submit:submit,observe:observe}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h;return m=up.util,a=void 0,o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),c=function(){return r(),o.reset()},f=function(t,e,n){var r,o;return o=m.measure(t,{full:!0}),r=function(){switch(n){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.bottom+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return m.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r),l(e)},l=function(t){var e,n,r,o,u,i,a;if(n=m.measure(t,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((u=parseInt(t.css("left")))?t.css("left",u-r):(i=parseInt(t.css("right")))&&t.css("right",i+r)),o){if(a=parseInt(t.css("top")))return t.css("top",a-o);if(e=parseInt(t.css("bottom")))return t.css("bottom",e+o)}},p=function(){var e;return e=t(".up-popup"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},s=function(){var e;return e=t(".up-popup"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},i=function(t,e,n){var r,o;return o=m.$createElementFromSelector(".up-popup"),n&&o.attr("up-sticky",""),r=m.$createElementFromSelector(e),r.appendTo(o),o.appendTo(document.body),p(),o.hide(),o},h=function(t,e,n,r,o){return e.show(),f(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,a,s,l,p,c,f,d,v;return u=t(e),n=m.options(n),v=m.option(n.url,u.attr("href")),f=m.option(n.target,u.attr("up-popup"),"body"),c=m.option(n.position,u.attr("up-position"),o.position),l=m.option(n.animation,u.attr("up-animation"),o.openAnimation),d=m.option(n.sticky,m.castedAttr(u,"up-sticky")),p=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),a=i(u,f,d),up.replace(f,v,{history:p,insert:function(){return h(u,a,c,l,s)}})},d=function(){return a},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),a=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(s(),r())},u=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.on("click","a[up-popup]",function(t,n){return t.preventDefault(),n.is(".up-current")?r():e(n)}),up.on("click","body",function(e,n){var o;return o=t(e.target),o.closest(".up-popup").length||o.closest("[up-popup]").length?void 0:r()}),up.on("up:fragment:inserted",function(t,e){var r;return u(e)?(r=e.attr("up-source"))?a=r:void 0:n()}),up.magic.onEscape(function(){return r()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-popup").length?(r(),t.preventDefault()):void 0}),up.on("up:framework:reset",c),{attach:e,close:r,source:d,config:o,defaults:function(){return m.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:u,open:function(){return up.warn("up.popup.open no longer exists. Please use up.popup.attach instead.")}}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g,y;return h=up.util,r=h.config({maxWidth:void 0,minWidth:void 0,width:void 0,height:void 0,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(t){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+t.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),i=void 0,c=function(){return n(),i=void 0,r.reset()},m=function(){var t;return t=r.template,h.isFunction(t)?t(r):t},p=function(){var e;return e=t(".up-modal"),e.attr("up-previous-url",up.browser.url()),e.attr("up-previous-title",document.title)},a=function(){var e;return e=t(".up-modal"),e.removeAttr("up-previous-url"),e.removeAttr("up-previous-title")},u=function(e){var n,r,o,u;return o=t(m()),e.sticky&&o.attr("up-sticky",""),o.attr("up-previous-url",up.browser.url()),o.attr("up-previous-title",document.title),r=o.find(".up-modal-dialog"),h.isPresent(e.width)&&r.css("width",e.width),h.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),h.isPresent(e.height)&&r.css("height",e.height),n=o.find(".up-modal-content"),u=h.$createElementFromSelector(e.selector),u.appendTo(n),o.appendTo(document.body),p(),o.hide(),o},v=[],f=function(){var e,n,r,o;return r=h.scrollbarWidth(),e=parseInt(t("body").css("padding-right")),n=r+e,o=h.temporaryCss(t("body"),{"padding-right":n+"px","overflow-y":"hidden"}),v.push(o),up.layout.anchoredRight().each(function(){var e,n,o,u;return e=t(this),n=parseInt(e.css("right")),o=r+n,u=h.temporaryCss(e,{right:o}),v.push(u)})},g=function(t,e,n){var r;return f(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.bus.emit("up:modal:opened")})},s=function(t,e){return e=h.options(e),e.$link=t,l(e)},y=function(t,e){return e=h.options(e),e.url=t,l(e)},l=function(e){var o,i,a,s,l,p,c,f,d,m,v;return e=h.options(e),o=h.option(e.$link,h.nullJquery()),m=h.option(e.url,o.attr("up-href"),o.attr("href")),f=h.option(e.target,o.attr("up-modal"),"body"),v=h.option(e.width,o.attr("up-width"),r.width),c=h.option(e.maxWidth,o.attr("up-max-width"),r.maxWidth),l=h.option(e.height,o.attr("up-height"),r.height),s=h.option(e.animation,o.attr("up-animation"),r.openAnimation),d=h.option(e.sticky,h.castedAttr(o,"up-sticky")),p=up.browser.canPushState()?h.option(e.history,h.castedAttr(o,"up-history"),!0):!1,a=up.motion.animateOptions(e,o),n(),up.bus.nobodyPrevents("up:modal:open",{url:m})?(i=u({selector:f,width:v,maxWidth:c,height:l,sticky:d}),up.replace(f,m,{history:p,insert:function(){return g(i,s,a)}})):t.Deferred()},d=function(){return i},n=function(e){var n,o;return n=t(".up-modal"),n.length?up.bus.nobodyPrevents("up:modal:close",{$element:n})?(e=h.options(e,{animation:r.closeAnimation,url:n.attr("up-previous-url"),title:n.attr("up-previous-title")}),i=void 0,o=up.destroy(n,e),o.then(function(){for(var t;t=v.pop();)t();return up.bus.emit("up:modal:closed")}),o):t.Deferred():h.resolvedDeferred()},e=function(){return t(".up-modal").is("[up-sticky]")?void 0:(a(),n())},o=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},up.on("click","a[up-modal]",function(t,e){return t.preventDefault(),e.is(".up-current")?n():l(e)}),up.on("click","body",function(e,r){var o;return o=t(e.target),o.closest(".up-modal-dialog").length||o.closest("[up-modal]").length?void 0:n()}),up.on("up:fragment:inserted",function(t,n){var r;if(o(n)){if(r=n.attr("up-source"))return i=r}else if(!up.popup.contains(n))return e()}),up.magic.onEscape(function(){return n()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(n(),t.preventDefault()):void 0}),up.on("up:framework:reset",c),{visit:y,follow:s,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:n,source:d,config:r,defaults:function(){return h.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:o}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u;return u=up.util,o=function(t,e,n){var r,o,i;return o=u.measure(t),i=u.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-i.width),top:o.top-i.height};case"bottom":return{left:o.left+.5*(o.width-i.width),top:o.top+o.height};default:return u.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},r=function(t){var e;return e=u.$createElementFromSelector(".up-tooltip"),u.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,i){var a,s,l,p,c,f,d;return null==i&&(i={}),a=t(e),c=u.option(i.html,a.attr("up-tooltip-html")),d=u.option(i.text,a.attr("up-tooltip"),a.attr("title")),f=u.option(i.position,a.attr("up-position"),"top"),p=u.option(i.animation,u.castedAttr(a,"up-animation"),"fade-in"),l=up.motion.animateOptions(i,a),n(),s=r({text:d,html:c}),o(a,s,f),up.animate(s,p,l)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=u.options(e,{animation:"fade-out"}),e=u.merge(e,up.motion.animateOptions(e)),up.destroy(n,e)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseover",function(){return open(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(t,e){return n()}),up.on("up:framework:reset",n),up.magic.onEscape(function(){return n()}),{attach:e,close:n,open:function(){return u.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(t){var e,n,r,o,u,i,a,s,l,p,c,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),c=function(){return i.reset()},a=function(){var t;return t=i.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},e="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var t,e,r;for(r=[],t=0,e=n.length;e>t;t++)m=n[t],r.push(m+"[up-instant]");return r}().join(", "),r="."+e,p=function(t){return h.isPresent(t)?h.normalizeUrl(t,{search:!1,stripTrailingSlash:!0}):void 0},d=function(t){var e,n,r,o,u,i,a,s,l,c;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(e=i[n],l=h.presentAttr(t,e))for(c="up-alias"===e?l.split(" "):[l],r=0,u=c.length;u>r;r++)a=c[r],"#"!==a&&(a=p(a),s.push(a));return s},g=function(t){var e,n,r,o;return t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},l=function(){var e,n;return e=g([p(up.browser.url()),p(up.modal.source()),p(up.popup.source())]),n=a(),h.each(t(o),function(r){var o,u;return o=t(r),u=d(o),e.matchesAny(u)?o.addClass(n):o.removeClass(n)})},f=function(t){return v(),t=s(t),t.addClass(e)},s=function(t){return h.presence(t.parents(o))||t},v=function(){return t(r).removeClass(e)},up.on("click",o,function(t,e){return h.isUnmodifiedMouseEvent(t)&&!e.is("[up-instant]")?f(e):void 0}),up.on("mousedown",u,function(t,e){return h.isUnmodifiedMouseEvent(t)?f(e):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroy",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",c),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.browser.isSupported()&&(up.bus.emit("up:framework:boot"),up.bus.emit("up:framework:booted"))}.call(this),function(){}.call(this);
@@ -1,3 +1,3 @@
1
1
  if up.browser.isSupported()
2
- up.bus.emit('framework:ready')
3
- $(document).on 'ready', -> up.bus.emit('app:ready')
2
+ up.bus.emit('up:framework:boot')
3
+ up.bus.emit('up:framework:booted')
@@ -8,7 +8,7 @@ we can't currently get rid off.
8
8
  @protected
9
9
  @class up.browser
10
10
  ###
11
- up.browser = (->
11
+ up.browser = (($) ->
12
12
 
13
13
  u = up.util
14
14
 
@@ -122,4 +122,4 @@ up.browser = (->
122
122
  isSupported: isSupported
123
123
  puts: puts
124
124
 
125
- )()
125
+ )(jQuery)
@@ -6,11 +6,11 @@ Up.js uses an internal event bus that you can use to hook into lifecycle events
6
6
 
7
7
  This internal event bus might eventually be rolled into regular events that we trigger on `document`.
8
8
 
9
- \#\#\# `fragment:ready` event
9
+ \#\#\# `fragment:inserted` event
10
10
 
11
11
  This event is triggered after Up.js has inserted an HTML fragment into the DOM through mechanisms like [`[up-target]`](/up.flow#up-target) or [`up.replace`](/up.flow#up.replace):
12
12
 
13
- up.bus.on('fragment:ready', function($fragment) {
13
+ up.on('up:fragment:inserted', function($fragment) {
14
14
  console.log("Looks like we have a new %o!", $fragment);
15
15
  });
16
16
 
@@ -18,12 +18,12 @@ The event is triggered *before* Up has compiled the fragment with your [custom b
18
18
  Upon receiving the event, Up.js will start compilation.
19
19
 
20
20
 
21
- \#\#\# `fragment:destroy` event
21
+ \#\#\# `fragment:destroyed` event
22
22
 
23
23
  This event is triggered when Up.js is destroying an HTML fragment, e.g. because it's being replaced
24
24
  with a new version or because someone explicitly called [`up.destroy`](/up.flow#up.destroy):
25
25
 
26
- up.bus.on('fragment:destroy', function($fragment) {
26
+ up.on('up:fragment:destroyed', function($fragment) {
27
27
  console.log("Looks like we lost %o!", $fragment);
28
28
  });
29
29
 
@@ -42,104 +42,55 @@ We need to work on this page:
42
42
 
43
43
  @class up.bus
44
44
  ###
45
- up.bus = (->
45
+ up.bus = (($) ->
46
46
 
47
47
  u = up.util
48
48
 
49
- callbacksByEvent = {}
50
- defaultCallbacksByEvent = {}
51
-
52
49
  ###*
53
- Resets the list of registered event listeners to the
54
- moment when the framework was booted.
55
-
56
- @private
57
- @method up.bus.reset
50
+ @method up.bus.emit
51
+ @param {String} eventName
52
+ The name of the event.
53
+ @param args...
54
+ The arguments that describe the event.
55
+ @protected
58
56
  ###
59
- reset = ->
60
- callbacksByEvent = u.copy(defaultCallbacksByEvent)
61
-
62
- callbacksFor = (event) ->
63
- callbacksByEvent[event] ||= []
57
+ emit = (eventName, eventProps = {}) ->
58
+ event = $.Event(eventName, eventProps)
59
+ $target = eventProps.$element || $(document)
60
+ u.debug("Emitting %o on %o with props %o", eventName, $target, eventProps)
61
+ $target.trigger(event)
62
+ event
64
63
 
65
64
  ###*
66
- Makes a snapshot of the currently registered bus listeners,
67
- to later be restored through [`up.bus.reset`](/up.bus#up.bus.reset)
68
-
69
- @private
70
- @method up.bus.snapshot
71
- ###
72
- snapshot = ->
73
- defaultCallbacksByEvent = {}
74
- for event, callbacks of callbacksByEvent
75
- defaultCallbacksByEvent[event] = u.copy(callbacks)
65
+ Emits an event with the given name and property.
66
+ Returns whether any event listener has prevented the default action.
76
67
 
77
- ###*
78
- Registers an event handler to be called when the given
79
- event is triggered.
80
-
81
- @method up.bus.on
82
- @param {String} eventNames
83
- A space-separated list of event names to match.
84
- @param {Function} handler
85
- The event handler to be called with the event arguments.
86
- @return {Function}
87
- A function that unregisters the given handlers
68
+ @method nobodyPrevents
69
+ @protected
88
70
  ###
89
- # We cannot call this function "on" because Coffeescript
90
- # https://makandracards.com/makandra/29733-english-words-that-you-cannot-use-in-coffeescript
91
- listen = (eventNames, handler) ->
92
- for eventName in eventNames.split(' ')
93
- callbacksFor(eventName).push(handler)
94
- -> stopListen(eventNames, handler)
71
+ nobodyPrevents = (args...) ->
72
+ event = emit(args...)
73
+ not event.isDefaultPrevented()
95
74
 
96
- ###*
97
- Unregisters the given handler from the given events.
98
-
99
- @method up.bus.off
100
- @param {String} eventNames
101
- A space-separated list of event names .
102
- @param {Function} handler
103
- The event handler that should stop listening.
104
- ###
105
- stopListen = (eventNames, handler) ->
106
- for eventName in eventNames.split(' ')
107
- u.remove(callbacksFor(eventName), handler)
108
75
 
109
76
  ###*
110
- Triggers an event over the framework bus.
77
+ Resets Up.js to the state when it was booted.
78
+ All custom event handlers, animations, etc. that have been registered
79
+ will be discarded.
111
80
 
112
- All arguments will be passed as arguments to event listeners:
81
+ This is an internal method for to enable unit testing.
82
+ Don't use this in production.
113
83
 
114
- up.bus.on('foo:bar', function(x, y) {
115
- console.log("Value of x is " + x);
116
- console.log("Value of y is " + y);
117
- });
84
+ @protected
85
+ @method up.reset
86
+ ###
87
+ reset = ->
88
+ up.bus.emit('up:framework:reset')
118
89
 
119
- up.bus.emit('foo:bar', 'arg1', 'arg2')
90
+ emit: emit
91
+ nobodyPrevents: nobodyPrevents
92
+ reset: reset
120
93
 
121
- // This prints to the console:
122
- //
123
- // Value of x is arg1
124
- // Value of y is arg2
94
+ )(jQuery)
125
95
 
126
- @method up.bus.emit
127
- @param {String} eventName
128
- The name of the event.
129
- @param args...
130
- The arguments that describe the event.
131
- ###
132
- emit = (eventName, args...) ->
133
- # u.debug("Emitting event %o with args %o", eventName, args)
134
- callbacks = callbacksFor(eventName)
135
- u.each(callbacks, (callback) ->
136
- callback(args...)
137
- )
138
-
139
- listen 'framework:ready', snapshot
140
- listen 'framework:reset', reset
141
-
142
- on: listen
143
- off: stopListen
144
- emit: emit
145
- )()
96
+ up.reset = up.bus.reset
@@ -15,7 +15,7 @@ We need to work on this page:
15
15
 
16
16
  @class up.flow
17
17
  ###
18
- up.flow = (->
18
+ up.flow = (($) ->
19
19
 
20
20
  u = up.util
21
21
 
@@ -187,7 +187,7 @@ up.flow = (->
187
187
  autofocus($new)
188
188
  # The fragment should be readiet before animating,
189
189
  # so transitions see .up-current classes
190
- up.ready($new)
190
+ up.hello($new)
191
191
 
192
192
  swapElements = ($old, $new, pseudoClass, transition, options) ->
193
193
  transition ||= 'none'
@@ -301,19 +301,27 @@ up.flow = (->
301
301
  ###
302
302
  destroy = (selectorOrElement, options) ->
303
303
  $element = $(selectorOrElement)
304
- options = u.options(options, animation: 'none')
305
- animateOptions = up.motion.animateOptions(options)
306
- $element.addClass('up-destroying')
307
- # If e.g. a modal or popup asks us to restore a URL, do this
308
- # before emitting `fragment:destroy`. This way up.navigate sees the
309
- # new URL and can assign/remove .up-current classes accordingly.
310
- up.history.push(options.url) if u.isPresent(options.url)
311
- document.title = options.title if u.isPresent(options.title)
312
- up.bus.emit('fragment:destroy', $element)
313
- animationDeferred = u.presence(options.animation, u.isDeferred) ||
314
- up.motion.animate($element, options.animation, animateOptions)
315
- animationDeferred.then -> $element.remove()
316
- animationDeferred
304
+ if up.bus.nobodyPrevents('up:fragment:destroy', $element: $element)
305
+ options = u.options(options, animation: 'none')
306
+ animateOptions = up.motion.animateOptions(options)
307
+ $element.addClass('up-destroying')
308
+ # If e.g. a modal or popup asks us to restore a URL, do this
309
+ # before emitting `fragment:destroy`. This way up.navigate sees the
310
+ # new URL and can assign/remove .up-current classes accordingly.
311
+ up.history.push(options.url) if u.isPresent(options.url)
312
+ document.title = options.title if u.isPresent(options.title)
313
+ animationDeferred = u.presence(options.animation, u.isDeferred) ||
314
+ up.motion.animate($element, options.animation, animateOptions)
315
+ animationDeferred.then ->
316
+ # Emit this while $element is still part of the DOM, so event
317
+ # listeners bound to the document will receive the event.
318
+ up.bus.emit('up:fragment:destroyed', $element: $element)
319
+ $element.remove()
320
+ animationDeferred
321
+ else
322
+ # Although someone prevented the destruction, keep a uniform API for
323
+ # callers by returning a Deferred that will never be resolved.
324
+ $.Deferred()
317
325
 
318
326
  ###*
319
327
  Replaces the given selector or element with a fresh copy
@@ -332,21 +340,7 @@ up.flow = (->
332
340
  sourceUrl = options.url || source(selectorOrElement)
333
341
  replace(selectorOrElement, sourceUrl, options)
334
342
 
335
- ###*
336
- Resets Up.js to the state when it was booted.
337
- All custom event handlers, animations, etc. that have been registered
338
- will be discarded.
339
-
340
- This is an internal method for to enable unit testing.
341
- Don't use this in production.
342
-
343
- @protected
344
- @method up.reset
345
- ###
346
- reset = ->
347
- up.bus.emit('framework:reset')
348
-
349
- up.bus.on('app:ready', ->
343
+ up.on('ready', ->
350
344
  setSource(document.body, up.browser.url())
351
345
  )
352
346
 
@@ -354,13 +348,11 @@ up.flow = (->
354
348
  reload: reload
355
349
  destroy: destroy
356
350
  implant: implant
357
- reset: reset
358
351
  first: first
359
352
 
360
- )()
353
+ )(jQuery)
361
354
 
362
355
  up.replace = up.flow.replace
363
356
  up.reload = up.flow.reload
364
357
  up.destroy = up.flow.destroy
365
- up.reset = up.flow.reset
366
358
  up.first = up.flow.first
@@ -21,7 +21,7 @@ We need to work on this page:
21
21
 
22
22
  @class up.form
23
23
  ###
24
- up.form = (->
24
+ up.form = (($) ->
25
25
 
26
26
  u = up.util
27
27
 
@@ -345,7 +345,7 @@ up.form = (->
345
345
  submit: submit
346
346
  observe: observe
347
347
 
348
- )()
348
+ )(jQuery)
349
349
 
350
350
  up.submit = up.form.submit
351
351
  up.observe = up.form.observe
@@ -12,16 +12,16 @@ We need to work on this page:
12
12
 
13
13
  @class up.history
14
14
  ###
15
- up.history = (->
15
+ up.history = (($) ->
16
16
 
17
17
  u = up.util
18
18
 
19
19
  ###*
20
- @method up.history.defaults
21
- @param {Array<String>} [options.popTargets=['body']]
20
+ @method up.history.config
21
+ @param {Array<String>} [config.popTargets=['body']]
22
22
  An array of CSS selectors to replace when the user goes
23
23
  back in history.
24
- @param {Boolean} [options.restoreScroll=true]
24
+ @param {Boolean} [config.restoreScroll=true]
25
25
  Whether to restore the known scroll positions
26
26
  when the user goes back or forward in history.
27
27
  ###
@@ -170,13 +170,14 @@ up.history = (->
170
170
  $link.removeAttr 'up-back'
171
171
  up.link.makeFollowable($link)
172
172
 
173
- up.bus.on 'framework:reset', reset
173
+ up.on 'up:framework:reset', reset
174
174
 
175
- defaults: config.update
175
+ config: config
176
+ defaults: -> u.error('up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.')
176
177
  push: push
177
178
  replace: replace
178
179
  url: currentUrl
179
180
  previousUrl: -> previousUrl
180
181
  normalizeUrl: normalizeUrl
181
182
 
182
- )()
183
+ )(jQuery)