upjs-rails 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/dist/up.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(){window.up={}}).call(this),function(){var t=[].slice;up.util=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,$,E,P,A,O,U,D,j,M,R,z,F,L,W,H,I,_,K,Q,N,X,B,V,q,J,G,Y,Z,te,ee,ne,re,oe,ue,ie,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,xe,Se,Ce,Te,$e,Ee,Pe,Ae,Oe,Ue,De,je,Me,Re,ze,Fe;return oe=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=d(t),t.selector&&(t.headers||(t.headers={}),t.headers["X-Up-Selector"]=t.selector),e.ajax(t)},q=function(t,e){return(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ce=function(t,e){var n,r,o;return n=ge(t),r=n.protocol+"//"+n.hostname,q(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},ge=function(t){var n;return n=null,J(t)?(n=e("<a>").attr({href:t}).get(0),R(n.hostname)&&(n.href=n.href)):n=je(t),n},le=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,p=f=0,m=v.length;m>f;p=++f){for(a=v[p],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],c=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),c&&(l+=' id="'+c+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===p&&(o=n),r=n}return o},h=function(t,e){var n;return n=document.createElement(t),B(e)&&(n.innerHTML=e),n},b=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)))},Fe=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)))},C=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=$.apply(null,r),n=ye(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,$=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})},g=function(t){var n,r,o,u,i,a,s,l,c,p;if(n=e(t),c=void 0,b("Creating selector from element %o",n.get(0)),p=ye(n.attr("up-id")))c="[up-id='"+p+"']";else if(u=ye(n.attr("id")))c="#"+u;else if(l=ye(n.attr("name")))c="[name='"+l+"']";else if(r=ye(n.attr("class")))for(o=r.split(" "),c="",i=0,s=o.length;s>i;i++)a=o[i],c+="."+a;else c=n.prop("tagName").toLowerCase();return c},v=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=h("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=h("head"),s.appendChild(a),c=h("title",p[1]),a.appendChild(c)),s):h("div",t)},E=e.extend,De=e.trim,k=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},ne=k,D=function(t){return t},Ae=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},Q=function(t){return null===t},G=function(t){return void 0===t},F=function(t){return!G(t)},K=function(t){return G(t)||Q(t)},H=function(t){return!K(t)},R=function(t){return K(t)||X(t)&&0===Object.keys(t).length||0===t.length},ye=function(t,e){return null==e&&(e=B),e(t)?t:null},B=function(t){return!R(t)},W=function(t){return"function"==typeof t},J=function(t){return"string"==typeof t},N=function(t){return"number"==typeof t},I=function(t){return"object"==typeof t&&!!t},X=function(t){return I(t)||"function"==typeof t},L=function(t){return!(!t||1!==t.nodeType)},_=function(t){return t instanceof jQuery},V=function(t){return X(t)&&W(t.then)},z=function(t){return V(t)&&W(t.resolve)},j=function(t){return H(t)?t:void 0},M=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Ue=function(t){return Array.prototype.slice.call(t)},d=function(t){return M(t)?t.slice():E({},t)},je=function(t){return _(t)?t.get(0):t},ue=function(t,e){return E(d(t),e)},ve=function(t,e){var n,r,o,u;if(o=t?d(t):{},e)for(r in e)n=e[r],u=o[r],H(u)?X(n)&&X(u)&&(o[r]=ve(u,n)):o[r]=n;return o},he=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,W(i)&&(i=i()),H(i)){u=i;break}return u},w=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=w(t,e),F(n)},c=function(t){return Te(t,H)},Me=function(t){var e;return e={},Te(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Te=function(t,e){var n;return n=[],k(t,function(t){return e(t)?n.push(t):void 0}),n},be=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}(),w(o,B)},se=function(t){return setTimeout(t,0)},te=function(t){return t[t.length-1]},l=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ce=oe(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}),de=function(t){var e;return e=void 0,function(){return null!=t&&(e=t()),t=void 0,e}},Pe=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()):de(r)},U=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),R(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},y=function(t,n,o){var u,i,a,s,l,c;return u=e(t),up.browser.canCssAnimation()?(o=ve(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=U(u),c=Pe(u,s),u.css(n),i.then(l),i.then(c),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),xe())},r="up-animation-promise",A=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},re=function(t,n){var r,o,u,i,a,s;return n=ve(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=l(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},m=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],i.push(n.specified?e.attr(n.name,n.value):void 0);return i},P=function(t,e){return t.find(e).addBack(e)},T=function(t){return 27===t.keyCode},Ee=function(t,e){return 0===t.indexOf(e)},S=function(t,e){return t.indexOf(e)===t.length-e.length},f=function(t,e){return t.indexOf(e)>=0},s=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},ee=function(t){return t.getResponseHeader("X-Up-Location")},Oe=function(t){return t.getResponseHeader("X-Up-Title")},ie=function(t){return t.getResponseHeader("X-Up-Method")},me=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)},Z=function(t){var e;return e=G(t.button)||0===t.button,e&&Y(t)},xe=function(){var t;return t=e.Deferred(),t.resolve(),t},Se=function(){return xe().promise()},Re=function(){return e.Deferred().promise()},pe=function(){return{is:function(){return!1},attr:function(){},find:function(){return[]}}},ke=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return k(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},$e=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(K(t.attr(n))?t.attr(n,o):void 0);return r},we=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},x=function(){return e([])},ae=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],J(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=x(),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||x()},a},a=function(e){var n,r,o,u,i,a,s,l,c,p,f,m;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],b.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return K(e.size)?void 0:W(e.size)?e.size():N(e.size)?e.size:C("Invalid size config: %o",e.size)},o=function(){return K(e.expiry)?void 0:W(e.expiry)?e.expiry():N(e.expiry)?e.expiry:C("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},De=function(){var t,e,n,r;return r=d(a()),n=l(),n&&r.length>n&&(t=null,e=null,k(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),F(n)?p(e,n):void 0},m=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),f[n]={timestamp:m(),value:e}},we=function(t){var e;return e=c(t),delete f[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=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),we(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:we,clear:r,keys:a}},p=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return E(e,t)},e.reset(),Object.preventExtensions(e),e},ze=function(t){var e,n;return t=je(t),e=t.parentNode,n=Ue(t.childNodes),k(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},fe=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},O=function(t,n){var r,o,u,i;return r=e(t),o=fe(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:""})},{offsetParent:fe,fixedToAbsolute:O,presentAttr:be,createElement:h,parseUrl:ge,normalizeUrl:ce,normalizeMethod:le,createElementFromHtml:v,$createElementFromSelector:n,createSelectorFromElement:g,ajax:u,extend:E,copy:d,merge:ue,options:ve,option:he,error:C,debug:b,warn:Fe,each:k,map:ne,identity:D,times:Ae,any:i,detect:w,select:Te,compact:c,uniq:Me,last:te,isNull:Q,isDefined:F,isUndefined:G,isGiven:H,isMissing:K,isPresent:B,isBlank:R,presence:ye,isObject:X,isFunction:W,isString:J,isElement:L,isJQuery:_,isPromise:V,isDeferred:z,isHash:I,ifGiven:j,isUnmodifiedKeyEvent:Y,isUnmodifiedMouseEvent:Z,nullJquery:pe,unJquery:je,nextFrame:se,measure:re,temporaryCss:Pe,cssAnimate:y,finishCssAnimate:A,forceCompositing:U,escapePressed:T,copyAttributes:m,findWithSelf:P,contains:f,startsWith:Ee,endsWith:S,isArray:M,toArray:Ue,castedAttr:s,locationFromXhr:ee,titleFromXhr:Oe,methodFromXhr:ie,clientSize:l,only:me,trim:De,unresolvablePromise:Re,resolvedPromise:Se,resolvedDeferred:xe,resolvableWhen:ke,setMissingAttrs:$e,remove:we,memoize:oe,scrollbarWidth:Ce,config:p,cache:a,unwrapElement:ze,multiSelector:ae,emptyJQuery:x,evalConsoleTemplate:$}}($),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,c,p,f,d,m,h;return m=up.util,p=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()}),c=function(){return!a()&&l()},{url:h,loadPage:p,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:c,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u,i,a,s,l,c,p,f,d;return f=up.util,a=[],r=null,d=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,up.syntax.data(r)])}},i=function(){var n,r,o,u,i;return r=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(u=f.copy(r),i=u.length-1,o=u[i],u[i]=d(o),a.push(u),n=e(document),n.on.apply(n,u),function(){return n.off.apply(n,u)}):function(){}},o=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),f.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},s=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=o.apply(null,e),!n.isDefaultPrevented()},l=function(t){return i("keydown","body",function(e){return f.escapePressed(e)?t(e):void 0})},p=function(){return r=f.copy(a)},c=function(){var t,n,o,u;for(n=0,o=a.length;o>n;n++)t=a[n],f.contains(r,t)||(u=e(document)).off.apply(u,t);return a=f.copy(r)},u=function(){return up.emit("up:framework:reset")},n=function(){return up.browser.isSupported()?up.emit("up:framework:boot"):void 0},i("up:framework:boot",p),i("up:framework:reset",c),{on:i,emit:o,nobodyPrevents:s,onEscape:l,emitReset:u,boot:n}}(jQuery),up.on=up.bus.on,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m;return m=up.util,n="up-destroyable",r="up-destroyer",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=m.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return m.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),m.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(m.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=m.findWithSelf(t,i.selector),s.push(n.length?i.batch?o(i,n,n.get()):n.each(function(){return o(i,e(this),this)}):void 0);return s},f=function(t){return m.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"),m.isString(r)&&""!==m.trim(r)?JSON.parse(r):{}},d=function(){return l=m.copy(a)},p=function(){return a=m.copy(l)},c=function(t){var n;return n=e(t),up.emit("up:fragment:inserted",{$element:n}),n},up.on("ready",function(){return c(document.body)}),up.on("up:fragment:inserted",function(t){return u(t.$element)}),up.on("up:fragment:destroy",function(t){return f(t.$element)}),up.on("up:framework:boot",d),up.on("up:framework:reset",p),{compiler:i,hello:c,data:s}}(jQuery),up.compiler=up.syntax.compiler,up.hello=up.syntax.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,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=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&&(c=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},p=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:c}),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(c)?(v.setMissingAttrs(t,{"up-href":c,"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:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.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"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(t,e,n){var r,o,i,a,s;return r=$(t),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:e},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(e),u.resolvedDeferred())},finishScrolling=function(t){return $(t).each(function(){var t;return(t=$(this).data(SCROLL_PROMISE_KEY))?t.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},e=function(){var t,e,o,u;for(o=$(config.fixedTop.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"top"));return u}(),t=function(){var t,e,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return u.debug("Revealing %o",t),e=u.options(e),n=$(t),r=e.viewport?$(e.viewport):viewportOf(n),m=u.option(e.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||e.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,e):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t){var e,n;return e=$(t),n=viewportSelector().seekUp(e),n.length||u.error("Could not find viewport for %o",e),n},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().findWithSelf(e)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var t,e,n,r,o,u,i;for(u={},o=config.viewports,e=0,r=o.length;r>e;e++)i=o[e],t=$(i),t.length&&(n=i,i===document&&(n="document"),u[n]=t.scrollTop());return u},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),u.debug("Saving scroll positions for URL %o: %o",n,e),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i,a,s,l,c;null==t&&(t={}),c=up.history.url(),o=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),o=e.add(n)):o=viewports(),l=lastScrollTops.get(c),u.debug("Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)",c,o,l);for(i in l)s=l[i],a="document"===i?document:i,r=o.filter(a),scroll(r,s,{duration:0});return u.resolvedDeferred()},revealOrRestoreScroll=function(t,e){var n,r,o,i;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(e.source&&(i=u.parseUrl(e.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(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,c,p,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()},d=function(t,e){var n,r,o;return g.isString(t)?(o=t,g.contains(o,"&")&&((n=g.presence(e.origin))?(r=g.createSelectorFromElement(n),o=o.replace(/\&/,r)):g.error("Found origin reference %o in selector %o, but options.origin is missing","&",o))):o=g.createSelectorFromElement(t),o},f=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=d(t,n),up.browser.canPushState()||n.history===!1?(o={url:e,method:n.method,selector:u,cache:n.cache,preload:n.preload,headers:n.headers},r=up.proxy.ajax(o),r.done(function(t,r,i){var s,l;return(s=g.locationFromXhr(i))&&(g.debug("Location from server: %o",s),l={url:s,method:g.methodFromXhr(i),selector:u},up.proxy.alias(o,l),e=s),n.history!==!1&&(n.history=e),n.source!==!1&&(n.source=e),n.title||(n.title=g.titleFromXhr(i)),n.preload?void 0:a(u,t,n)}),r.fail(g.error),r):(n.preload||up.browser.loadPage(e,g.only(n,"method")),g.unresolvablePromise())},a=function(t,e,n){var r,u,i,a,s,p,f,m,h;for(m=d(t,n),n=g.options(n,{historyMethod:"push"}),n.source=g.option(n.source,n.history),p=c(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(m,n),f=[],i=0,a=s.length;a>i;i++)h=s[i],u=o(h.selector),r=p.find(h.selector).first(),f.push(v(u,r,h.pseudoClass,h.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)},c=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=t.find(r,n)[0])?t(o):g.error("Could not find selector %o in response %o",r,e)}}},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),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),up.layout.revealOrRestoreScroll(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,c,p,f,d;for(f=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),g.isPresent(f)&&(d=f.split(n)),s=[],o=u=0,i=r.length;i>u;o=++u)l=r[o],c=l.match(/^(.+?)(?:\:(before|after))?$/),t=c[1],"html"===t&&(t="body"),a=c[2],p=d[o]||g.last(d),s.push({selector:t,pseudoClass:a,transition:p});return s},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=void 0,u=g.isString(e)?t(e).get():e,r=void 0,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.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},p=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:p,destroy:n,implant:a,first:u,resolveSelector:d}}(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,c,p,f,d,m,h,v,g,y,b,w,k,x,S;return x=up.util,u={},s={},k={},l={},a=x.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=x.copy(s),k=x.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),p(a),u=r(u),("none"===o||o===!1)&&m(),x.isFunction(o)?i(o(a,u),o):x.isString(o)?n(a,c(o),u):x.isHash(o)?x.cssAnimate(a,o,u):x.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=x.options(t),n={},n.easing=x.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(x.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(x.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},c=function(t){return u[t]||x.error("Unknown animation %o",t)},e="up-ghosting-promise",S=function(t,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(t),x.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),x.temporaryCss(t,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),p=x.temporaryCss(n,{opacity:"0"}),c=o(s.$ghost,i.$ghost),t.data(e,c),n.data(e,c),c.then(function(){return t.removeData(e),n.removeData(e),p(),s.$bounds.remove(),i.$bounds.remove()}),c},p=function(e){return t(e).each(function(){var e;return e=t(this),x.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(x.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return x.isDeferred(t)?t:x.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,c,f,m,h,v,b;return x.debug("Morphing %o to %o (using %o)",e,o,a),c=t(e),l=t(o),h=x.only(s,"reveal","restoreScroll","source"),h=x.extend(h,r(s)),up.browser.canCssAnimation()?(p(c),p(l),"none"===a||a===!1||(f=u[a])?(m=y(c,l,h),m.then(function(){return n(l,f||"none",s)}),m):(b=x.presence(a,x.isFunction)||k[a])?S(c,l,h,function(t,e){var n;return n=b(t,e,h),i(n,a)}):x.isString(a)&&a.indexOf("/")>=0?(v=a.split("/"),b=function(t,e,r){return g(n(t,v[0],r),n(e,v[1],r))},d(c,l,b,h)):x.error("Unknown transition %o",a)):y(c,l,h)},y=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},h=function(e,n){var r,o,u,i,a,s,l,c,p;for(i=x.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),p=i.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(e),c(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],x.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},w=function(t,e){return k[t]=e},o=function(t,e){return u[t]=e},b=function(){return s=x.copy(u),l=x.copy(k)},g=x.resolvableWhen,m=x.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=x.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=x.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=x.measure(t),o=x.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=x.measure(t),o=x.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=x.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=x.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=x.measure(t),o=x.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;
2
- return r=x.measure(t),o=x.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=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),w("none",m),w("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),w("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),w("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),w("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),w("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",b),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:p,transition:w,animation:o,config:a,defaults:function(){return x.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,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,$,E,P,A;return A=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=A.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=A.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=function(t){var e,n,r,o,u,i,a;for(t=k(t),n=[t],"html"!==t.selector&&(i=A.merge(t,{selector:"html"}),n.push(i),"body"!==t.selector&&(u=A.merge(t,{selector:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=s.get(e))return a},E=s.set,T=s.remove,d=s.clear,p=function(){return clearTimeout(C),C=null},c=function(){return clearTimeout(i),i=null},$=function(){return e=null,p(),c(),x=0,m.reset(),a=!1,s.clear()},$(),o=s.alias,k=function(t){return t._normalized||(t.method=A.normalizeMethod(t.method),t.url&&(t.url=A.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=A.only(t,"url","method","data","selector","headers","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),E(u,o),o.fail(function(){return T(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.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.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return A.debug("Loading URL %o",t.url),up.emit("up:proxy:load",t),e=A.ajax(t),e.always(function(){return up.emit("up:proxy:received",t)}),e},g=function(t){return k(t),A.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(A.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,p(),n=function(){return S(t),e=null},P(n,r))},P=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=A.options(n),o=up.link.followMethod(r,n),g({method:o})?(A.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(A.debug("Won't preload %o due to unsafe method %o",r,o),A.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",$),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:T,idle:v,busy:u,config:m,defaults:function(){return A.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.origin=u.option(e.origin,n),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.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 config,observe,reset,resolveValidateTarget,submit,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"]}),reset=function(){return config.reset()},submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(t).closest("form"),e=u.options(e),f=up.flow.resolveSelector(u.option(e.target,n.attr("up-target"),"body"),e),r=up.flow.resolveSelector(u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.createSelectorFromElement(n)}),e),s=u.option(e.history,u.castedAttr(n,"up-history"),!0),d=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),d),l=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),a=u.option(e.headers,{}),c={},c.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),c.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),c.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),c.origin=u.option(e.origin,n),c=u.extend(c,up.motion.animateOptions(e,n)),v=u.option(e.cache,u.castedAttr(n,"up-cache")),h=u.option(e.url,n.attr("action"),up.browser.url()),i=n.find("input[type=file]").length,e.validate&&(a["X-Up-Validate"]=e.validate,i)?u.unresolvablePromise():(n.addClass("up-active"),i||!up.browser.canPushState()&&s!==!1?(n.get(0).submit(),u.unresolvablePromise()):(p={url:h,method:l,data:n.serialize(),selector:f,cache:v,headers:a},m=function(t){var e;return h=void 0,u.isGiven(s)&&(s===!1||u.isString(s)?h=s:(e=u.locationFromXhr(t))?h=e:"GET"===p.type&&(h=p.url+"?"+p.data)),u.option(h,!1)},up.proxy.ajax(p).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(c,{history:m(n),transition:d}),up.flow.implant(f,t,r)}).fail(function(t){var e,n;return n=t.responseText,e=u.merge(c,{transition:o}),up.flow.implant(r,n,e)})))},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},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,e),t.closest(r).length}))),u.isBlank(n)&&error("Could not find default validation target for %o (tried ancestors %o)",t,config.validateTargets),u.isString(n)||(n=u.createSelectorFromElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.on("up:framework:reset",reset),{submit:submit,observe:observe,validate:validate}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.validate=up.form.validate}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,s=void 0,i=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url")},o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),f=function(){return r(),o.reset()},d=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),c(e)},c=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-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},l=function(){var e;return e=t(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},a=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(),d(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,i,s,l,c,p,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"),p=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")),c=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),i=a(u,f,d),up.replace(f,v,{history:c,insert:function(){return h(u,i,p,l,s)}})},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),s=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(l(),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){var n;return n=t(e.target),n.closest(".up-popup").length||n.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"))?s=r:void 0:n()}),up.bus.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",f),{attach:e,close:r,url:function(){return s},coveredUrl:i,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.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.modal=function($){var autoclose,close,config,contains,coveredUrl,createHiddenModal,currentUrl,discardHistory,follow,open,rememberHistory,reset,shiftElements,templateHtml,u,unshiftElements,updated,visit;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,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>'}}),currentUrl=void 0,coveredUrl=function(){var t;return t=$(".up-modal"),t.attr("up-covered-url")},reset=function(){return close(),currentUrl=void 0,config.reset()},templateHtml=function(){var t;return t=config.template,u.isFunction(t)?t(config):t},rememberHistory=function(){var t;return t=$(".up-modal"),t.attr("up-covered-url",up.browser.url()),t.attr("up-covered-title",document.title)},discardHistory=function(){var t;return t=$(".up-modal"),t.removeAttr("up-covered-url"),t.removeAttr("up-covered-title")},createHiddenModal=function(t){var e,n,r,o;return r=$(templateHtml()),t.sticky&&r.attr("up-sticky",""),r.attr("up-covered-url",up.browser.url()),r.attr("up-covered-title",document.title),n=r.find(".up-modal-dialog"),u.isPresent(t.width)&&n.css("width",t.width),u.isPresent(t.maxWidth)&&n.css("max-width",t.maxWidth),u.isPresent(t.height)&&n.css("height",t.height),e=r.find(".up-modal-content"),o=u.$createElementFromSelector(t.selector),o.appendTo(e),r.appendTo(document.body),rememberHistory(),r.hide(),r},unshiftElements=[],shiftElements=function(){var t,e,n,r;return n=u.scrollbarWidth(),t=parseInt($("body").css("padding-right")),e=n+t,r=u.temporaryCss($("body"),{"padding-right":e+"px","overflow-y":"hidden"}),unshiftElements.push(r),up.layout.anchoredRight().each(function(){var t,e,r,o;return t=$(this),e=parseInt(t.css("right")),r=n+e,o=u.temporaryCss(t,{right:r}),unshiftElements.push(o)})},updated=function(t,e,n){var r;return shiftElements(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.emit("up:modal:opened")})},follow=function(t,e){return e=u.options(e),e.$link=$(t),open(e)},visit=function(t,e){return e=u.options(e),e.url=t,open(e)},open=function(t){var e,n,r,o,i,a,s,l,c,p,f;return t=u.options(t),e=u.option(t.$link,u.nullJquery()),p=u.option(t.url,e.attr("up-href"),e.attr("href")),l=u.option(t.target,e.attr("up-modal"),"body"),f=u.option(t.width,e.attr("up-width"),config.width),s=u.option(t.maxWidth,e.attr("up-max-width"),config.maxWidth),i=u.option(t.height,e.attr("up-height"),config.height),o=u.option(t.animation,e.attr("up-animation"),config.openAnimation),c=u.option(t.sticky,u.castedAttr(e,"up-sticky")),a=up.browser.canPushState()?u.option(t.history,u.castedAttr(e,"up-history"),!0):!1,r=up.motion.animateOptions(t,e),close(),up.bus.nobodyPrevents("up:modal:open",{url:p})?(n=createHiddenModal({selector:l,width:f,maxWidth:s,height:i,sticky:c}),up.replace(l,p,{history:a,insert:function(){return updated(n,o,r)}})):$.Deferred()},close=function(t){var e,n;return e=$(".up-modal"),e.length?up.bus.nobodyPrevents("up:modal:close",{$element:e})?(t=u.options(t,{animation:config.closeAnimation,url:e.attr("up-covered-url"),title:e.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(e,t),n.then(function(){for(var t;t=unshiftElements.pop();)t();return up.emit("up:modal:closed")}),n):$.Deferred():u.resolvedDeferred()},autoclose=function(){return $(".up-modal").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=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")?close():follow(e)}),up.on("click","body",function(t){var e;return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:close()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return currentUrl=n}else if(!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(close(),t.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:contains,source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u,i,a;return a=up.util,r=a.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out"}),u=function(){return r.reset()},i=function(t,e,n){var r,o,u;return o=a.measure(t),u=a.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-u.width),top:o.top-u.height};case"bottom":return{left:o.left+.5*(o.width-u.width),top:o.top+o.height};default:return a.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},o=function(t){var e;return e=a.$createElementFromSelector(".up-tooltip"),a.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,u){var s,l,c,p,f,d,m;return null==u&&(u={}),s=t(e),f=a.option(u.html,s.attr("up-tooltip-html")),m=a.option(u.text,s.attr("up-tooltip")),d=a.option(u.position,s.attr("up-position"),r.position),p=a.option(u.animation,a.castedAttr(s,"up-animation"),r.openAnimation),c=up.motion.animateOptions(u,s),n(),l=o({text:m,html:f}),i(s,l,d),up.animate(l,p,c)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=a.options(e,{animation:r.closeAnimation}),e=a.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 e(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.bus.onEscape(function(){return n()}),up.on("up:framework:reset",u),{attach:e,close:n,open:function(){return a.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,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=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,c=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,p;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(p="up-alias"===e?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(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([c(up.browser.url()),c(up.modal.url()),c(up.modal.coveredUrl()),c(up.popup.url()),c(up.popup.coveredUrl())]),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.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},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:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{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.boot()}.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,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,$,E,P,A,O,U,D,j,M,R,z,F,L,W,H,I,_,Q,K,N,X,B,V,J,G,q,Y,Z,te,ee,ne,re,oe,ue,ie,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,xe,Se,Ce,Te,$e,Ee,Pe,Ae,Oe,Ue,De;return Z=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=d(t),t.selector&&(t.headers||(t.headers={}),t.headers["X-Up-Selector"]=t.selector),e.ajax(t)},K=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ue=function(t,e){var n,r,o;return n=fe(t),r=n.protocol+"//"+n.hostname,K(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},fe=function(t){var n;return n=null,N(t)?(n=e("<a>").attr({href:t}).get(0),O(n.hostname)&&(n.href=n.href)):n=Pe(t),n},oe=function(t){return t?t.toUpperCase():"GET"},n=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=t.split(/[ >]/),o=null,p=f=0,m=v.length;m>f;p=++f){for(a=v[p],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],c=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),c&&(l+=' id="'+c+'"'),l+=">",n=e(l),r&&n.appendTo(r),0===p&&(o=n),r=n}return o},h=function(t,e){var n;return n=document.createElement(t),_(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)))},De=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)))},k=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=S.apply(null,r),n=de(e(".up-error"))||e('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},o=/\%[odisf]/g,S=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})},ke=function(t){var n,r,o,u,i,a,s,l,c,p;if(n=e(t),c=void 0,y("Creating selector from element %o",n.get(0)),p=de(n.attr("up-id")))c="[up-id='"+p+"']";else if(u=de(n.attr("id")))c="#"+u;else if(l=de(n.attr("name")))c="[name='"+l+"']";else if(r=de(n.attr("class")))for(o=r.split(" "),c="",i=0,s=o.length;s>i;i++)a=o[i],c+="."+a;else c=n.prop("tagName").toLowerCase();return c},v=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=h("body",r[1]),s.appendChild(n),(p=t.match(f))&&(a=h("head"),s.appendChild(a),c=h("title",p[1]),a.appendChild(c)),s):h("div",t)},C=e.extend,Ee=e.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},q=w,Ce=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},W=function(t){return null===t},X=function(t){return void 0===t},D=function(t){return!X(t)},L=function(t){return X(t)||W(t)},R=function(t){return!L(t)},O=function(t){return L(t)||I(t)&&0===Object.keys(t).length||0===t.length},de=function(t,e){return null==e&&(e=_),e(t)?t:void 0},_=function(t){return!O(t)},M=function(t){return"function"==typeof t},N=function(t){return"string"==typeof t},H=function(t){return"number"==typeof t},z=function(t){return"object"==typeof t&&!!t},I=function(t){return z(t)||"function"==typeof t},j=function(t){return!(!t||1!==t.nodeType)},F=function(t){return t instanceof jQuery},Q=function(t){return I(t)&&M(t.then)},U=function(t){return Q(t)&&M(t.resolve)},A=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},$e=function(t){return Array.prototype.slice.call(t)},d=function(t){return A(t)?t.slice():C({},t)},Pe=function(t){return F(t)?t.get(0):t},te=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],C.apply(null,[{}].concat(t.call(e)))},pe=function(t,e){var n,r,o,u;if(o=t?d(t):{},e)for(r in e)n=e[r],u=o[r],R(u)?I(n)&&I(u)&&(o[r]=pe(u,n)):o[r]=n;return o},ce=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,M(i)&&(i=i()),R(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},i=function(t,e){var n,r,o,u;for(u=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){u=!0;break}return u},c=function(t){return we(t,R)},Ae=function(t){var e;return e={},we(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},we=function(t,e){var n;return n=[],w(t,function(t){return e(t)?n.push(t):void 0}),n},me=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,_)},re=function(t){return setTimeout(t,0)},J=function(t){return t[t.length-1]},l=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},be=Z(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}),se=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},Se=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()):se(r)},P=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),O(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},g=function(t,n,o){var u,i,a,s,l,c;return u=e(t),up.browser.canCssAnimation()?(o=pe(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=P(u),c=Se(u,s),u.css(n),i.then(l),i.then(c),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),ge())},r="up-animation-promise",$=function(t){return e(t).each(function(){var t;return(t=e(this).data(r))?t.resolve():void 0})},Y=function(t,n){var r,o,u,i,a,s;return n=pe(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=l(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},m=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],i.push(n.specified?e.attr(n.name,n.value):void 0);return i},T=function(t,e){return t.find(e).addBack(e)},x=function(t){return 27===t.keyCode},f=function(t,e){return t.indexOf(e)>=0},s=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},G=function(t){return t.getResponseHeader("X-Up-Location")},Te=function(t){return t.getResponseHeader("X-Up-Title")},ee=function(t){return t.getResponseHeader("X-Up-Method")},le=function(){var e,n,r,o,u,i;for(o=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=u.length;r>n;n++)i=u[n],o.hasOwnProperty(i)&&(e[i]=o[i]);return e},B=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},V=function(t){var e;return e=X(t.button)||0===t.button,e&&B(t)},ge=function(){var t;return t=e.Deferred(),t.resolve(),t},ye=function(){return ge().promise()},Oe=function(){return e.Deferred().promise()},ie=function(){return e()},ve=function(){var n,r;return n=1<=arguments.length?t.call(arguments,0):[],r=e.when.apply(e,n),r.resolve=function(){return w(n,function(t){return"function"==typeof t.resolve?t.resolve():void 0})},r},xe=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],r.push(L(t.attr(n))?t.attr(n,o):void 0);return r},he=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},ne=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],N(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=ie(),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||ie()},a},a=function(e){var n,r,o,u,i,a,s,l,c,p,f,m;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],y.apply(null,n)):void 0},a=function(){return Object.keys(f)},l=function(){return L(e.size)?void 0:M(e.size)?e.size():H(e.size)?e.size:k("Invalid size config: %o",e.size)},o=function(){return L(e.expiry)?void 0:M(e.expiry)?e.expiry():H(e.expiry)?e.expiry:k("Invalid expiry config: %o",e.expiry)},c=function(t){return e.key?e.key(t):t.toString()},Ee=function(){var t,e,n,r;return r=d(a()),n=l(),n&&r.length>n&&(t=null,e=null,w(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),D(n)?p(e,n):void 0},m=function(){return(new Date).valueOf()},p=function(t,e){var n;return n=c(t),f[n]={timestamp:m(),value:e}},he=function(t){var e;return e=c(t),delete f[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=f[r])?i(n)?(s("Cache hit for %o",t),n.value):(s("Discarding stale cache entry for %o",t),he(t),e):(s("Cache miss for %o",t),e)},{alias:n,get:u,set:p,remove:he,clear:r,keys:a}},p=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){return C(e,t)},e.reset(),Object.preventExtensions(e),e},Ue=function(t){var e,n;return t=Pe(t),e=t.parentNode,n=$e(t.childNodes),w(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},ae=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},E=function(t,n){var r,o,u,i;return r=e(t),o=ae(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:""})},{offsetParent:ae,fixedToAbsolute:E,presentAttr:me,createElement:h,parseUrl:fe,normalizeUrl:ue,normalizeMethod:oe,createElementFromHtml:v,$createElementFromSelector:n,selectorForElement:ke,ajax:u,extend:C,copy:d,merge:te,options:pe,option:ce,error:k,debug:y,warn:De,each:w,map:q,times:Ce,any:i,detect:b,select:we,compact:c,uniq:Ae,last:J,isNull:W,isDefined:D,isUndefined:X,isGiven:R,isMissing:L,isPresent:_,isBlank:O,presence:de,isObject:I,isFunction:M,isString:N,isElement:j,isJQuery:F,isPromise:Q,isDeferred:U,isHash:z,isUnmodifiedKeyEvent:B,isUnmodifiedMouseEvent:V,nullJQuery:ie,unJQuery:Pe,nextFrame:re,measure:Y,temporaryCss:Se,cssAnimate:g,finishCssAnimate:$,forceCompositing:P,escapePressed:x,copyAttributes:m,findWithSelf:T,contains:f,isArray:A,toArray:$e,castedAttr:s,locationFromXhr:G,titleFromXhr:Te,methodFromXhr:ee,clientSize:l,only:le,trim:Ee,unresolvablePromise:Oe,resolvedPromise:ye,resolvedDeferred:ge,resolvableWhen:ve,setMissingAttrs:xe,remove:he,memoize:Z,scrollbarWidth:be,config:p,cache:a,unwrapElement:Ue,multiSelector:ne,evalConsoleTemplate:S}}($),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,c,p,f,d,m,h;return m=up.util,p=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()}),c=function(){return!a()&&l()},{url:h,loadPage:p,canPushState:u,canCssAnimation:n,canInputEvent:r,canLogSubstitution:o,isSupported:c,puts:d}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,u,i,a,s,l,c,p,f,d;return f=up.util,a=[],r=null,d=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,up.syntax.data(r)])}},i=function(){var n,r,o,u,i;return r=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(u=f.copy(r),i=u.length-1,o=u[i],u[i]=d(o),a.push(u),n=e(document),n.on.apply(n,u),function(){return n.off.apply(n,u)}):function(){}},o=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$element||e(document),f.debug("Emitting %o on %o with props %o",t,r,n),r.trigger(o),o},s=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=o.apply(null,e),!n.isDefaultPrevented()},l=function(t){return i("keydown","body",function(e){return f.escapePressed(e)?t(e):void 0})},p=function(){return r=f.copy(a)},c=function(){var t,n,o,u;for(n=0,o=a.length;o>n;n++)t=a[n],f.contains(r,t)||(u=e(document)).off.apply(u,t);return a=f.copy(r)},u=function(){return up.emit("up:framework:reset")},n=function(){return up.browser.isSupported()?up.emit("up:framework:boot"):void 0},i("up:framework:boot",p),i("up:framework:reset",c),{on:i,emit:o,nobodyPrevents:s,onEscape:l,emitReset:u,boot:n}}(jQuery),up.on=up.bus.on,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m;return m=up.util,n="up-destroyable",r="up-destroyer",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=m.options(e[0],{batch:!1}),a.push({selector:r,callback:i,batch:n.batch})):void 0},o=function(t,e,o){var u;return m.debug("Applying compiler %o on %o",t.selector,o),u=t.callback.apply(o,[e,s(e)]),m.isFunction(u)?(e.addClass(n),e.data(r,u)):void 0},u=function(t){var n,r,u,s;for(m.debug("Compiling fragment %o",t),s=[],r=0,u=a.length;u>r;r++)i=a[r],n=m.findWithSelf(t,i.selector),s.push(n.length?i.batch?o(i,n,n.get()):n.each(function(){return o(i,e(this),this)}):void 0);return s},f=function(t){return m.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"),m.isString(r)&&""!==m.trim(r)?JSON.parse(r):{}},d=function(){return l=m.copy(a)},p=function(){return a=m.copy(l)},c=function(t){var n;return n=e(t),up.emit("up:fragment:inserted",{$element:n}),n},up.on("ready",function(){return c(document.body)}),up.on("up:fragment:inserted",function(t){return u(t.$element)}),up.on("up:fragment:destroy",function(t){return f(t.$element)}),up.on("up:framework:boot",d),up.on("up:framework:reset",p),{compiler:i,hello:c,data:s}}(jQuery),up.compiler=up.syntax.compiler,up.hello=up.syntax.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,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=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&&(c=i,i=void 0),i=t},d=function(t,e){return u("replace",t,e)},p=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:c}),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(c)?(v.setMissingAttrs(t,{"up-href":c,"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:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.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"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(t,e,n){var r,o,i,a,s;return r=$(t),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:e},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(e),u.resolvedDeferred())},finishScrolling=function(t){return $(t).each(function(){var t;return(t=$(this).data(SCROLL_PROMISE_KEY))?t.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %o",n,e),parseInt(r)+n.height()},e=function(){var t,e,o,u;for(o=$(config.fixedTop.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"top"));return u}(),t=function(){var t,e,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],t=0,e=o.length;e>t;t++)r=o[t],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return u.debug("Revealing %o",t),e=u.options(e),n=$(t),r=e.viewport?$(e.viewport):viewportOf(n),m=u.option(e.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||e.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,e):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t){var e,n;return e=$(t),n=viewportSelector().seekUp(e),n.length||u.error("Could not find viewport for %o",e),n},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().findWithSelf(e)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var t,e,n,r,o,u,i;for(u={},o=config.viewports,e=0,r=o.length;r>e;e++)i=o[e],t=$(i),t.length&&(n=i,i===document&&(n="document"),u[n]=t.scrollTop());return u},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),u.debug("Saving scroll positions for URL %o: %o",n,e),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i,a,s,l,c;null==t&&(t={}),c=up.history.url(),o=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),o=e.add(n)):o=viewports(),l=lastScrollTops.get(c),u.debug("Restoring scroll positions for URL %o (viewports are %o, saved tops are %o)",c,o,l);for(i in l)s=l[i],a="document"===i?document:i,r=o.filter(a),scroll(r,s,{duration:0});return u.resolvedDeferred()},revealOrRestoreScroll=function(t,e){var n,r,o,i;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(e.source&&(i=u.parseUrl(e.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(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,c,p,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()},d=function(t,e){var n,r,o;return g.isString(t)?(o=t,g.contains(o,"&")&&((n=g.presence(e.origin))?(r=g.selectorForElement(n),o=o.replace(/\&/,r)):g.error("Found origin reference %o in selector %o, but options.origin is missing","&",o))):o=g.selectorForElement(t),o},f=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=d(t,n),up.browser.canPushState()||n.history===!1?(o={url:e,method:n.method,selector:u,cache:n.cache,preload:n.preload,headers:n.headers},r=up.proxy.ajax(o),r.done(function(t,r,i){var s,l;return(s=g.locationFromXhr(i))&&(g.debug("Location from server: %o",s),l={url:s,method:g.methodFromXhr(i),selector:u},up.proxy.alias(o,l),e=s),n.history!==!1&&(n.history=e),n.source!==!1&&(n.source=e),n.title||(n.title=g.titleFromXhr(i)),n.preload?void 0:a(u,t,n)}),r.fail(g.error),r):(n.preload||up.browser.loadPage(e,g.only(n,"method")),g.unresolvablePromise())},a=function(t,e,n){var r,u,i,a,s,p,f,m,h;for(m=d(t,n),n=g.options(n,{historyMethod:"push"}),n.source=g.option(n.source,n.history),p=c(e),n.title||(n.title=p.title()),n.saveScroll!==!1&&up.layout.saveScroll(),s=l(m,n),f=[],i=0,a=s.length;a>i;i++)h=s[i],u=o(h.selector),r=p.find(h.selector).first(),f.push(v(u,r,h.pseudoClass,h.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)},c=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=t.find(r,n)[0])?t(o):g.error("Could not find selector %o in response %o",r,e)}}},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),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),up.layout.revealOrRestoreScroll(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,c,p,f,d;for(f=e.transition||e.animation||"none",n=/\ *,\ */,r=t.split(n),g.isPresent(f)&&(d=f.split(n)),s=[],o=u=0,i=r.length;i>u;o=++u)l=r[o],c=l.match(/^(.+?)(?:\:(before|after))?$/),t=c[1],"html"===t&&(t="body"),a=c[2],p=d[o]||g.last(d),s.push({selector:t,pseudoClass:a,transition:p});return s},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=void 0,u=g.isString(e)?t(e).get():e,r=void 0,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.emit("up:fragment:destroyed",{$element:r}),r.remove()}),u):t.Deferred()},p=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:p,destroy:n,implant:a,first:u,resolveSelector:d}}(jQuery),up.replace=up.flow.replace,up.implant=up.flow.implant,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,c,p,f,d,m,h,v,g,y,b,w,k,x,S;return x=up.util,u={},s={},k={},l={},a=x.config({duration:300,delay:0,easing:"ease"}),v=function(){return u=x.copy(s),k=x.copy(l),a.reset()},n=function(e,o,u){var a;return a=t(e),p(a),u=r(u),("none"===o||o===!1)&&m(),x.isFunction(o)?i(o(a,u),o):x.isString(o)?n(a,c(o),u):x.isHash(o)?x.cssAnimate(a,o,u):x.error("Unknown animation type %o",o)},r=function(t,e){var n;return null==e&&(e=null),t=x.options(t),n={},n.easing=x.option(t.easing,null!=e?e.attr("up-easing"):void 0,a.easing),n.duration=Number(x.option(t.duration,null!=e?e.attr("up-duration"):void 0,a.duration)),n.delay=Number(x.option(t.delay,null!=e?e.attr("up-delay"):void 0,a.delay)),n},c=function(t){return u[t]||x.error("Unknown animation %o",t)},e="up-ghosting-promise",S=function(t,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(t),x.temporaryCss(n,{display:"none"},function(){return s=h(t,u),s.$ghost.addClass("up-destroying"),s.$bounds.addClass("up-destroying"),l=u.scrollTop()}),x.temporaryCss(t,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),i=h(n,u),a=u.scrollTop()}),s.moveTop(a-l),t.hide(),p=x.temporaryCss(n,{opacity:"0"}),c=o(s.$ghost,i.$ghost),t.data(e,c),n.data(e,c),c.then(function(){return t.removeData(e),n.removeData(e),p(),s.$bounds.remove(),i.$bounds.remove()}),c},p=function(e){return t(e).each(function(){var e;return e=t(this),x.finishCssAnimate(e),f(e)})},f=function(t){var n;return(n=t.data(e))?(x.debug("Canceling existing ghosting on %o",t),"function"==typeof n.resolve?n.resolve():void 0):void 0},i=function(t,e){return x.isDeferred(t)?t:x.error("Did not return a promise with .then and .resolve methods: %o",e)},d=function(e,o,a,s){var l,c,f,m,h,v,b;return x.debug("Morphing %o to %o (using %o)",e,o,a),c=t(e),l=t(o),h=x.only(s,"reveal","restoreScroll","source"),h=x.extend(h,r(s)),up.browser.canCssAnimation()?(p(c),p(l),"none"===a||a===!1||(f=u[a])?(m=y(c,l,h),m.then(function(){return n(l,f||"none",s)}),m):(b=x.presence(a,x.isFunction)||k[a])?S(c,l,h,function(t,e){var n;return n=b(t,e,h),i(n,a)}):x.isString(a)&&a.indexOf("/")>=0?(v=a.split("/"),b=function(t,e,r){return g(n(t,v[0],r),n(e,v[1],r))},d(c,l,b,h)):x.error("Unknown transition %o",a)):y(c,l,h)},y=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},h=function(e,n){var r,o,u,i,a,s,l,c,p;for(i=x.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),p=i.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(e),c(e.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],x.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},w=function(t,e){return k[t]=e},o=function(t,e){return u[t]=e},b=function(){return s=x.copy(u),l=x.copy(k)},g=x.resolvableWhen,m=x.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=x.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=x.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=x.measure(t),o=x.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=x.measure(t),o=x.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=x.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=x.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=x.measure(t),o=x.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=x.measure(t),o=x.clientSize().width-r.left,t.css({"margin-left":o+"px"}),n(t,{"margin-left":"0px"},e)
2
+ }),o("roll-down",function(t,e){var r,o;return r=t.height(),o=x.temporaryCss(t,{height:"0px",overflow:"hidden"}),n(t,{height:r+"px"},e).then(o)}),w("none",m),w("move-left",function(t,e,r){return g(n(t,"move-to-left",r),n(e,"move-from-right",r))}),w("move-right",function(t,e,r){return g(n(t,"move-to-right",r),n(e,"move-from-left",r))}),w("move-up",function(t,e,r){return g(n(t,"move-to-top",r),n(e,"move-from-bottom",r))}),w("move-down",function(t,e,r){return g(n(t,"move-to-bottom",r),n(e,"move-from-top",r))}),w("cross-fade",function(t,e,r){return g(n(t,"fade-out",r),n(e,"fade-in",r))}),up.on("up:framework:boot",b),up.on("up:framework:reset",v),{morph:d,animate:n,animateOptions:r,finish:p,transition:w,animation:o,config:a,defaults:function(){return x.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,c,p,f,d,m,h,v,g,y,b,w,k,x,S,C,T,$,E,P,A;return A=up.util,e=void 0,C=void 0,i=void 0,x=void 0,a=void 0,m=A.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=A.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l,log:"up.proxy"}),h=function(t){var e,n,r,o,u,i,a;for(t=k(t),n=[t],"html"!==t.selector&&(i=A.merge(t,{selector:"html"}),n.push(i),"body"!==t.selector&&(u=A.merge(t,{selector:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=s.get(e))return a},E=s.set,T=s.remove,d=s.clear,p=function(){return clearTimeout(C),C=null},c=function(){return clearTimeout(i),i=null},$=function(){return e=null,p(),c(),x=0,m.reset(),a=!1,s.clear()},$(),o=s.alias,k=function(t){return t._normalized||(t.method=A.normalizeMethod(t.method),t.url&&(t.url=A.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=A.only(t,"url","method","data","selector","headers","_normalized"),r=!0,g(u)||e?(o=h(u))&&!n?r="pending"===o.state():(o=y(u),E(u,o),o.fail(function(){return T(u)})):(d(),o=y(u)),r&&!t.preload&&(w(),o.always(b)),o},n=["GET","OPTIONS","HEAD"],v=function(){return 0===x},u=function(){return x>0},w=function(){var t,e;return e=v(),x+=1,e?(t=function(){return u()?(up.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.emit("up:proxy:idle"),a=!1):void 0},y=function(t){var e;return A.debug("Loading URL %o",t.url),up.emit("up:proxy:load",t),e=A.ajax(t),e.always(function(){return up.emit("up:proxy:received",t)}),e},g=function(t){return k(t),A.contains(n,t.method)},f=function(t){var n,r;return r=parseInt(A.presentAttr(t,"up-delay"))||m.preloadDelay,t.is(e)?void 0:(e=t,p(),n=function(){return S(t),e=null},P(n,r))},P=function(t,e){return C=setTimeout(t,e)},S=function(e,n){var r,o;return r=t(e),n=A.options(n),o=up.link.followMethod(r,n),g({method:o})?(A.debug("Preloading %o",r),n.preload=!0,up.follow(r,n)):(A.debug("Won't preload %o due to unsafe method %o",r,o),A.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",$),{preload:S,ajax:r,get:h,alias:o,clear:d,remove:T,idle:v,busy:u,config:m,defaults:function(){return A.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.origin=u.option(e.origin,n),e=u.merge(e,up.motion.animateOptions(e,n)),up.replace(r,o,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.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 config,observe,reset,resolveValidateTarget,submit,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"]}),reset=function(){return config.reset()},submit=function(t,e){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(t).closest("form"),e=u.options(e),f=up.flow.resolveSelector(u.option(e.target,n.attr("up-target"),"body"),e),r=up.flow.resolveSelector(u.option(e.failTarget,n.attr("up-fail-target"),function(){return u.selectorForElement(n)}),e),s=u.option(e.history,u.castedAttr(n,"up-history"),!0),d=u.option(e.transition,u.castedAttr(n,"up-transition")),o=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),d),l=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),a=u.option(e.headers,{}),c={},c.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),c.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),c.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),c.origin=u.option(e.origin,n),c=u.extend(c,up.motion.animateOptions(e,n)),v=u.option(e.cache,u.castedAttr(n,"up-cache")),h=u.option(e.url,n.attr("action"),up.browser.url()),i=n.find("input[type=file]").length,e.validate&&(a["X-Up-Validate"]=e.validate,i)?u.unresolvablePromise():(n.addClass("up-active"),i||!up.browser.canPushState()&&s!==!1?(n.get(0).submit(),u.unresolvablePromise()):(p={url:h,method:l,data:n.serialize(),selector:f,cache:v,headers:a},m=function(t){var e;return h=void 0,u.isGiven(s)&&(s===!1||u.isString(s)?h=s:(e=u.locationFromXhr(t))?h=e:"GET"===p.type&&(h=p.url+"?"+p.data)),u.option(h,!1)},up.proxy.ajax(p).always(function(){return n.removeClass("up-active")}).done(function(t,e,n){var r;return r=u.merge(c,{history:m(n),transition:d}),up.flow.implant(f,t,r)}).fail(function(t){var e,n;return n=t.responseText,e=u.merge(c,{transition:o}),up.flow.implant(r,n,e)})))},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},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,e),t.closest(r).length}))),u.isBlank(n)&&error("Could not find default validation target for %o (tried ancestors %o)",t,config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},up.on("submit","form[up-target]",function(t,e){return t.preventDefault(),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.on("up:framework:reset",reset),{submit:submit,observe:observe,validate:validate}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.validate=up.form.validate}.call(this),function(){up.popup=function(t){var e,n,r,o,u,i,a,s,l,c,p,f,d,m,h;return m=up.util,s=void 0,i=function(){var e;return e=t(".up-popup"),e.attr("up-covered-url")},o=m.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right"}),f=function(){return r(),o.reset()},d=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),c(e)},c=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-covered-url",up.browser.url()),e.attr("up-covered-title",document.title)},l=function(){var e;return e=t(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},a=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(),d(t,e,n),up.animate(e,r,o)},e=function(e,n){var u,i,s,l,c,p,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"),p=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")),c=up.browser.canPushState()?m.option(n.history,m.castedAttr(u,"up-history"),!1):!1,s=up.motion.animateOptions(n,u),r(),i=a(u,f,d),up.replace(f,v,{history:c,insert:function(){return h(u,i,p,l,s)}})},r=function(e){var n;return n=t(".up-popup"),n.length?(e=m.options(e,{animation:o.closeAnimation,url:n.attr("up-covered-url"),title:n.attr("up-covered-title")}),s=void 0,up.destroy(n,e)):m.resolvedPromise()},n=function(){return t(".up-popup").is("[up-sticky]")?void 0:(l(),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){var n;return n=t(e.target),n.closest(".up-popup").length||n.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"))?s=r:void 0:n()}),up.bus.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",f),{attach:e,close:r,url:function(){return s},coveredUrl:i,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.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.modal=function($){var autoclose,close,config,contains,coveredUrl,createHiddenModal,currentUrl,discardHistory,follow,open,rememberHistory,reset,shiftElements,templateHtml,u,unshiftElements,updated,visit;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,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>'}}),currentUrl=void 0,coveredUrl=function(){var t;return t=$(".up-modal"),t.attr("up-covered-url")},reset=function(){return close(),currentUrl=void 0,config.reset()},templateHtml=function(){var t;return t=config.template,u.isFunction(t)?t(config):t},rememberHistory=function(){var t;return t=$(".up-modal"),t.attr("up-covered-url",up.browser.url()),t.attr("up-covered-title",document.title)},discardHistory=function(){var t;return t=$(".up-modal"),t.removeAttr("up-covered-url"),t.removeAttr("up-covered-title")},createHiddenModal=function(t){var e,n,r,o;return r=$(templateHtml()),t.sticky&&r.attr("up-sticky",""),r.attr("up-covered-url",up.browser.url()),r.attr("up-covered-title",document.title),n=r.find(".up-modal-dialog"),u.isPresent(t.width)&&n.css("width",t.width),u.isPresent(t.maxWidth)&&n.css("max-width",t.maxWidth),u.isPresent(t.height)&&n.css("height",t.height),e=r.find(".up-modal-content"),o=u.$createElementFromSelector(t.selector),o.appendTo(e),r.appendTo(document.body),rememberHistory(),r.hide(),r},unshiftElements=[],shiftElements=function(){var t,e,n,r;return n=u.scrollbarWidth(),t=parseInt($("body").css("padding-right")),e=n+t,r=u.temporaryCss($("body"),{"padding-right":e+"px","overflow-y":"hidden"}),unshiftElements.push(r),up.layout.anchoredRight().each(function(){var t,e,r,o;return t=$(this),e=parseInt(t.css("right")),r=n+e,o=u.temporaryCss(t,{right:r}),unshiftElements.push(o)})},updated=function(t,e,n){var r;return shiftElements(),t.show(),r=up.animate(t,e,n),r.then(function(){return up.emit("up:modal:opened")})},follow=function(t,e){return e=u.options(e),e.$link=$(t),open(e)},visit=function(t,e){return e=u.options(e),e.url=t,open(e)},open=function(t){var e,n,r,o,i,a,s,l,c,p,f;return t=u.options(t),e=u.option(t.$link,u.nullJQuery()),p=u.option(t.url,e.attr("up-href"),e.attr("href")),l=u.option(t.target,e.attr("up-modal"),"body"),f=u.option(t.width,e.attr("up-width"),config.width),s=u.option(t.maxWidth,e.attr("up-max-width"),config.maxWidth),i=u.option(t.height,e.attr("up-height"),config.height),o=u.option(t.animation,e.attr("up-animation"),config.openAnimation),c=u.option(t.sticky,u.castedAttr(e,"up-sticky")),a=up.browser.canPushState()?u.option(t.history,u.castedAttr(e,"up-history"),!0):!1,r=up.motion.animateOptions(t,e),close(),up.bus.nobodyPrevents("up:modal:open",{url:p})?(n=createHiddenModal({selector:l,width:f,maxWidth:s,height:i,sticky:c}),up.replace(l,p,{history:a,insert:function(){return updated(n,o,r)}})):$.Deferred()},close=function(t){var e,n;return e=$(".up-modal"),e.length?up.bus.nobodyPrevents("up:modal:close",{$element:e})?(t=u.options(t,{animation:config.closeAnimation,url:e.attr("up-covered-url"),title:e.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(e,t),n.then(function(){for(var t;t=unshiftElements.pop();)t();return up.emit("up:modal:closed")}),n):$.Deferred():u.resolvedDeferred()},autoclose=function(){return $(".up-modal").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=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")?close():follow(e)}),up.on("click","body",function(t){var e;return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:close()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return currentUrl=n}else if(!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(t,e){return e.closest(".up-modal").length?(close(),t.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:contains,source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")}}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,u,i,a;return a=up.util,r=a.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out"}),u=function(){return r.reset()},i=function(t,e,n){var r,o,u;return o=a.measure(t),u=a.measure(e),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-u.width),top:o.top-u.height};case"bottom":return{left:o.left+.5*(o.width-u.width),top:o.top+o.height};default:return a.error("Unknown position %o",n)}}(),e.attr("up-position",n),e.css(r)},o=function(t){var e;return e=a.$createElementFromSelector(".up-tooltip"),a.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),e},e=function(e,u){var s,l,c,p,f,d,m;return null==u&&(u={}),s=t(e),f=a.option(u.html,s.attr("up-tooltip-html")),m=a.option(u.text,s.attr("up-tooltip")),d=a.option(u.position,s.attr("up-position"),r.position),p=a.option(u.animation,a.castedAttr(s,"up-animation"),r.openAnimation),c=up.motion.animateOptions(u,s),n(),l=o({text:m,html:f}),i(s,l,d),up.animate(l,p,c)},n=function(e){var n;return n=t(".up-tooltip"),n.length?(e=a.options(e,{animation:r.closeAnimation}),e=a.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 e(t)}),t.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.bus.onEscape(function(){return n()}),up.on("up:framework:reset",u),{attach:e,close:n,open:function(){return a.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,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=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,c=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,p;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(p="up-alias"===e?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(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([c(up.browser.url()),c(up.modal.url()),c(up.modal.coveredUrl()),c(up.popup.url()),c(up.popup.coveredUrl())]),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.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},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:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{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.boot()}.call(this);
@@ -5,7 +5,6 @@ Browser interface
5
5
  Some browser-interfacing methods and switches that
6
6
  we can't currently get rid off.
7
7
 
8
- @protected
9
8
  @class up.browser
10
9
  ###
11
10
  up.browser = (($) ->
@@ -38,8 +37,13 @@ up.browser = (($) ->
38
37
  It also prints substitution strings (e.g. `console.log("From %o to %o", "a", "b")`)
39
38
  as a single string if the browser console does not support substitution strings.
40
39
 
40
+ \#\#\#\# Example
41
+
42
+ up.browser.puts('log', 'Hi world');
43
+ up.browser.puts('error', 'There was an error in %o', obj);
44
+
41
45
  @function up.browser.puts
42
- @protected
46
+ @internal
43
47
  ###
44
48
  puts = (stream, args...) ->
45
49
  u.isDefined(console[stream]) or stream = 'log'
@@ -119,6 +123,7 @@ up.browser = (($) ->
119
123
  This leaves you with a classic server-side application.
120
124
 
121
125
  @function up.browser.isSupported
126
+ @experimental
122
127
  ###
123
128
  isSupported = ->
124
129
  (!isIE8OrWorse()) && isRecentJQuery()
@@ -121,6 +121,7 @@ up.bus = (($) ->
121
121
  and passed as a second argument.
122
122
  @return {Function}
123
123
  A function that unbinds the event listeners when called.
124
+ @stable
124
125
  ###
125
126
  live = (args...) ->
126
127
  # Silently discard any event handlers that are registered on unsupported
@@ -165,7 +166,7 @@ up.bus = (($) ->
165
166
  or `stopPropagation()`.
166
167
  @param {jQuery} [eventProps.$element=$(document)]
167
168
  The element on which the event is trigered.
168
- @protected
169
+ @experimental
169
170
  ###
170
171
  emit = (eventName, eventProps = {}) ->
171
172
  event = $.Event(eventName, eventProps)
@@ -181,7 +182,7 @@ up.bus = (($) ->
181
182
  @function up.bus.nobodyPrevents
182
183
  @param {String} eventName
183
184
  @param {Object} eventProps
184
- @protected
185
+ @experimental
185
186
  ###
186
187
  nobodyPrevents = (args...) ->
187
188
  event = emit(args...)
@@ -196,7 +197,7 @@ up.bus = (($) ->
196
197
  The listener function to register.
197
198
  @return {Function}
198
199
  A function that unbinds the event listeners when called.
199
- @protected
200
+ @experimental
200
201
  ###
201
202
  onEscape = (listener) ->
202
203
  live('keydown', 'body', (event) ->
@@ -208,7 +209,7 @@ up.bus = (($) ->
208
209
  Makes a snapshot of the currently registered event listeners,
209
210
  to later be restored through [`up.bus.reset`](/up.bus.reset).
210
211
 
211
- @private
212
+ @internal
212
213
  ###
213
214
  snapshot = ->
214
215
  defaultLiveDescriptions = u.copy(liveDescriptions)
@@ -217,7 +218,7 @@ up.bus = (($) ->
217
218
  Resets the list of registered event listeners to the
218
219
  moment when the framework was booted.
219
220
 
220
- @private
221
+ @internal
221
222
  ###
222
223
  restoreSnapshot = ->
223
224
  for description in liveDescriptions
@@ -233,8 +234,8 @@ up.bus = (($) ->
233
234
  This is an internal method for to enable unit testing.
234
235
  Don't use this in production.
235
236
 
236
- @protected
237
237
  @function up.reset
238
+ @experimental
238
239
  ###
239
240
  emitReset = ->
240
241
  up.emit('up:framework:reset')
@@ -242,8 +243,8 @@ up.bus = (($) ->
242
243
  ###*
243
244
  This event is [emitted](/up.emit) when Up.js is [reset](/up.reset) during unit tests.
244
245
 
245
- @protected
246
246
  @event up:framework:reset
247
+ @experimental
247
248
  ###
248
249
 
249
250
  ###*
@@ -254,8 +255,8 @@ up.bus = (($) ->
254
255
 
255
256
  Emits the [`up:framework:boot`](/up:framework:boot) event.
256
257
 
257
- @protected
258
258
  @function up.boot
259
+ @experimental
259
260
  ###
260
261
  boot = ->
261
262
  if up.browser.isSupported()
@@ -265,7 +266,7 @@ up.bus = (($) ->
265
266
  This event is [emitted](/up.emit) when Up.js [boots](/up.boot).
266
267
 
267
268
  @event up:framework:boot
268
- @protected
269
+ @experimental
269
270
  ###
270
271
 
271
272
  live 'up:framework:boot', snapshot
@@ -25,19 +25,19 @@ up.flow = (($) ->
25
25
 
26
26
  ###*
27
27
  @function up.flow.resolveSelector
28
- @private
28
+ @internal
29
29
  ###
30
30
  resolveSelector = (selectorOrElement, options) ->
31
31
  if u.isString(selectorOrElement)
32
32
  selector = selectorOrElement
33
33
  if u.contains(selector, '&')
34
34
  if origin = u.presence(options.origin)
35
- originSelector = u.createSelectorFromElement(origin)
35
+ originSelector = u.selectorForElement(origin)
36
36
  selector = selector.replace(/\&/, originSelector)
37
37
  else
38
38
  u.error("Found origin reference %o in selector %o, but options.origin is missing", '&', selector)
39
39
  else
40
- selector = u.createSelectorFromElement(selectorOrElement)
40
+ selector = u.selectorForElement(selectorOrElement)
41
41
  selector
42
42
 
43
43
  ###*
@@ -145,6 +145,7 @@ up.flow = (($) ->
145
145
  with the request.
146
146
  @return {Promise}
147
147
  A promise that will be resolved when the page has been updated.
148
+ @stable
148
149
  ###
149
150
  replace = (selectorOrElement, url, options) ->
150
151
 
@@ -218,12 +219,12 @@ up.flow = (($) ->
218
219
  Note how only `.two` has changed. The update for `.one` was
219
220
  discarded, since it didn't match the selector.
220
221
 
221
- @function up.flow.implant
222
- @protected
222
+ @function up.implant
223
223
  @param {String|Element|jQuery} selectorOrElement
224
224
  @param {String} html
225
225
  @param {Object} [options]
226
226
  See options for [`up.replace`](/up.replace).
227
+ @experimental
227
228
  ###
228
229
  implant = (selectorOrElement, html, options) ->
229
230
  selector = resolveSelector(selectorOrElement, options)
@@ -370,12 +371,12 @@ up.flow = (($) ->
370
371
 
371
372
  Returns `undefined` if no element matches these conditions.
372
373
 
373
- @protected
374
374
  @function up.first
375
- @param {String|Element|jQuery} selectorOrElement
375
+ @param {String|Element|jQuery|Array<Element>} selectorOrElement
376
376
  @return {jQuery}
377
377
  The first element that is neither a ghost or being destroyed,
378
378
  or `undefined` if no such element was given.
379
+ @experimental
379
380
  ###
380
381
  first = (selectorOrElement) ->
381
382
  elements = undefined
@@ -416,6 +417,7 @@ up.flow = (($) ->
416
417
  The timing function that controls the animation's acceleration. [`up.animate`](/up.animate).
417
418
  @return {Deferred}
418
419
  A promise that will be resolved once the element has been removed from the DOM.
420
+ @stable
419
421
  ###
420
422
  destroy = (selectorOrElement, options) ->
421
423
  $element = $(selectorOrElement)
@@ -453,6 +455,7 @@ up.flow = (($) ->
453
455
  The page fragment that is about to be destroyed.
454
456
  @param event.preventDefault()
455
457
  Event listeners may call this method to prevent the fragment from being destroyed.
458
+ @stable
456
459
  ###
457
460
 
458
461
  ###*
@@ -465,6 +468,7 @@ up.flow = (($) ->
465
468
  @event up:fragment:destroyed
466
469
  @param {jQuery} event.$element
467
470
  The page fragment that is about to be removed from the DOM.
471
+ @stable
468
472
  ###
469
473
 
470
474
  ###*
@@ -486,6 +490,7 @@ up.flow = (($) ->
486
490
  @param {String} [options.url]
487
491
  The URL from which to reload the fragment.
488
492
  This defaults to the URL from which the fragment was originally loaded.
493
+ @stable
489
494
  ###
490
495
  reload = (selectorOrElement, options) ->
491
496
  options = u.options(options, cache: false)
@@ -506,6 +511,7 @@ up.flow = (($) ->
506
511
  )(jQuery)
507
512
 
508
513
  up.replace = up.flow.replace
514
+ up.implant = up.flow.implant
509
515
  up.reload = up.flow.reload
510
516
  up.destroy = up.flow.destroy
511
517
  up.first = up.flow.first
@@ -98,6 +98,7 @@ up.form = (($) ->
98
98
  with the request.
99
99
  @return {Promise}
100
100
  A promise for the successful form submission.
101
+ @stable
101
102
  ###
102
103
  submit = (formOrSelector, options) ->
103
104
 
@@ -105,7 +106,7 @@ up.form = (($) ->
105
106
 
106
107
  options = u.options(options)
107
108
  successSelector = up.flow.resolveSelector(u.option(options.target, $form.attr('up-target'), 'body'), options)
108
- failureSelector = up.flow.resolveSelector(u.option(options.failTarget, $form.attr('up-fail-target'), -> u.createSelectorFromElement($form)), options)
109
+ failureSelector = up.flow.resolveSelector(u.option(options.failTarget, $form.attr('up-fail-target'), -> u.selectorForElement($form)), options)
109
110
  historyOption = u.option(options.history, u.castedAttr($form, 'up-history'), true)
110
111
  successTransition = u.option(options.transition, u.castedAttr($form, 'up-transition'))
111
112
  failureTransition = u.option(options.failTransition, u.castedAttr($form, 'up-fail-transition'), successTransition)
@@ -218,6 +219,7 @@ up.form = (($) ->
218
219
  The number of miliseconds to wait before executing the callback
219
220
  after the input value changes. Use this to limit how often the callback
220
221
  will be invoked for a fast typist.
222
+ @stable
221
223
  ###
222
224
  observe = (fieldOrSelector, options) ->
223
225
 
@@ -305,7 +307,7 @@ up.form = (($) ->
305
307
  if u.isBlank(target)
306
308
  error('Could not find default validation target for %o (tried ancestors %o)', $field, config.validateTargets)
307
309
  unless u.isString(target)
308
- target = u.createSelectorFromElement(target)
310
+ target = u.selectorForElement(target)
309
311
  target
310
312
 
311
313
  ###*
@@ -330,6 +332,7 @@ up.form = (($) ->
330
332
  @return {Promise}
331
333
  A promise that is resolved when the server-side
332
334
  validation is received and the form was updated.
335
+ @stable
333
336
  ###
334
337
  validate = (fieldOrSelector, options) ->
335
338
  $field = $(fieldOrSelector)
@@ -442,6 +445,7 @@ up.form = (($) ->
442
445
  or make an educated guess (`undefined`).
443
446
 
444
447
  By default only responses to `GET` requests are cached for a few minutes.
448
+ @stable
445
449
  ###
446
450
  up.on 'submit', 'form[up-target]', (event, $form) ->
447
451
  event.preventDefault()
@@ -588,6 +592,7 @@ up.form = (($) ->
588
592
  The CSS selector to update with the server response.
589
593
 
590
594
  This defaults to a fieldset or form group around the validating field.
595
+ @stable
591
596
  ###
592
597
  up.on 'change', '[up-validate]', (event, $field) ->
593
598
  validate($field)
@@ -619,6 +624,7 @@ up.form = (($) ->
619
624
  @selector [up-observe]
620
625
  @param {String} up-observe
621
626
  The code to run when the field's value changes.
627
+ @stable
622
628
  ###
623
629
  up.compiler '[up-observe]', ($field) ->
624
630
  return observe($field)
@@ -37,7 +37,7 @@ up.history = (($) ->
37
37
  [`up.history.replace`](/up.history.replace).
38
38
 
39
39
  @function up.history.previousUrl
40
- @protected
40
+ @internal
41
41
  ###
42
42
  previousUrl = undefined
43
43
  nextPreviousUrl = undefined
@@ -54,8 +54,8 @@ up.history = (($) ->
54
54
  Returns a normalized URL for the current history entry.
55
55
 
56
56
  @function up.history.url
57
- @protected
58
- ####
57
+ @experimental
58
+ ###
59
59
  currentUrl = ->
60
60
  normalizeUrl(up.browser.url())
61
61
 
@@ -69,18 +69,40 @@ up.history = (($) ->
69
69
  nextPreviousUrl = url
70
70
 
71
71
  ###*
72
+ Replaces the current history entry and updates the
73
+ browser's location bar with the given URL.
74
+
75
+ When the user navigates to the replaced history entry at a later time,
76
+ Up.js will [`replace`](/up.replace) the document body with
77
+ the body from that URL.
78
+
79
+ Note that functions like [`up.replace`](/up.replace) or
80
+ [`up.submit`](/up.submit) will automatically update the
81
+ browser's location bar for you.
82
+
72
83
  @function up.history.replace
73
84
  @param {String} url
74
85
  @param {Boolean} [options.force=false]
75
- @protected
86
+ @experimental
76
87
  ###
77
88
  replace = (url, options) ->
78
89
  manipulate('replace', url, options)
79
90
 
80
91
  ###*
92
+ Adds a new history entry and updates the browser's
93
+ address bar with the given URL.
94
+
95
+ When the user navigates to the added history entry at a later time,
96
+ Up.js will [`replace`](/up.replace) the document body with
97
+ the body from that URL.
98
+
99
+ Note that functions like [`up.replace`](/up.replace) or
100
+ [`up.submit`](/up.submit) will automatically update the
101
+ browser's location bar for you.
102
+
81
103
  @function up.history.push
82
104
  @param {String} url
83
- @protected
105
+ @experimental
84
106
  ###
85
107
  push = (url, options) ->
86
108
  manipulate('push', url, options)
@@ -160,6 +182,7 @@ up.history = (($) ->
160
182
  </a>
161
183
 
162
184
  @selector [up-back]
185
+ @stable
163
186
  ###
164
187
  up.compiler '[up-back]', ($link) ->
165
188
  if u.isPresent(previousUrl)