unpoly-rails 0.56.7 → 0.57.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +74 -1
  3. data/dist/unpoly.js +1569 -793
  4. data/dist/unpoly.min.js +4 -4
  5. data/lib/assets/javascripts/unpoly.coffee +2 -0
  6. data/lib/assets/javascripts/unpoly/browser.coffee.erb +25 -41
  7. data/lib/assets/javascripts/unpoly/bus.coffee.erb +20 -6
  8. data/lib/assets/javascripts/unpoly/classes/cache.coffee +23 -13
  9. data/lib/assets/javascripts/unpoly/classes/compile_pass.coffee +87 -0
  10. data/lib/assets/javascripts/unpoly/classes/focus_tracker.coffee +29 -0
  11. data/lib/assets/javascripts/unpoly/classes/follow_variant.coffee +7 -4
  12. data/lib/assets/javascripts/unpoly/classes/record.coffee +1 -1
  13. data/lib/assets/javascripts/unpoly/classes/request.coffee +38 -45
  14. data/lib/assets/javascripts/unpoly/classes/response.coffee +16 -1
  15. data/lib/assets/javascripts/unpoly/classes/store/memory.coffee +26 -0
  16. data/lib/assets/javascripts/unpoly/classes/store/session.coffee +59 -0
  17. data/lib/assets/javascripts/unpoly/cookie.coffee +56 -0
  18. data/lib/assets/javascripts/unpoly/dom.coffee.erb +67 -39
  19. data/lib/assets/javascripts/unpoly/feedback.coffee +2 -2
  20. data/lib/assets/javascripts/unpoly/form.coffee.erb +23 -12
  21. data/lib/assets/javascripts/unpoly/history.coffee +2 -2
  22. data/lib/assets/javascripts/unpoly/layout.coffee.erb +118 -99
  23. data/lib/assets/javascripts/unpoly/link.coffee.erb +12 -5
  24. data/lib/assets/javascripts/unpoly/log.coffee +6 -5
  25. data/lib/assets/javascripts/unpoly/modal.coffee.erb +9 -2
  26. data/lib/assets/javascripts/unpoly/motion.coffee.erb +2 -6
  27. data/lib/assets/javascripts/unpoly/namespace.coffee.erb +2 -2
  28. data/lib/assets/javascripts/unpoly/params.coffee.erb +522 -0
  29. data/lib/assets/javascripts/unpoly/popup.coffee.erb +3 -3
  30. data/lib/assets/javascripts/unpoly/proxy.coffee +42 -34
  31. data/lib/assets/javascripts/unpoly/{syntax.coffee → syntax.coffee.erb} +59 -117
  32. data/lib/assets/javascripts/unpoly/{util.coffee → util.coffee.erb} +206 -171
  33. data/lib/unpoly/rails/version.rb +1 -1
  34. data/package.json +1 -1
  35. data/spec_app/Gemfile.lock +1 -1
  36. data/spec_app/app/assets/javascripts/integration_test.coffee +0 -4
  37. data/spec_app/app/assets/stylesheets/integration_test.sass +7 -1
  38. data/spec_app/app/controllers/pages_controller.rb +4 -0
  39. data/spec_app/app/views/form_test/basics/new.erb +34 -5
  40. data/spec_app/app/views/form_test/submission_result.erb +2 -2
  41. data/spec_app/app/views/form_test/uploads/new.erb +15 -2
  42. data/spec_app/app/views/hash_test/unpoly.erb +30 -0
  43. data/spec_app/app/views/pages/start.erb +2 -1
  44. data/spec_app/spec/javascripts/helpers/parse_form_data.js.coffee +17 -2
  45. data/spec_app/spec/javascripts/helpers/reset_up.js.coffee +5 -0
  46. data/spec_app/spec/javascripts/helpers/to_be_error.coffee +1 -1
  47. data/spec_app/spec/javascripts/helpers/to_match_selector.coffee +5 -0
  48. data/spec_app/spec/javascripts/up/browser_spec.js.coffee +8 -8
  49. data/spec_app/spec/javascripts/up/bus_spec.js.coffee +58 -20
  50. data/spec_app/spec/javascripts/up/classes/cache_spec.js.coffee +78 -0
  51. data/spec_app/spec/javascripts/up/classes/focus_tracker_spec.coffee +31 -0
  52. data/spec_app/spec/javascripts/up/classes/request_spec.coffee +50 -0
  53. data/spec_app/spec/javascripts/up/classes/store/memory_spec.js.coffee +67 -0
  54. data/spec_app/spec/javascripts/up/classes/store/session_spec.js.coffee +113 -0
  55. data/spec_app/spec/javascripts/up/dom_spec.js.coffee +133 -45
  56. data/spec_app/spec/javascripts/up/form_spec.js.coffee +13 -13
  57. data/spec_app/spec/javascripts/up/layout_spec.js.coffee +110 -26
  58. data/spec_app/spec/javascripts/up/link_spec.js.coffee +1 -1
  59. data/spec_app/spec/javascripts/up/modal_spec.js.coffee +1 -0
  60. data/spec_app/spec/javascripts/up/motion_spec.js.coffee +52 -51
  61. data/spec_app/spec/javascripts/up/namespace_spec.js.coffee +2 -2
  62. data/spec_app/spec/javascripts/up/params_spec.coffee +768 -0
  63. data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +75 -36
  64. data/spec_app/spec/javascripts/up/syntax_spec.js.coffee +48 -15
  65. data/spec_app/spec/javascripts/up/util_spec.js.coffee +148 -131
  66. metadata +17 -5
  67. data/spec_app/spec/javascripts/up/classes/.keep +0 -0
@@ -1,4 +1,4 @@
1
- (function(){window.up={version:"0.56.7",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F,$,A,D,O,R,M,j,q,U,z,N,L,_,H,I,K,Q,V,W,B,X,G,J,Y,Z,tt,et,nt,rt,ot,it,ut,st,at,lt,pt,ct,ht,ft,dt,mt,vt,gt,yt,bt,wt,kt,Tt,St,Et,Ct,xt,Pt,Ft,$t,At,Dt,Ot,Rt,Mt,jt,qt,Ut,zt,Nt,Lt,_t,Ht,It,Kt,Qt,Vt,Wt,Bt,Xt,Gt,Jt,Yt,Zt,te,ee,ne,re,oe,ie,ue,se,ae,le,pe,ce,he,fe,de,me,ve,ge,ye,be,we,ke,Te,Se,Ee,Ce,xe,Pe,Fe,$e,Ae,De,Oe,Re,Me,je,qe,Ue,ze,Ne,Le;return Vt=function(){},w=function(){return Promise.resolve()},Ut=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},Et=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},Xt=function(t,e){var n,r,o;return r=re(t),n=r.protocol+"//"+r.hostname,Et(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.search:void 0)!==!1&&(n+=r.search),(null!=e?e.hash:void 0)===!0&&(n+=r.hash),n},st=function(t){var e;return e=re(location.href),t=re(t),e.protocol!==t.protocol||e.host!==t.host},re=function(t){var e;return vt(t)&&(t=J(t)),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),it(e.hostname)&&(e.href=e.href),e)},Wt=function(t){return t?t.toUpperCase():"GET"},Lt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,p,c,h,f,d,m,v,g;for(v=t.split(/[ >]/),o=null,c=h=0,d=v.length;d>h;c=++h){for(s=v[c],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,f=0,m=u.length;m>f;f++)switch(a=u[f],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===c&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},Ce=function(t){var e,n,o,i,u,s,a,l,p,c,h;if(e=r(t),p=void 0,c=e.prop("tagName").toLowerCase(),h=ue(e.attr("up-id")))p=k("up-id",h);else if(i=ue(e.attr("id")))p=i.match(/^[a-z0-9\-_]+$/i)?"#"+i:k("id",i);else if(l=ue(e.attr("name")))p=c+k("name",l);else if(o=ue(Qt(e)))for(p="",u=0,a=o.length;a>u;u++)s=o[u],p+="."+s;else p=(n=ue(e.attr("aria-label")))?k("aria-label",n):c;return p},k=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},Qt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Te(n,function(t){return Tt(t)&&!t.match(/^up-/)})},j=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},b=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},y=Object.assign||b,Re=r.trim,Rt=function(t){return Ct(t)?function(e){return e[t]}:t},Mt=function(t,e){var n,r,o,i,u;if(0===t.length)return[];for(e=Rt(e),u=[],n=o=0,i=t.length;i>o;n=++o)r=t[n],u.push(e(r,n));return u},L=Mt,De=function(t,e){var n,r,o,i;for(i=[],n=r=0,o=t-1;o>=0?o>=r:r>=o;n=o>=0?++r:--r)i.push(e(n));return i},yt=function(t){return null===t},Pt=function(t){return void 0===t},at=function(t){return!Pt(t)},gt=function(t){return Pt(t)||yt(t)},mt=function(t){return!gt(t)},it=function(t){return gt(t)?!0:dt(t)?!1:wt(t)&&0===Object.keys(t).length?!0:0===t.length?!0:!1},ue=function(t,e){return null==e&&(e=Tt),e(t)?t:void 0},Tt=function(t){return!it(t)},dt=function(t){return"function"==typeof t},Ct=function(t){return"string"==typeof t||t instanceof String},bt=function(t){return"number"==typeof t||t instanceof Number},kt=function(t){return!("object"!=typeof t||yt(t)||vt(t)||St(t)||ft(t)||ot(t))},wt=function(t){var e;return e=typeof t,"object"===e&&!yt(t)||"function"===e},pt=function(t){return!(!t||1!==t.nodeType)},vt=function(t){return t instanceof jQuery},St=function(t){return wt(t)&&dt(t.then)},ot=Array.isArray,ft=function(t){return t instanceof FormData},Oe=function(t){return Array.prototype.slice.call(t)},O=function(t){return ot(t)?t=t.slice():wt(t)&&!dt(t)?t=y({},t):up.fail("Cannot copy %o",t),t},J=function(t){return vt(t)?t.get(0):Ct(t)?r(t).get(0):t},zt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],y.apply(null,[{}].concat(t.call(e)))},ne=function(t,e){var n,r,o,i;if(o=t?O(t):{},e)for(r in e)n=e[r],i=o[r],gt(i)&&(i=n),o[r]=i;return o},ee=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],z(e,mt)},z=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},m=function(t,e){var n,r,o,i,u;for(e=Rt(e),u=!1,r=o=0,i=t.length;i>o;r=++o)if(n=t[r],e(n,r)){u=!0;break}return u},f=function(t,e){var n,r,o,i,u;for(e=Rt(e),u=!0,r=o=0,i=t.length;i>o;r=++o)if(n=t[r],!e(n,r)){u=!1;break}return u},P=function(t){return Te(t,mt)},Me=function(t){return t.length<2?t:$e(g(t))},je=function(t,e){var n;return t.length<2?t:(e=Rt(e),n=new Set,Te(t,function(t,r){var o;return o=e(t,r),n.has(o)?!1:(n.add(o),!0)}))},$e=function(t){var e;return e=[],t.forEach(function(t){return e.push(t)}),e},g=function(t){var e;return e=new Set,t.forEach(function(t){return e.add(t)}),e},Te=function(t,e){var n;return e=Rt(e),n=[],L(t,function(t,r){return e(t,r)?n.push(t):void 0}),n},fe=function(t,e){return e=Rt(e),Te(t,function(t,n){return!e(t,n)})},rt=function(t,e){return Te(t,function(t){return A(e,t)})},c=function(t,e){return C(t,e,"add")},ve=function(t,e){return C(t,e,"remove")},C=function(t,e,n){var r;return r=J(t).classList,ot(e)?L(e,function(t){return r[n](t)}):r[n](e)},h=function(t,e){return c(t,e),function(){return ve(t,e)}},Y=function(t,e){var n;return n=J(t).classList,n.contains(e)},se=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),z(o,Tt)},Fe=function(t,e){return setTimeout(e,t)},Kt=function(t){return setTimeout(t,0)},_t=function(t){return Promise.resolve().then(t)},Ot=function(t){return t[t.length-1]},x=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},ke=Ut(function(){var t,e,n;return t=r("<div>"),e=t.get(0),t.attr("up-viewport",""),Ne(e,{position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),n=e.offsetWidth-e.clientWidth,t.remove(),n}),N=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=pe(t,"overflowY"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Le=function(t,e,n){var o,i,u;return o=r(t),i=he(o,Object.keys(e)),u=function(){return Ne(o,i)},Ne(o,e),n?(n(),u()):u},G=function(t){return t=J(t),t.offsetHeight},F=function(t){var e;return e=Le(t,{transition:"none"}),G(t),e},jt=function(t){var e;return e=J(t),{top:ce(e,"marginTop"),right:ce(e,"marginRight"),bottom:ce(e,"marginBottom"),left:ce(e,"marginLeft")}},qt=function(t,e){var n,o,i,u,s,a;return e=ne(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=jt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},R=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},Ee=function(t,e){var n;return n=r(),t.is(e)&&(n=n.add(t)),n=n.add(t.find(e))},Se=function(t,e){var n,r;return r=Ee(t,e),n=t.parents(e),r.add(n)},H=function(t){return 27===t.keyCode},A=function(t,e){return t.indexOf(e)>=0},E=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Yt=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],u in o&&(e[u]=o[u]);return e},K=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=O(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},Ft=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},$t=function(t){var e;return e=Pt(t.button)||0===t.button,e&&Ft(t)},qe=function(){return new Promise(Vt)},Gt=function(){return r()},Pe=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],gt(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},me=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},I=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],dt(n)?n.apply(null,e):n},$=function(t){var e;return e=te(t),Object.preventExtensions(e),e},te=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,dt(n)&&(n=n()),y(e,n)},e.reset(),e},Ue=function(t){var e,n;return t=J(t),e=t.parentNode,n=Oe(t.childNodes),L(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Jt=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=pe(t,"position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},ht=function(t){var e,n;for(e=r(t);;){if(n=pe(e,"position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},B=function(t,e){var n,o,i,u;return n=r(t),o=Jt(n),i=n.position(),u=o.offset(),Ne(n,{position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},ye=function(t){var e,n,r,o,i,u,s;if(ot(t),ft(t))return up.fail("Cannot convert FormData into an array");for(u=be(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],Tt(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},be=function(t,e){var n;if(e=ne(e,{purpose:"url"}),Ct(t))return t.replace(/^\?/,"");if(ft(t))return up.fail("Cannot convert FormData into a query string");if(Tt(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},we=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),Tt(o)&&v(s,o,i),s},v=function(t,e,n,r){var o;return t||(t=[]),ot(t)?t.push({name:e,value:n}):ft(t)?t.append(e,n):wt(t)?t[e]=n:Ct(t)&&(o=be([{name:e,value:n}],r),t=[t,o].join("&")),t},Nt=function(t,e){return L(ye(e),function(e){return t=v(t,e.name,e.value)}),t},W=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],ot(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),ze().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},_=function(t){return t.replace(/[&<>"]/g,function(t){return p[t]})},ie=function(t,e){var n;return n=t[e],delete t[e],n},ge=function(t,e,n){return t[n]=ie(t,e)},oe=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},V=function(t){var e;return e=Ot(t),kt(e)?t.pop():{}},s=/[^\-\_]+?(?=[A-Z\-\_]|$)/g,D=function(t,e,n){var r;return r=t.match(s),r=Mt(r,n),r.join(e)},At=function(t){return D(t,"-",function(t){return t.toLowerCase()})},T=function(t){return D(t,"",function(t,e){return 0===e?t.toLowerCase():t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})},Dt=function(t){return M(t,At)},S=function(t){return M(t,T)},M=function(t,e){var n,r,o;r={};for(n in t)o=t[n],n=e(n),r[n]=o;return r},Zt=function(t){return ce(t,"opacity")},ze=Ut(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),nt=function(t){return t},lt=function(t){return t=J(t),!r.contains(document.documentElement,t)},ae=function(e){var n,r;return n=It(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},l=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=Ot(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),d(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=Mt(e,ae),this.poke(),this.promise()},e}(),Ae=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},xe=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return Mt(e,function(t){return t()})}},le=function(t){var e,n;return n=void 0,e=new Promise(function(e,r){return n=Fe(t,e)}),e.cancel=function(){return clearTimeout(n)},e},et=function(t){var e,n,r,o;return e=qt(t),r=x(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},U=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},tt=function(t){return Ne(t,{display:"none"})},pe=function(t,e){var n;return t=J(t),n=window.getComputedStyle(t),Q(n,e)},ce=function(t,e){var n;return n=pe(t,e),mt(n)?parseFloat(n):void 0},he=function(t,e){var n;return t=J(t),n=t.style,Q(n,e)},Q=function(e,n){return Ct(n)?e[n]:Yt.apply(null,[e].concat(t.call(n)))},Ne=function(t,e){var n,r,o,i;t=J(t),o=t.style,r=[];for(n in e)i=e[n],i=Bt(n,i),r.push(o[n]=i);return r},Bt=function(t,e){return gt(e)?e="":a.has(t)&&(e=q(e)),e},a=g(["top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","width","height","maxWidth","maxHeight","minWidth","minHeight"]),q=function(t){return bt(t)||Ct(t)&&/^\d+$/.test(t)?t.toString()+"px":t},Z=function(t){var e,n,r,o,i;return kt(t)?i=t:(n=J(n),i=getComputedStyle(n)),o=i.transitionProperty,e=i.transitionDuration,r="none"===o||"all"===o&&0===e,!r},X=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],ot(o)?e=e.concat(o):e.push(o);return e},xt=function(t){return!!t},d=function(t,e){return t.then(e,e)},Ht=function(t){return null!=t?t["catch"](Vt):void 0},It=function(){var t,e,n;return n=void 0,e=void 0,t=new Promise(function(t,r){return n=t,e=r}),t.resolve=n,t.reject=e,t.promise=function(){return t},t},de=function(t){var e;try{return t()}catch(n){return e=n,Promise.reject(e)}},ut=function(t){return r(t).parents("body").length>0},ct=function(t,e){return typeof t!=typeof e?!1:ot(t)?t.length===e.length&&f(t,function(t,n){return ct(t,e[n])}):wt(t)?W("isEqual cannot compare objects yet"):t===e},{requestDataAsArray:ye,requestDataAsQuery:be,appendRequestData:v,mergeRequestData:Nt,requestDataFromForm:we,offsetParent:Jt,fixedToAbsolute:B,isFixed:ht,presentAttr:se,parseUrl:re,normalizeUrl:Xt,normalizeMethod:Wt,methodAllowsPayload:Lt,createElementFromHtml:j,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:Ce,assign:y,assignPolyfill:b,copy:O,merge:zt,options:ne,option:ee,fail:W,each:L,map:Mt,times:De,any:m,all:f,detect:z,select:Te,reject:fe,intersect:rt,compact:P,uniq:Me,uniqBy:je,last:Ot,isNull:yt,isDefined:at,isUndefined:Pt,isGiven:mt,isMissing:gt,isPresent:Tt,isBlank:it,presence:ue,isObject:wt,isFunction:dt,isString:Ct,isNumber:bt,isElement:pt,isJQuery:vt,isPromise:St,isOptions:kt,isArray:ot,isFormData:ft,isUnmodifiedKeyEvent:Ft,isUnmodifiedMouseEvent:$t,nullJQuery:Gt,element:J,setTimer:Fe,nextFrame:Kt,measure:qt,addClass:c,removeClass:ve,hasClass:Y,addTemporaryClass:h,writeTemporaryStyle:Le,forceRepaint:G,concludeCssTransition:F,escapePressed:H,copyAttributes:R,selectInSubtree:Ee,selectInDynasty:Se,contains:A,toArray:Oe,castedAttr:E,clientSize:x,only:Yt,except:K,trim:Re,unresolvablePromise:qe,setMissingAttrs:Pe,remove:me,memoize:Ut,scrollbarWidth:ke,documentHasVerticalScrollbar:N,config:$,openConfig:te,unwrapElement:Ue,camelCase:T,camelCaseKeys:S,kebabCase:At,kebabCaseKeys:Dt,error:W,pluckData:oe,pluckKey:ie,renameKey:ge,extractOptions:V,isDetached:lt,noop:Vt,asyncNoop:w,opacity:Zt,whenReady:ze,identity:nt,escapeHtml:_,DivertibleChain:l,submittedValue:Ae,sequence:xe,promiseTimer:le,previewable:ae,evalOption:I,horizontalScreenHalf:et,detachWith:U,flatten:X,isTruthy:xt,newDeferred:It,always:d,muteRejection:Ht,rejectOnError:de,isBodyDescendant:ut,isCrossDomain:st,microtask:_t,isEqual:ct,hide:tt,cssLength:q,readComputedStyle:pe,readComputedStyleNumber:ce,readInlineStyle:he,writeInlineStyle:Ne,hasCssTransition:Z}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.CssTransition=function(){function n(n,r,o){this.startMotion=e(this.startMotion,this),this.resumeOldTransition=e(this.resumeOldTransition,this),this.pauseOldTransition=e(this.pauseOldTransition,this),this.finish=e(this.finish,this),this.onTransitionEnd=e(this.onTransitionEnd,this),this.stopListenToTransitionEnd=e(this.stopListenToTransitionEnd,this),this.listenToTransitionEnd=e(this.listenToTransitionEnd,this),this.stopFallbackTimer=e(this.stopFallbackTimer,this),this.startFallbackTimer=e(this.startFallbackTimer,this),this.onFinishEvent=e(this.onFinishEvent,this),this.stopListenToFinishEvent=e(this.stopListenToFinishEvent,this),this.listenToFinishEvent=e(this.listenToFinishEvent,this),this.start=e(this.start,this),this.$element=n,this.element=t.element(n),this.lastFrameCamel=t.camelCaseKeys(r),this.lastFrameKebab=t.kebabCaseKeys(r),this.lastFrameKeysKebab=Object.keys(this.lastFrameKebab),this.finishEvent=o.finishEvent,this.duration=o.duration,this.delay=o.delay,this.totalDuration=this.delay+this.duration,this.easing=o.easing,this.finished=!1}return n.prototype.start=function(){return 0===this.lastFrameKeysKebab.length?(this.finished=!0,Promise.resolve()):(this.deferred=t.newDeferred(),this.pauseOldTransition(),this.startTime=new Date,this.startFallbackTimer(),this.listenToFinishEvent(),this.listenToTransitionEnd(),this.startMotion(),this.deferred.promise())},n.prototype.listenToFinishEvent=function(){return this.finishEvent?this.$element.on(this.finishEvent,this.onFinishEvent):void 0},n.prototype.stopListenToFinishEvent=function(){return this.finishEvent?this.$element.off(this.finishEvent,this.onFinishEvent):void 0},n.prototype.onFinishEvent=function(t){return t.stopPropagation(),this.finish()},n.prototype.startFallbackTimer=function(){var e;return e=100,this.fallbackTimer=t.setTimer(this.totalDuration+e,function(t){return function(){return t.finish()}}(this))},n.prototype.stopFallbackTimer=function(){return clearTimeout(this.fallbackTimer)},n.prototype.listenToTransitionEnd=function(){return this.$element.on("transitionend",this.onTransitionEnd)},n.prototype.stopListenToTransitionEnd=function(){return this.$element.off("transitionend",this.onTransitionEnd)},n.prototype.onTransitionEnd=function(e){var n,r;if(e.target===this.element&&(r=new Date-this.startTime,r>.25*this.totalDuration&&(n=e.originalEvent.propertyName,t.contains(this.lastFrameKeysKebab,n))))return this.finish()},n.prototype.finish=function(){return this.finished?void 0:(this.finished=!0,this.stopFallbackTimer(),this.stopListenToFinishEvent(),this.stopListenToTransitionEnd(),t.concludeCssTransition(this.element),this.resumeOldTransition(),this.deferred.resolve())},n.prototype.pauseOldTransition=function(){var e,n,r,o;return e=t.readComputedStyle(this.element,["transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction"]),t.hasCssTransition(e)?("all"!==e.transitionProperty&&(o=e.transitionProperty.split(/\s*,\s*/),r=t.readComputedStyle(this.element,o),n=t.camelCaseKeys(r),this.setOldTransitionTargetFrame=t.writeTemporaryStyle(this.element,n)),this.setOldTransition=t.concludeCssTransition(this.element)):void 0},n.prototype.resumeOldTransition=function(){return"function"==typeof this.setOldTransitionTargetFrame&&this.setOldTransitionTargetFrame(),"function"==typeof this.setOldTransition?this.setOldTransition():void 0},n.prototype.startMotion=function(){return t.writeInlineStyle(this.element,{transitionProperty:Object.keys(this.lastFrameKebab).join(", "),transitionDuration:this.duration+"ms",transitionDelay:this.delay+"ms",transitionTimingFunction:this.easing}),t.writeInlineStyle(this.element,this.lastFrameCamel)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return t=this.options.provideTarget?this.plans[0]:this.oldPlan(),t?(t.resolveNesting(),t.selector()):this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?(t.addHungrySteps(),t.resolveNesting(),t.steps):this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.addHungrySteps=e(this.addHungrySteps,this),this.parseSteps=e(this.parseSteps,this),this.selector=e(this.selector,this),this.resolveNesting=e(this.resolveNesting,this),this.addSteps=e(this.addSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this);var r;this.reveal=n.reveal,this.origin=n.origin,this.hungry=n.hungry,this.transition=n.transition,this.response=n.response,this.oldLayer=n.layer,r=up.dom.resolveSelector(t,this.origin),this.parseSteps(r)}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.addSteps=function(t){return this.steps=this.steps.concat(t)},n.prototype.resolveNesting=function(){var e;if(!(this.steps.length<2))return e=t.copy(this.steps),e=t.uniqBy(e,function(t){return t.$old[0]}),e=t.select(e,function(n){return function(n,r){return t.all(e,function(t,e){var o,i;return e===r?!0:(o=n.$old[0],i=t.$old[0],t.pseudoClass||!$.contains(i,o))})}}(this)),e[0].reveal=this.steps[0].reveal,this.steps=e},n.prototype.selector=function(){return t.map(this.steps,"expression").join(", ")},n.prototype.parseSteps=function(e){var n,r;return n=/\ *,\ */,this.steps=[],r=e.split(n),t.each(r,function(t){return function(e,n){var r,o,i,u;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],r=0===n?t.reveal:!1,t.steps.push({expression:e,selector:u,pseudoClass:i,transition:t.transition,origin:t.origin,reveal:r})}}(this))},n.prototype.addHungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(i=[],this.hungry)for(e=$(up.radio.hungrySelector()),l=t.option(up.radio.config.hungryTransition,this.transition),u=0,s=e.length;s>u;u++)o=e[u],n=$(o),a=t.selectorForElement(n),(r=this.response.first(a))&&i.push({selector:a,$old:n,$new:r,transition:l,reveal:!1,origin:null});return this.addSteps(i)},n}()}.call(this),function(){var t;t=up.util,up.ExtractStep=function(){function t(){}return t}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onClick.apply(e,r))}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onMousedown.apply(e,r))}}(this))},r.prototype.followLink=function(t,e){return null==e&&(e={}),up.bus.whenEmitted("up:link:follow",{$element:t}).then(function(n){return function(){return up.feedback.start(t,e,function(){return n.followNow(t,e)})}}(this))},r.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t;t=up.util,up.HtmlParser=function(){function e(e){this.html=e,this.wrapNoscriptInHtml(),this.parsedDoc=t.createElementFromHtml(this.html);
2
- }return e.prototype.title=function(){var t;return null!=(t=this.parsedDoc.querySelector("head title"))?t.textContent:void 0},e.prototype.first=function(t){var e;return(e=$.find(t,this.parsedDoc)[0])?$(e):void 0},e.prototype.prepareForInsertion=function(t){var e;return e=t[0],this.unwrapNoscriptInElement(e),$(e)},e.prototype.wrapNoscriptInHtml=function(){var e;return e=/<noscript[^>]*>((.|\s)*?)<\/noscript>/gi,this.html=this.html.replace(e,function(e){return function(n,r){return e.didWrapNoscript=!0,'<div class="up-noscript" data-html="'+t.escapeHtml(r)+'"></div>'}}(this))},e.prototype.unwrapNoscriptInElement=function(t){var e,n,r,o,i,u,s;if(this.didWrapNoscript){for(s=t.querySelectorAll(".up-noscript"),o=[],e=0,n=s.length;n>e;e++)u=s[e],i=u.getAttribute("data-html"),r=document.createElement("noscript"),r.textContent=i,o.push(u.parentNode.replaceChild(r,u));return o}},e}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.reset=e(this.reset,this),this.whileForwardingFinishEvent=e(this.whileForwardingFinishEvent,this),this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkCluster=e(this.unmarkCluster,this),this.markCluster=e(this.markCluster,this),this.whenElementFinished=e(this.whenElementFinished,this),this.emitFinishEvent=e(this.emitFinishEvent,this),this.finishOneElement=e(this.finishOneElement,this),this.isActive=e(this.isActive,this),this.expandFinishRequest=e(this.expandFinishRequest,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.activeClass="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.activeClass,this.finishEvent="up:"+t+":finish",this.finishCount=0,this.clusterCount=0}return n.prototype.claim=function(e,n,r){var o;return null==r&&(r={}),o=$(e),r.trackMotion=t.option(r.trackMotion,up.motion.isEnabled()),r.trackMotion===!1?t.microtask(n):(r.trackMotion=!1,this.finish(o).then(function(t){return function(){var e;return e=t.whileForwardingFinishEvent(o,n),e=e.then(function(){return t.unmarkCluster(o)}),t.markCluster(o,e),e}}(this)))},n.prototype.finish=function(e){var n,r;return this.finishCount++,0!==this.clusterCount&&up.motion.isEnabled()?(n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)):Promise.resolve()},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.isActive=function(e){return t.hasClass(e,this.activeClass)},n.prototype.finishOneElement=function(t){var e;return e=$(t),this.emitFinishEvent(e),this.whenElementFinished(e)},n.prototype.emitFinishEvent=function(e,n){return null==n&&(n={}),n=t.merge({$element:e,message:!1},n),up.emit(this.finishEvent,n)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markCluster=function(t,e){return this.clusterCount++,t.addClass(this.activeClass),t.data(this.dataKey,e)},n.prototype.unmarkCluster=function(t){return this.clusterCount--,t.removeClass(this.activeClass),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n.prototype.whileForwardingFinishEvent=function(e,n){var r;return e.length<2?n():(r=function(n){return function(r){return r.forwarded?void 0:t.each(e,function(t){var e;return e=$(t),t!==r.target&&n.isActive(e)?n.emitFinishEvent(e,{forwarded:!0}):void 0})}}(this),e.on(this.finishEvent,r),n().then(function(t){return function(){return e.off(t.finishEvent,r)}}(this)))},n.prototype.reset=function(){return this.finish().then(function(t){return function(){return t.finishCount=0,t.clusterCount=0}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferSearchToData=e(this.transferSearchToData,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToData():this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return this.data&&!t.isFormData(this.data)?(e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0):void 0},o.prototype.transferSearchToData=function(){var e,n;return n=t.parseUrl(this.url),e=n.search,e?(this.data=t.mergeRequestData(this.data,e),this.url=t.normalizeUrl(n,{search:!1})):void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,p,c,h,f;l=new XMLHttpRequest,c=t.copy(e.headers),p=e.data,h=e.method,f=e.url,u=up.proxy.wrapMethod(h,p),h=u[0],p=u[1],t.isFormData(p)?delete c["Content-Type"]:t.isPresent(p)?(p=t.requestDataAsQuery(p,{purpose:"form"}),c["Content-Type"]="application/x-www-form-urlencoded"):p=null,e.target&&(c[up.protocol.config.targetHeader]=e.target),e.failTarget&&(c[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(c[up.protocol.config.csrfHeader]=o),l.open(h,f);for(i in c)a=c[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(p)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return this.transferSearchToData(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.UrlSet=function(){function n(n,r){this.urls=n,null==r&&(r={}),this.isEqual=e(this.isEqual,this),this.matchesAny=e(this.matchesAny,this),this.doesMatchPrefix=e(this.doesMatchPrefix,this),this.doesMatchFully=e(this.doesMatchFully,this),this.matches=e(this.matches,this),this.normalizeUrl=r.normalizeUrl||t.normalizeUrl,this.urls=t.map(this.urls,this.normalizeUrl),this.urls=t.compact(this.urls)}return n.prototype.matches=function(t){return"*"===t.substr(-1)?this.doesMatchPrefix(t.slice(0,-1)):this.doesMatchFully(t)},n.prototype.doesMatchFully=function(e){return t.contains(this.urls,e)},n.prototype.doesMatchPrefix=function(e){return t.detect(this.urls,function(t){return 0===t.indexOf(e)})},n.prototype.matchesAny=function(e){return t.detect(e,this.matches)},n.prototype.isEqual=function(e){return t.isEqual(this.urls,null!=e?e.urls:void 0)},n}()}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x;return E=up.util,m=function(t,e){var n;return null==e&&(e={}),n=new up.Request(E.merge(e,{url:t})),n.navigate()},S=function(t){return t.submit()},y=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],console[n].apply(console,e)},n=/\%[odisf]/g,T=function(t){var n,r,o,i,u,s,a,l,p;if(s=200,o="",E.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',o='"';else if(E.isUndefined(t))l="undefined";else if(E.isNumber(t)||E.isFunction(t))l=t.toString();else if(E.isArray(t))l="["+E.map(t,T).join(", ")+"]",o="]";else if(E.isJQuery(t))l="$("+E.map(t,T).join(", ")+")",o=")";else if(E.isElement(t)){for(n=e(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],i=0,u=a.length;u>i;i++)r=a[i],(p=n.attr(r))&&(l+=" "+r+'="'+p+'"');l+=">",o=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=o),l},w=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],k.apply(null,[E.identity,n].concat(t.call(e)))},k=function(){var e,r,o,i;return r=arguments[0],i=arguments[1],e=3<=arguments.length?t.call(arguments,2):[],E.isBlank(i)?"":(o=0,i.replace(n,function(){var t;return t=e[o],t=r(T(t)),o+=1,t}))},C=function(){return location.href},h=E.memoize(function(){return!window.atob}),p=function(){return E.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},o=E.memoize(function(){return"transition"in document.documentElement.style}),a=E.memoize(function(){return"oninput"in document.createElement("input")}),l=E.memoize(function(){return!!window.Promise}),s=E.memoize(function(){return!!window.FormData}),u=E.memoize(function(){return!!window.DOMParser}),r=E.memoize(function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd}),i=E.memoize(function(){return!!window.customElements}),f=E.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}),g=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,E.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},x=function(t){return t.preload||E.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},d=function(){return!h()&&f()&&r()&&u()&&s()&&o()&&a()&&l()},b=E.memoize(function(){try{return window.sessionStorage}catch(t){return v()}}),v=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},c=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),E.presence(t)},{url:C,navigate:m,submitForm:S,canPushState:p,canCustomElements:i,whenConfirmed:x,isSupported:d,puts:y,sprintf:w,sprintfWithFormattedArgs:k,sessionStorage:b,popCookie:g,hash:c}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C;return w=up.util,p={},h=0,g={},E=function(t){return function(n){var r;return r=n.$element||e(this),t.apply(r.get(0),[n,r,up.syntax.data(r)])}},S=function(t,e){var n,r,o;return n=w.copy(t),u(n),o=n.pop(),r=void 0,e?(r=E(o),o._asJqueryListener=r,o._descriptionNumber=++h):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},u=function(t){var e;return e=t[0].split(/\s+/),e=w.map(e,function(t){var e;return(e=g[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},l=function(){var n,r,o;return o=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(n=S(o,!0),m(o),(r=e(document)).on.apply(r,n),function(){return k.apply(null,o)}):function(){}},k=function(){var n,r,o;return o=1<=arguments.length?t.call(arguments,0):[],n=S(o,!1),s(o),(r=e(document)).off.apply(r,n)},m=function(t){var e;return e=T(t),p[e]=t},s=function(t){var e;return e=T(t),delete p[e]},T=function(t){return w.last(t)._descriptionNumber},o=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$target||n.$element||e(document),c(t,n),r.trigger(o),o},c=function(e,n){var r,o,i;return n.hasOwnProperty("message")?(r=n.message,delete n.message,r!==!1&&(w.isArray(r)?(i=r,r=i[0],o=2<=i.length?t.call(i,1):[]):o=[],r)?w.isPresent(n)?up.puts.apply(up,[r+" (%s (%o))"].concat(t.call(o),[e],[n])):up.puts.apply(up,[r+" (%s)"].concat(t.call(o),[e])):void 0):w.isPresent(n)?up.puts("Emitted event %s (%o)",e,n):up.puts("Emitted event %s",e)},f=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=o.apply(null,e),!n.isDefaultPrevented()},C=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],new Promise(function(t,n){return f.apply(null,e)?t():n(new Error("Event "+e[0]+" was prevented"))})},d=function(t){return l("keydown","body",function(e){return w.escapePressed(e)?t(e):void 0})},a=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},r=function(t){return a(t),"up:action:consumed"!==t.type?o("up:action:consumed",{$element:e(t.target),message:!1}):void 0},b=function(){var t,e,n;n=[];for(e in p)t=p[e],n.push(t.isDefault=!0);return n},y=function(){var t,e,n,r,o,i;e=[];for(o in p)t=p[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(k.apply(null,t));return i},i=function(){return o("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},v=function(t,e){return g[t]=e},n=function(){return up.browser.isSupported()?(o("up:framework:boot",{message:"Booting framework"}),o("up:framework:booted",{message:"Framework booted"}),w.nextFrame(function(){return w.whenReady().then(function(){return o("up:app:boot",{message:"Booting user application"}),o("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},l("up:framework:booted",b),l("up:framework:reset",y),{on:l,off:k,emit:o,nobodyPrevents:f,whenEmitted:C,onEscape:d,emitReset:i,haltEvent:a,consumeAction:r,renamedEvent:v,boot:n}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v;return m=up.util,r=up.browser,n="up.log.enabled",o=m.config({prefix:"[UP] ",enabled:"true"===r.sessionStorage().getItem(n),collapse:!1}),f=function(){return o.reset()},p=function(t){return""+o.prefix+t},i=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",p(n)].concat(t.call(e))):void 0},h=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",p(n)].concat(t.call(e))):void 0},v=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["warn",p(n)].concat(t.call(e))):void 0},l=function(){var e,n,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,p(i)].concat(t.call(e)));try{return n()}finally{i&&r.puts("groupEnd")}},a=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["error",p(n)].concat(t.call(e))):void 0},c=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",t)},up.on("up:framework:boot",c),up.on("up:framework:reset",f),d=function(t){return r.sessionStorage().setItem(n,t.toString()),o.enabled=t},s=function(){return d(!0)},u=function(){return d(!1)},{puts:h,debug:i,error:a,warn:v,group:l,config:o,enable:s,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,p,c;return c=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+c.escapeHtml(t)+"</span>"},p=c.config({$toast:null}),l=function(){return i(),p.reset()},s=function(e){return c.isArray(e)?(e[0]=c.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=c.escapeHtml(e),e},u=function(){return!!p.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),p.$toast=a},i=function(){return u()?(p.$toast.remove(),p.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k;return k=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,c=[],g=[],p=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=k.options(e[0]),d(c,o,r,n)):void 0},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=k.options(e[0]),m&&(r.priority=f(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)):void 0},f=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=k.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,h(e)]),i(e,r)},y=function(t){return k.isFunction(t)?t:k.isArray(t)&&k.all(t,k.isFunction)?k.sequence.apply(k,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return b(t)},o=k.sequence(o,e),t.data(r,o)):void 0},b=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=k.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,c],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)p=s[o],n=k.selectInSubtree(t,p.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),k.all(r,function(e){return 0===t.closest(e).length})})),n.length?a.push(up.log.group(p.isSystem?void 0:"Compiling '%s' on %d element(s)",p.selector,n.length,function(){return p.batch?u(p,n,n.get()):n.each(function(){return u(p,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){var o;return o=k.selectInSubtree(t,"."+n),k.each(o,function(t){var n;return(n=e(t).data(r))?n():void 0})},h=function(t){var n,r;return n=e(t),r=n.attr("up-data"),k.isString(r)&&""!==k.trim(r)?JSON.parse(r):{}},w=function(){var t;return t=function(t){return t.isSystem},c=k.select(c,t),g=k.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",w),{compiler:p,macro:v,compile:l,clean:a,data:h}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,p,c,h,f,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),p=void 0,u=void 0,d=function(){return n.reset(),p=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(p=u,u=void 0),u=t},f=function(t){return i("replaceState",t)?up.emit("up:history:replaced",{url:t}):void 0},c=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:p}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(h=function(){return t(window).on("popstate",l),f(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?h():setTimeout(h,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(p)?(v.setMissingAttrs(t,{"up-href":p,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:c,replace:f,url:r,isUrl:o,previousUrl:function(){return p},normalizeUrl:s}}(jQuery)}.call(this),function(){var t=[].slice;up.layout=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F;return E=up.util,o=E.config({duration:0,viewports:[".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),a=new up.Cache({size:30,key:up.history.normalizeUrl}),S=new up.MotionTracker("scrolling"),p=function(){return o.reset(),a.clear(),S.reset()},g=function(t,e,n){var r;return r=T(t),n=E.options(n),n.duration=E.option(n.duration,o.duration),n.easing=E.option(n.easing,o.easing),i(r).then(function(){return up.motion.isEnabled()&&n.duration>0?k(r,e,n):y(r,e)})},T=function(t){var n;return n=e(t),n.get(0)===document?e("html, body"):n},k=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(S.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(S.eventName)}),o},S.claim(t,r)},y=function(t,e){return t.scrollTop(e),Promise.resolve()},i=function(t){var e;return up.motion.isEnabled()?(e=T(t),S.finish(e)):Promise.resolve()},r=function(){var t;return t=o.anchoredRight.join(","),e(t)},l=function(){var n,r,i,u;return i=function(t,n){var r,o;return r=e(t),o=E.readComputedStyleNumber(r,n),E.isPresent(o)||up.fail("Fixed element %o must have a CSS attribute %s",r.get(0),n),o+r.height()},r=function(){var t,n,r,s;for(r=e(o.fixedTop.join(", ")),s=[],t=0,n=r.length;n>t;t++)u=r[t],s.push(i(u,"top"));return s}(),n=function(){var t,n,r,s;for(r=e(o.fixedBottom.join(", ")),s=[],t=0,n=r.length;n>t;t++)u=r[t],s.push(i(u,"bottom"));return s}(),{top:Math.max.apply(Math,[0].concat(t.call(r))),bottom:Math.max.apply(Math,[0].concat(t.call(n)))}},h=function(t,n){var r;return r=e(t).first(),up.puts("Revealing fragment %o",r.get(0)),n=E.options(n),E.rejectOnError(function(){var t,i,u,s,a,p,c,h,f,d,m,v,y;return t=n.viewport?e(n.viewport):C(r),m=E.option(n.snap,o.snap),y=t.is(document),v=y?E.clientSize().height:t.outerHeight(),h=t.scrollTop(),a=h,c=void 0,p=void 0,y?(p=l(),c=0):(p={top:0,bottom:0},c=h),f=function(){return a+p.top},d=function(){return a+v-p.bottom-1},i=E.measure(r,{relative:t,includeMargin:!0}),u=i.top+c,s=u+Math.min(i.height,o.substance)-1,s>d()&&(a+=s-d()),(u<f()||n.top)&&(a=u-p.top),m>a&&i.top<.5*v&&(a=0),a!==h?g(t,a,n):Promise.resolve()})},f=function(){var t,e;return(e=up.browser.hash())&&(t=u(e))?h(t):Promise.resolve()},x=function(){return o.viewports.join(",")},C=function(t,n){var r,o;return null==n&&(n={}),r=e(t),o=r.closest(x()),0===o.length&&(o=e(document)),o},F=function(t){var n;return n=e(t),E.selectInSubtree(n,x())},P=function(){return e(document).add(x())},b=function(t){var n;return n=e(t),n.is(document)?"document":E.selectorForElement(n)},w=function(){var t,n,r,i,u;for(u={},i=o.viewports,n=0,r=i.length;r>n;n++)t=i[n],e(t).each(function(){var t,n,r;return t=e(this),n=b(t),r=t.scrollTop(),u[n]=r});return u},s=function(t){var n,r;return null==t&&(t=void 0),t||(t=document.body),r=e(t),n=r.find("[up-fixed]"),E.isPresent(o.fixedTop)&&(n=n.add(r.find(o.fixedTop.join(", ")))),E.isPresent(o.fixedBottom)&&(n=n.add(r.find(o.fixedBottom.join(", ")))),n},v=function(t){var e,n;return null==t&&(t={}),n=E.option(t.url,up.history.url()),e=E.option(t.tops,w()),a.set(n,e)},c=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=F(t.around),e=C(t.around),r=e.add(n)):r=P(),o=a.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=E.map(r,function(t){var e,n;return e=b(t),n=o[e]||0,g(t,n,{duration:0})}),Promise.all(t)})},d=function(t,n){var r,o,i;return n=E.options(n),r=e(t),n.restoreScroll?c({around:r}):n.reveal&&(o={duration:n.duration},E.isString(n.reveal)&&(i=m(n.reveal,n),r=up.first(i)||r,o.top=!0),r.length)?h(r,o):Promise.resolve()},m=function(t,e){return t=up.dom.resolveSelector(t,e.origin),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},n=function(t,n){var r,o,i,u,s,a,l,p,c,h,f;for(n=E.options(n,{afterMeasure:E.noop}),i=up.layout.viewportOf(t),c=E.measure(t,{relative:!0,inner:!0}),h=t.offset(),n.afterMeasure(),E.writeInlineStyle(t,{position:"static"===E.readComputedStyle(t,"position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),r=e('<div class="up-bounds"></div>'),u=E.merge(c,{position:"absolute"}),E.writeInlineStyle(r,u),r.insertBefore(t),t.appendTo(r),f=c.top,p=function(t){return 0!==t?(f+=t,E.writeInlineStyle(r,{top:f})):void 0},p(h.top-t.offset().top),o=up.layout.fixedChildren(t),a=0,l=o.length;l>a;a++)s=o[a],E.fixedToAbsolute(s,i);return{$element:t,$bounds:r,moveTop:p}},u=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",f),up.on("up:framework:reset",p),{reveal:h,revealHash:f,firstHashTarget:u,scroll:g,config:o,viewportOf:C,viewportsWithin:F,viewports:P,scrollTops:w,saveScroll:v,restoreScroll:c,revealOrRestoreScroll:d,anchoredRight:r,fixedChildren:s,absolutize:n}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function(t){var e,n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F,$,A,D;return A=up.util,r=A.config({fallbacks:["body"],fallbackTransition:null}),T=function(){return r.reset()},E=function(e,n){var r;return n!==!1?(r=t(e),A.isPresent(n)&&(n=A.normalizeUrl(n)),r.attr("up-source",n)):void 0},P=function(e){var n;return n=t(e).closest("[up-source]"),A.presence(n.attr("up-source"))||up.browser.url()},S=function(t,e){var n,r;return A.isString(t)?(r=t,A.contains(r,"&")&&(A.isPresent(e)?(n=A.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=A.selectorForElement(t),r},k=function(t,e,r){var o,i,u,s,a,l,p,c,h,f;if(r=A.options(r),r.inspectResponse=u=function(){return up.browser.navigate(e,A.only(r,"method","data"))},!up.browser.canPushState()&&r.history!==!1)return r.preload||u(),A.unresolvablePromise();f=A.merge(r,{humanizedTarget:"target"}),i=A.merge(r,{humanizedTarget:"failure target",provideTarget:void 0,restoreScroll:!1}),A.renameKey(i,"failTransition","transition"),A.renameKey(i,"failLayer","layer"),A.renameKey(i,"failReveal","reveal");try{a=n(t,f),s=n(r.failTarget,i)}catch(d){return o=d,Promise.reject(o)}return h={url:e,method:r.method,data:r.data,target:a,failTarget:s,cache:r.cache,preload:r.preload,headers:r.headers,timeout:r.timeout},p=function(t){return b(!0,a,t,f)},l=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=b(!1,s,t,i),A.always(e,n))},c=up.request(h),r.preload||(c=c.then(p,l)),c},b=function(t,e,n,r){var o,i,u,s,a;return s=n.request,a=n.url,i=a,o=s.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),u="GET"===n.method,t?u?(r.history===!1||A.isString(r.history)||(r.history=i),r.source===!1||A.isString(r.source)||(r.source=a)):(A.isString(r.history)||(r.history=!1),A.isString(r.source)||(r.source="keep")):u?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=a)):(r.history=!1,r.source="keep"),C(r)&&n.title&&(r.title=n.title),l(e,n.text,r)},C=function(t){return!(t.title===!1||A.isString(t.title)||t.history===!1&&t.title!==!0)},l=function(t,n,r){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=n?n.length:void 0,function(){return r=A.options(r,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),r.saveScroll!==!1&&up.layout.saveScroll(),A.rejectOnError(function(){var o,i,u,s,a,l,p;for("function"==typeof r.provideTarget&&r.provideTarget(),s=new up.HtmlParser(n),o=e(t,s,r),C(r)&&(a=s.title())&&(r.title=a),D(r),p=[],i=0,u=o.length;u>i;i++)l=o[i],
3
- up.log.group("Swapping fragment %s",l.selector,function(){var t,e;return t=A.merge(r,A.only(l,"origin","reveal")),s.prepareForInsertion(l.$new),e=F(l.$old,l.$new,l.pseudoClass,l.transition,t),p.push(e)});return Promise.all(p)})})},n=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},e=function(t,e,n){var r;return n=A.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},D=function(t){return t=A.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),A.isString(t.title)?document.title=t.title:void 0},F=function(t,e,n,r,o){var s,l,c,h,f;return r||(r="none"),"keep"===o.source&&(o=A.merge(o,{source:P(t)})),E(e,o.source),n?(l=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(l):t.append(l),d(l.children(),o),f=up.layout.revealOrRestoreScroll(l,o),f=f.then(function(){return up.animate(l,r,o)}),f=f.then(function(){return A.unwrapElement(l)})):(c=p(t,e,o))?(a(c),Promise.resolve()):(o.keepPlans=$(t,e,o),s=t.parent(),h=A.merge(o,{beforeStart:function(){return g(t),i(t,{log:!1})},afterInsert:function(){return up.hello(e,o)},beforeDetach:function(){return up.syntax.clean(t)},afterDetach:function(){return t.remove(),u(t,{$parent:s,log:!1})}}),up.morph(t,e,r,h))},$=function(e,n,r){var o,i,u,s,a,l,c,h;if(s=[],r.keep)for(h=e.find("[up-keep]"),u=0,l=h.length;l>u;u++)a=h[u],o=t(a),(c=p(o,n,A.merge(r,{descendantsOnly:!0})))&&(i=o.clone(),A.detachWith(o,i),c.$newElement.replaceWith(o),s.push(c));return s},p=function(t,e,n){var r,o,i,u,s;return n.keep&&(r=t,(u=A.castedAttr(r,"up-keep"))&&(A.isString(u)||(u="&"),u=S(u,r),o=n.descendantsOnly?e.find(u):A.selectInSubtree(e,u),o=o.first(),o.length&&o.is("[up-keep]")&&(s={$element:r,$newElement:o,newData:up.syntax.data(o)},i=A.merge(s,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?s:void 0},d=function(e,n){var r,o,i,u,l,p;for(r=t(e),n=A.options(n,{keepPlans:[]}),i=[],p=n.keepPlans,o=0,u=p.length;u>o;o++)l=p[o],a(l),i.push(l.$element);return up.syntax.compile(r,{skip:i}),s(r,n),r},s=function(t,e){return up.emit("up:fragment:inserted",{$element:t,message:["Inserted fragment %o",t.get(0)],origin:e.origin})},a=function(t){var e;return e=A.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},i=function(t,e){var n;return x(t,e)&&(n=["Destroying fragment %o",t.get(0)]),up.emit("up:fragment:destroy",{$element:t,message:n})},u=function(t,e){var n,r;return x(t,e)&&(r=["Destroyed fragment %o",t.get(0)]),n=e.$parent||up.fail("Missing { $parent } option"),up.emit("up:fragment:destroyed",{$target:n,$parent:n,$element:t,message:r})},m=function(t){var e;return e=".up-destroying",0===t.closest(e).length},c=function(t,e){var n;return e=A.options(e,{layer:"auto"}),n=S(t,e.origin),"auto"===e.layer?f(n,e.origin):h(n,e.layer)},f=function(t,e){var n,r,o,i,u,s;for(i=["popup","modal","page"],n=void 0,A.isPresent(e)&&(s=v(e),A.remove(i,s),i.unshift(s)),r=0,u=i.length;u>r&&(o=i[r],!(n=h(t,o)));r++);return n},h=function(e,n){var r,o,i,u,s,a;for(o=t(e),i=void 0,s=0,a=o.length;a>s;s++)if(u=o[s],r=t(u),m(r)&&y(r,n)){i=r;break}return i},v=function(e){var n;return n=t(e),up.popup.contains(n)?"popup":up.modal.contains(n)?"modal":"page"},y=function(t,e){return v(t)===e},o=function(e,n){var r,o,s;return r=t(e),n=A.options(n,{animation:!1}),0===r.length?Promise.resolve():(g(r),i(r,n),D(n),o=function(){var t;return t=up.motion.animateOptions(n),up.motion.animate(r,n.animation,t)},s=function(){var t;return t=r.parent(),up.syntax.clean(r),r.remove(),u(r,{$parent:t})},o().then(s))},x=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},g=function(t){return t.addClass("up-destroying")},w=function(t,e){var n;return e=A.options(e,{cache:!1}),n=e.url||P(t),k(t,n,e)},up.on("up:app:boot",function(){var e;return e=t(document.body),E(e,up.browser.url()),d(e)}),up.on("up:framework:reset",T),{replace:k,reload:w,destroy:o,extract:l,first:c,source:P,resolveSelector:S,hello:d,config:r}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F,$;return F=up.util,b={},a={},w={},l={},y=new up.MotionTracker("motion"),s=F.config({duration:300,delay:0,easing:"ease",enabled:!0}),S=function(){return y.reset(),b=F.copy(a),w=F.copy(l),s.reset()},d=function(){return s.enabled},r=function(t,n,r){var o,u,s,a;return o=e(t),r=i(r),u=p(n),a=$(o,n,r),a?(s=function(){return u(o,r)},y.claim(o,s,r)):E(o,n)},$=function(t,e,n){return n=i(n),d()&&!m(e)&&n.duration>0&&!v(t)},v=function(t){return t.is("body")},E=function(t,e){return F.isOptions(e)&&F.writeInlineStyle(t,e),Promise.resolve()},n=0,o=function(t,e,n){var r;return n=F.merge(n,{finishEvent:y.finishEvent}),r=new up.CssTransition(t,e,n),r.start()},i=function(){var e,n,r,o,i;return n=1<=arguments.length?t.call(arguments,0):[],i=n.shift()||{},e=F.isJQuery(n[0])?n.shift():F.nullJQuery(),o=F.isObject(n[0])?n.shift():{},r={},r.easing=F.option(i.easing,F.presentAttr(e,"up-easing"),o.easing,s.easing),r.duration=Number(F.option(i.duration,F.presentAttr(e,"up-duration"),o.duration,s.duration)),r.delay=Number(F.option(i.delay,F.presentAttr(e,"up-delay"),o.delay,s.delay)),r.trackMotion=i.trackMotion,r},c=function(t){return b[t]||up.fail("Unknown animation %o",t)},f=function(t){return y.finish(t)},g=function(t,n,r,o){var u,s,a,l,p,c,f,d,m,v,g,b,w,k,T;return o=F.options(o),o=F.assign(o,i(o)),a=e(t),s=e(n),u=a.add(s),k=h(r),T=$(a,k,o),d=F.pluckKey(o,"beforeStart")||F.noop,c=F.pluckKey(o,"afterInsert")||F.noop,f=F.pluckKey(o,"beforeDetach")||F.noop,p=F.pluckKey(o,"afterDetach")||F.noop,d(),g=function(){var t;return t=F.merge(o,{duration:0}),up.layout.revealOrRestoreScroll(s,t)},T?y.isActive(a)&&o.trackMotion===!1?k(a,s,o):(up.puts("Morphing %o to %o with transition %o",a.get(0),s.get(0),r),l=up.layout.viewportOf(a),b=l.scrollTop(),m=up.layout.absolutize(a,{afterMeasure:function(){return s.insertBefore(a),c()}}),w=function(){var t;return t=g(),t=t.then(function(){var t;return t=l.scrollTop(),m.moveTop(t-b),k(a,s,o)}),t=t.then(function(){return f(),a.detach(),m.$bounds.remove(),p()})},y.claim(u,w,o)):(f(),x(a,s),c(),p(),v=g())},h=function(t){var e;return m(t)?void 0:F.isFunction(t)?t:F.isArray(t)?u.apply(null,t):F.isString(t)?t.indexOf("/")>=0?u.apply(null,t.split("/")):(e=w[t])?h(e):void 0:up.fail("Unknown transition %o",t)},u=function(t,e){var n,r;return m(t)&&m(t)?void 0:(r=p(t)||F.asyncNoop,n=p(e)||F.asyncNoop,function(t,e,o){return Promise.all([r(t,o),n(e,o)])})},p=function(t){return m(t)?void 0:F.isFunction(t)?t:F.isString(t)?c(t):F.isOptions(t)?function(e,n){return o(e,t,n)}:up.fail("Unknown animation %o",t)},x=function(t,e){return t.replaceWith(e)},T=function(t,e){return w[t]=h(e)},k=function(t,e){return b[t]=p(e)},C=function(){return a=F.copy(b),l=F.copy(w)},m=function(t){return!t||"none"===t||F.isBlank(t)},k("fade-in",function(t,e){return F.writeInlineStyle(t,{opacity:0}),o(t,{opacity:1},e)}),k("fade-out",function(t,e){return F.writeInlineStyle(t,{opacity:1}),o(t,{opacity:0},e)}),P=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},k("move-to-top",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=n.top+n.height,o(t,P(0,-r),e)}),k("move-from-top",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=n.top+n.height,F.writeInlineStyle(t,P(0,-r)),o(t,P(0,0),e)}),k("move-to-bottom",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=F.clientSize().height-n.top,o(t,P(0,r),e)}),k("move-from-bottom",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=F.clientSize().height-n.top,F.writeInlineStyle(t,P(0,r)),o(t,P(0,0),e)}),k("move-to-left",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=n.left+n.width,o(t,P(-r,0),e)}),k("move-from-left",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=n.left+n.width,F.writeInlineStyle(t,P(-r,0)),o(t,P(0,0),e)}),k("move-to-right",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=F.clientSize().width-n.left,o(t,P(r,0),e)}),k("move-from-right",function(t,e){var n,r;return F.writeInlineStyle(t,P(0,0)),n=F.measure(t),r=F.clientSize().width-n.left,F.writeInlineStyle(t,P(r,0)),o(t,P(0,0),e)}),k("roll-down",function(t,e){var n,o,i;return o=t.height(),i=F.writeTemporaryStyle(t,{height:"0px",overflow:"hidden"}),n=r(t,{height:o+"px"},e),n.then(i),n}),T("move-left",["move-to-left","move-from-right"]),T("move-right",["move-to-right","move-from-left"]),T("move-up",["move-to-top","move-from-bottom"]),T("move-down",["move-to-bottom","move-from-top"]),T("cross-fade",["fade-out","fade-in"]),up.on("up:framework:booted",C),up.on("up:framework:reset",S),{morph:g,animate:r,animateOptions:i,willAnimate:$,finish:f,finishCount:function(){return y.finishCount},transition:T,animation:k,config:s,isEnabled:d,isNone:m}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F,$,A,D,O,R,M,j,q;return j=up.util,n=void 0,S=void 0,D=void 0,b=void 0,O=void 0,C=[],l=j.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return l.cacheSize},expiry:function(){return l.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(S),S=null},s=function(){return clearTimeout(D),D=null},F=function(){return n=null,u(),s(),b=0,l.reset(),i.clear(),O=!1,C=[]},F(),y=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=j.extractOptions(e),j.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||a(),!n&&(o=p(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=v(i),A(i,o),o["catch"](function(t){return P(i)})),r.preload||(g(),j.always(o,m)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},y.apply(null,e).then(r,n)})},h=function(){return 0===b},c=function(){return b>0},g=function(){var t;return b+=1,D?void 0:(t=function(){return c()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},D=j.setTimer(l.slowDelay,t))},m=function(){return b-=1,h()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},v=function(t){return b<l.maxRequests?d(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return d(t)},e=j.previewable(e),C.push(e),e.promise},d=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),j.always(n,$),j.always(n,w),n):(j.microtask(w),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;return n=t.request,t.url&&n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},$=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},w=function(){var t;return void("function"==typeof(t=C.shift())&&t())},o=i.alias,A=i.set,P=i.remove,a=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),T=function(t){var e,r;return r=parseInt(j.presentAttr(t,"up-delay"))||l.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return j.muteRejection(k(t)),n=null},R(e,r))},R=function(t,e){return S=setTimeout(t,e)},M=function(t){return t.is(n)?(n=void 0,u()):void 0},k=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},f=function(t){return j.contains(l.safeMethods,t)},q=function(t,e,n){return j.contains(l.wrapMethods,t)&&(e=j.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.compiler("a[up-preload], [up-href][up-preload]",function(t){return up.link.isSafe(t)?(t.on("mouseenter touchstart",function(e){return up.link.shouldProcessEvent(e,t)?T(t):void 0}),t.on("mouseleave",function(){return M(t)})):void 0}),up.on("up:framework:reset",F),{preload:k,ajax:r,request:y,get:p,alias:o,clear:a,remove:P,isIdle:h,isBusy:c,isSafeMethod:f,wrapMethod:q,config:l}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function(t){var e,n,r,o,i,u,s,a,l,p,c,h,f,d,m;return d=up.util,m=function(t,e){var n;return e=d.options(e),n=d.option(e.target,"body"),up.replace(n,t,e)},u=function(e,n){var r,o;return r=t(e),o=a(r),o.followLink(r,n)},o=function(e,n){var r,o,i;return r=t(e),n=d.options(n),i=d.option(r.attr("up-href"),r.attr("href")),o=d.option(n.target,r.attr("up-target")),n.failTarget=d.option(n.failTarget,r.attr("up-fail-target")),n.fallback=d.option(n.fallback,r.attr("up-fallback")),n.transition=d.option(n.transition,d.castedAttr(r,"up-transition"),"none"),n.failTransition=d.option(n.failTransition,d.castedAttr(r,"up-fail-transition"),"none"),n.history=d.option(n.history,d.castedAttr(r,"up-history")),n.reveal=d.option(n.reveal,d.castedAttr(r,"up-reveal"),!0),n.failReveal=d.option(n.failReveal,d.castedAttr(r,"up-fail-reveal"),!0),n.cache=d.option(n.cache,d.castedAttr(r,"up-cache")),n.restoreScroll=d.option(n.restoreScroll,d.castedAttr(r,"up-restore-scroll")),n.method=s(r,n),n.origin=d.option(n.origin,r),n.layer=d.option(n.layer,r.attr("up-layer"),"auto"),n.failLayer=d.option(n.failLayer,r.attr("up-fail-layer"),"auto"),n.confirm=d.option(n.confirm,r.attr("up-confirm")),n=d.merge(n,up.motion.animateOptions(n,r)),up.browser.whenConfirmed(n).then(function(){return up.replace(o,i,n)})},i=function(t,e){return e=d.options(e),e.preload=!0,o(t,e)},s=function(e,n){var r;return r=t(e),n=d.options(n),d.option(n.method,r.attr("up-method"),r.attr("data-method"),"get").toUpperCase()},r=function(t){},l=[],n=function(t,e){var n;return n=new up.FollowVariant(t,e),l.push(n),n.registerEvents(),n},p=function(t){return!!a(t,{"default":!1})},a=function(n,r){var o,i;return r=d.options(r),o=t(n),i=d.detect(l,function(t){return t.matchesLink(o)}),r["default"]!==!1&&(i||(i=e)),i},h=function(e){var n;return n=t(e),p(n)?void 0:n.attr("up-follow","")},f=function(e,n){var r,o;return o=e.target,d.isUnmodifiedMouseEvent(e)?o===n.get(0)?!0:(r=t(o).closest("a, [up-href], "+up.form.fieldSelector()).not(n),r.length?!1:!0):!1},c=function(e,n){var r,o;return r=t(e),o=s(r,n),up.proxy.isSafeMethod(o)},e=n("[up-target], [up-follow]",{follow:function(t,e){return o(t,e)},preload:function(t,e){return i(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=d.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?h(t):e["up-target"]=n,d.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(e){var n,r,o,i,u,s,a,l,p,c;if(n=e.find("a, [up-href]"),(p=e.attr("up-expand"))&&(n=n.filter(p)),u=n.get(0)){for(c=/^up-/,a={},a["up-href"]=t(u).attr("href"),l=u.attributes,o=0,i=l.length;i>o;o++)r=l[o],s=r.name,s.match(c)&&(a[s]=r.value);return d.setMissingAttrs(e,a),e.removeAttr("up-expand"),h(e)}}),{visit:m,follow:u,makeFollowable:h,isSafe:c,isFollowable:p,shouldProcessEvent:f,followMethod:s,addFollowVariant:n,followVariantForLink:a,allowDefault:r}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var t=[].slice;up.form=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m;return d=up.util,r=d.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),a=function(){return r.reset()},o=function(){return r.fields.join(",")},p=function(t,n){var r,o,i;return r=e(t).closest("form"),n=d.options(n),o=d.option(n.target,r.attr("up-target"),"body"),i=d.option(n.url,r.attr("action"),up.browser.url()),n.failTarget=d.option(n.failTarget,r.attr("up-fail-target"))||d.selectorForElement(r),n.reveal=d.option(n.reveal,d.castedAttr(r,"up-reveal"),!0),n.failReveal=d.option(n.failReveal,d.castedAttr(r,"up-fail-reveal"),!0),n.fallback=d.option(n.fallback,r.attr("up-fallback")),n.history=d.option(n.history,d.castedAttr(r,"up-history"),!0),n.transition=d.option(n.transition,d.castedAttr(r,"up-transition"),"none"),n.failTransition=d.option(n.failTransition,d.castedAttr(r,"up-fail-transition"),"none"),n.method=d.option(n.method,r.attr("up-method"),r.attr("data-method"),r.attr("method"),"post").toUpperCase(),n.headers=d.option(n.headers,{}),n.cache=d.option(n.cache,d.castedAttr(r,"up-cache")),n.restoreScroll=d.option(n.restoreScroll,d.castedAttr(r,"up-restore-scroll")),n.origin=d.option(n.origin,r),n.layer=d.option(n.layer,r.attr("up-layer"),"auto"),n.failLayer=d.option(n.failLayer,r.attr("up-fail-layer"),"auto"),n.data=d.requestDataFromForm(r),n=d.merge(n,up.motion.animateOptions(n,r)),n.validate&&(n.headers||(n.headers={}),n.transition=!1,n.failTransition=!1,n.headers[up.protocol.config.validateHeader]=n.validate),up.bus.whenEmitted("up:form:submit",{$element:r}).then(function(){var t;return up.feedback.start(r),up.browser.canPushState()||n.history===!1?(t=up.replace(o,i,n),d.always(t,function(){return up.feedback.stop(r)}),t):(r.get(0).submit(),d.unresolvablePromise())})},u=function(){var n,i,u,a,l,p,c,h,f,m;return m=arguments[0],c=2<=arguments.length?t.call(arguments,1):[],h={},a=void 0,1===c.length?a=c[0]:c.length>1&&(h=d.options(c[0]),a=c[1]),n=e(m),u=null,f=d.option(a,d.presentAttr(n,"up-observe")),u=d.isString(f)?new Function("value","$field",f):f||up.fail("up.observe: No change callback given"),l=d.option(d.presentAttr(n,"up-delay"),h.delay,r.observeDelay),l=parseInt(l),i=d.selectInSubtree(n,o()),p=d.map(i,function(t){return s(e(t),l,u)}),d.sequence.apply(d,p)},s=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},n=function(t,e){return u(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return p(n)})})},l=function(t,e){var n;return n=d.option(e.target,t.attr("up-validate")),d.isBlank(n)&&(n||(n=d.detect(r.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),d.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),r.validateTargets),d.isString(n)||(n=d.selectorForElement(n)),n},m=function(t,n){var r,o,i;return r=e(t),n=d.options(n),n.origin=r,n.target=l(r,n),n.failTarget=n.target,n.reveal=d.option(n.reveal,d.castedAttr(r,"up-reveal"),!1),n.history=!1,n.headers=d.option(n.headers,{}),n.validate=r.attr("name")||"__none__",n=d.merge(n,up.motion.animateOptions(n,r)),o=r.closest("form"),i=up.submit(o,n)},f=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],d.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),d.isPresent(n)&&o.push(n),o},h=function(t,n){var r,o,i;return r=e(t),n=d.options(n),i=d.option(n.target,r.attr("up-switch")),d.isPresent(i)||up.fail("No switch target given for %o",r.get(0)),o=f(r),e(i).each(function(){return c(e(this),o)})},c=function(t,n){var r,o,u,s;return r=e(t),n||(n=f(i(r))),(o=r.attr("up-hide-for"))?(o=o.split(" "),u=0===d.intersect(n,o).length):(s=(s=r.attr("up-show-for"))?s.split(" "):[":present",":checked"],u=d.intersect(n,s).length>0),r.toggle(u),r.addClass("up-switched")},i=function(t){var n,r;return n=e("[up-switch]"),r=d.detect(n,function(n){var r;return r=e(n).attr("up-switch"),t.is(r)}),r?e(r):d.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),d.muteRejection(p(e))}),up.on("change","[up-validate]",function(t,e){return d.muteRejection(m(e))}),up.compiler("[up-switch]",function(t){return h(t)}),up.on("change","[up-switch]",function(t,e){return h(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return c(t)}),up.compiler("[up-observe]",function(t){return u(t)}),up.compiler("[up-autosubmit]",function(t){return n(t)}),up.compiler("[autofocus]",{batch:!0},function(t){return t.last().focus()}),up.on("up:framework:reset",a),{config:r,submit:p,observe:u,validate:m,switchTargets:h,autosubmit:n,fieldSelector:o}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function(t){var e,n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y;return g=up.util,a=g.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),m=g.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),i=new g.DivertibleChain,d=function(){var t;return null!=(t=m.$popup)&&t.remove(),m.reset(),i.reset(),a.reset()},e=function(){var t,e,n;switch(n={},e=g.measure(m.$popup),g.isFixed(m.$anchor)?(t=m.$anchor.get(0).getBoundingClientRect(),n.position="fixed"):t=g.measure(m.$anchor),m.position){case"bottom-right":n.top=t.top+t.height,n.left=t.left+t.width-e.width;break;case"bottom-left":n.top=t.top+t.height,n.left=t.left;break;case"top-right":n.top=t.top-e.height,n.left=t.left+t.width-e.width;break;case"top-left":n.top=t.top-e.height,n.left=t.left;break;default:up.fail("Unknown position option '%s'",m.position)}return m.$popup.attr("up-position",m.position),g.writeInlineStyle(m.$popup,n)},c=function(){return m.coveredTitle=null,m.coveredUrl=null},p=function(t){var e;return e=g.$createElementFromSelector(".up-popup"),g.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),m.$popup=e},y=function(){return m.$popup.show()},h=function(){return"opened"===m.phase||"opening"===m.phase},n=function(t,e){return i.asap(s,function(){return r(t,e)})},r=function(n,r){var o,i,u,s,l,c,h;return o=t(n),o.length||up.fail("Cannot attach popup to non-existing element %o",n),r=g.options(r),h=g.option(g.pluckKey(r,"url"),o.attr("up-href"),o.attr("href")),s=g.option(g.pluckKey(r,"html")),h||s||up.fail("up.popup.attach() requires either an { url } or { html } option"),c=g.option(g.pluckKey(r,"target"),o.attr("up-popup"))||up.fail("No target selector given for [up-popup]"),l=g.option(r.position,o.attr("up-position"),a.position),r.animation=g.option(r.animation,o.attr("up-animation"),a.openAnimation),r.sticky=g.option(r.sticky,g.castedAttr(o,"up-sticky"),a.sticky),r.history=up.browser.canPushState()?g.option(r.history,g.castedAttr(o,"up-history"),a.history):!1,r.confirm=g.option(r.confirm,o.attr("up-confirm")),r.method=up.link.followMethod(o,r),r.layer="popup",r.failTarget=g.option(r.failTarget,o.attr("up-fail-target")),r.failLayer=g.option(r.failLayer,o.attr("up-fail-layer"),"auto"),r.provideTarget=function(){return p(c)},i=up.motion.animateOptions(r,o,{duration:a.openDuration,easing:a.openEasing}),u=g.merge(r,{animation:!1}),r.preload&&h?up.replace(c,h,r):up.browser.whenConfirmed(r).then(function(){return up.bus.whenEmitted("up:popup:open",{url:h,message:"Opening popup"}).then(function(){var t;return m.phase="opening",m.$anchor=o,m.position=l,r.history&&(m.coveredUrl=up.browser.url(),m.coveredTitle=document.title),m.sticky=r.sticky,t=s?up.extract(c,s,u):up.replace(c,h,u),t=t.then(function(){return e(),y(),up.animate(m.$popup,r.animation,i)}),t=t.then(function(){return m.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},u=function(t){return i.asap(function(){return s(t)})},s=function(t){var e;return h()?(t=g.options(t,{animation:a.closeAnimation,history:m.coveredUrl,title:m.coveredTitle}),e=up.motion.animateOptions(t,{duration:a.closeDuration,easing:a.closeEasing}),g.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:m.$popup}).then(function(){return m.phase="closing",m.url=null,m.coveredUrl=null,m.coveredTitle=null,up.destroy(m.$popup,t).then(function(){return m.phase="closed",m.$popup=null,m.$anchor=null,m.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},f=function(t,e){return e=g.options(e),e.preload=!0,r(t,e)},v=function(t,e){return g.hasClass(t,"up-current")?u():n(t,e)},o=function(){return m.sticky?void 0:(c(),u())},l=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return v(t,e)},preload:function(t,e){return f(t,e)}}),up.on("click up:action:consumed",function(e){var n;return n=t(e.target),n.closest(".up-popup, [up-popup]").length?void 0:g.muteRejection(u())}),up.on("up:fragment:inserted",function(t,e){var n;if(l(e)){if(n=e.attr("up-source"))return m.url=n}else if(t.origin&&l(t.origin))return g.muteRejection(o())}),up.bus.onEscape(function(){return g.muteRejection(u())}),up.on("click",".up-popup [up-close]",function(t,e){return g.muteRejection(u()),up.bus.consumeAction(t)}),up.on("up:history:restore",function(){return g.muteRejection(u())}),up.on("up:framework:reset",d),{attach:n,close:u,url:function(){return m.url},coveredUrl:function(){return m.coveredUrl},config:a,contains:l,isOpen:h}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k,T,S,E,C,x,P,F;return C=up.util,u=C.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),d=C.openConfig({"default":{}}),S=C.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),r=new C.DivertibleChain,k=function(){var t;return null!=(t=S.$modal)&&t.remove(),x(),S.reset(),r.reset(),u.reset(),d.reset()},E=function(){var t;return t=h("template"),C.evalOption(t,{closeLabel:h("closeLabel")})},l=function(){return S.coveredTitle=null,S.coveredUrl=null},a=function(e,n){var r,o,i,u;return i=t(E()),i.attr("up-flavor",S.flavor),C.isPresent(S.position)&&i.attr("up-position",S.position),o=i.find(".up-modal-dialog"),u=C.only(n,"width","maxWidth","height"),C.writeInlineStyle(o,u),S.closable||i.find(".up-modal-close").remove(),r=i.find(".up-modal-content"),C.$createPlaceholder(e,r),i.hide(),i.appendTo(document.body),S.$modal=i},P=function(){return S.$modal.show()},T=function(){var e,n,r,o,i;return C.documentHasVerticalScrollbar()?(e=t("body"),o=C.scrollbarWidth(),n=C.readComputedStyleNumber(e,"paddingRight"),r=o+n,i=C.writeTemporaryStyle(e,{paddingRight:r,overflowY:"hidden"}),S.unshifters.push(i),up.layout.anchoredRight().each(function(){var e,n,r,i;return e=t(this),n=C.readComputedStyleNumber(e,"right"),r=o+n,i=C.writeTemporaryStyle(e,{right:r}),S.unshifters.push(i)})):void 0},x=function(){var t,e;for(t=[];e=S.unshifters.pop();)t.push(e());return t},v=function(){return"opened"===S.phase||"opening"===S.phase},m=function(e,n){return n=C.options(n),n.$link=t(e),y(n)},w=function(t,e){return e=C.options(e),e.$link=t,e.preload=!0,b(e)},F=function(t,e){return e=C.options(e),e.url=t,y(e)},p=function(t,e,n){return n=C.options(n),n.html=e,n.history=C.option(n.history,!1),n.target=t,y(n)},y=function(t){return r.asap(i,function(){return b(t)})},b=function(t){var n,r,o,i,s;return t=C.options(t),n=C.option(C.pluckKey(t,"$link"),C.nullJQuery()),s=C.option(C.pluckKey(t,"url"),n.attr("up-href"),n.attr("href")),o=C.option(C.pluckKey(t,"html")),i=C.option(C.pluckKey(t,"target"),n.attr("up-modal"),"body"),t.flavor=C.option(t.flavor,n.attr("up-flavor"),u.flavor),t.position=C.option(t.position,n.attr("up-position"),h("position",t.flavor)),t.position=C.evalOption(t.position,{$link:n}),t.width=C.option(t.width,n.attr("up-width"),h("width",t.flavor)),t.maxWidth=C.option(t.maxWidth,n.attr("up-max-width"),h("maxWidth",t.flavor)),t.height=C.option(t.height,n.attr("up-height"),h("height")),t.animation=C.option(t.animation,n.attr("up-animation"),h("openAnimation",t.flavor)),t.animation=C.evalOption(t.animation,{position:t.position}),t.backdropAnimation=C.option(t.backdropAnimation,n.attr("up-backdrop-animation"),h("backdropOpenAnimation",t.flavor)),t.backdropAnimation=C.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=C.option(t.sticky,C.castedAttr(n,"up-sticky"),h("sticky",t.flavor)),t.closable=C.option(t.closable,C.castedAttr(n,"up-closable"),h("closable",t.flavor)),t.confirm=C.option(t.confirm,n.attr("up-confirm")),t.method=up.link.followMethod(n,t),t.layer="modal",t.failTarget=C.option(t.failTarget,n.attr("up-fail-target")),t.failLayer=C.option(t.failLayer,n.attr("up-fail-layer"),"auto"),r=up.motion.animateOptions(t,n,{duration:h("openDuration",t.flavor),easing:h("openEasing",t.flavor)}),t.history=C.option(t.history,C.castedAttr(n,"up-history"),h("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return a(i,t)},t.preload?up.replace(i,s,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:s,message:"Opening modal"}).then(function(){var n,u;return S.phase="opening",S.flavor=t.flavor,S.sticky=t.sticky,S.closable=t.closable,S.position=t.position,t.history&&(S.coveredUrl=up.browser.url(),S.coveredTitle=document.title),n=C.merge(t,{animation:!1}),u=o?up.extract(i,o,n):up.replace(i,s,n),u=u.then(function(){return T(),P(),e(t.animation,t.backdropAnimation,r)}),u=u.then(function(){return S.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},o=function(t){return r.asap(function(){return i(t)})},i=function(t){var n,r,o,i;return t=C.options(t),v()?(i=C.option(t.animation,h("closeAnimation")),i=C.evalOption(i,{position:S.position}),r=C.option(t.backdropAnimation,h("backdropCloseAnimation")),r=C.evalOption(r,{position:S.position}),n=up.motion.animateOptions(t,{duration:h("closeDuration"),easing:h("closeEasing")}),o=C.options(C.except(t,"animation","duration","easing","delay"),{history:S.coveredUrl,title:S.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:S.$modal,message:"Closing modal"}).then(function(){var t;return S.phase="closing",S.url=null,S.coveredUrl=null,S.coveredTitle=null,t=e(i,r,n),t=t.then(function(){return up.destroy(S.$modal,o)}),t=t.then(function(){return x(),S.phase="closed",S.$modal=null,S.flavor=null,S.sticky=null,S.closable=null,S.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},g=function(t){return null==t&&(t=!0),S.$modal.toggleClass("up-modal-animating",t)},e=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(g(),r=Promise.all([up.animate(S.$modal.find(".up-modal-viewport"),t,n),up.animate(S.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return g(!1)}))},n=function(){return S.sticky?void 0:(l(),o())},s=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},c=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),C.assign(f(t),e)},f=function(t){return d[t]||(d[t]={})},h=function(t,e){var n;return null==e&&(e=S.flavor),e&&(n=f(e)[t]),C.isMissing(n)&&(n=u[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return m(t,e)},preload:function(t,e){return w(t,e)}}),up.on("click",".up-modal",function(e){var n;if(S.closable)return n=t(e.target),n.closest(".up-modal-dialog").length||n.closest("[up-modal]").length?void 0:(up.bus.consumeAction(e),
4
- C.muteRejection(o()))}),up.on("up:fragment:inserted",function(t,e){var r;if(s(e)){if(r=e.attr("up-source"))return S.url=r}else if(t.origin&&s(t.origin)&&!up.popup.contains(e))return C.muteRejection(n())}),up.bus.onEscape(function(){return S.closable?C.muteRejection(o()):void 0}),up.on("click",".up-modal [up-close]",function(t,e){return C.muteRejection(o()),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),d.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return C.isPresent(t.$link)?C.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",function(){return C.muteRejection(o())}),up.on("up:framework:reset",k),{visit:F,follow:m,extract:p,close:o,url:function(){return S.url},coveredUrl:function(){return S.coveredUrl},config:u,flavors:d,contains:s,isOpen:v,flavor:c}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,p,c,h;return h=up.util,s=h.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),c=h.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new h.DivertibleChain,p=function(){var t;return null!=(t=c.$tooltip)&&t.remove(),c.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(e={},n=h.measure(c.$tooltip),h.isFixed(c.$anchor)?(t=c.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=h.measure(c.$anchor),c.position){case"top":e.top=t.top-n.height,e.left=t.left+.5*(t.width-n.width);break;case"left":e.top=t.top+.5*(t.height-n.height),e.left=t.left-n.width;break;case"right":e.top=t.top+.5*(t.height-n.height),e.left=t.left+t.width;break;case"bottom":e.top=t.top+t.height,e.left=t.left+.5*(t.width-n.width);break;default:up.fail("Unknown position option '%s'",c.position)}return c.$tooltip.attr("up-position",c.position),h.writeInlineStyle(c.$tooltip,e)},a=function(t){var e;return e=h.$createElementFromSelector(".up-tooltip"),h.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),c.$tooltip=e},n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,p,f;return o=t(n),r=h.options(r),l=h.option(r.html,o.attr("up-tooltip-html")),f=h.option(r.text,o.attr("up-tooltip")),p=h.option(r.position,o.attr("up-position"),s.position),u=h.option(r.animation,h.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),c.phase="opening",c.$anchor=o,a({text:f,html:l}),c.position=p,e(),up.animate(c.$tooltip,u,i).then(function(){return c.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=h.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),h.assign(t,e),c.phase="closing",up.destroy(c.$tooltip,t).then(function(){return c.phase="closed",c.$tooltip=null,c.$anchor=null})):Promise.resolve()},l=function(){return"opening"===c.phase||"opened"===c.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(t){return i()}),up.on("up:framework:reset",p),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,p,c,h,f,d,m,v,g,y,b,w,k;return g=up.util,s=g.config({currentClasses:["up-current"],navs:["[up-nav]"]}),h=void 0,a=void 0,f=function(){return s.reset(),h=void 0,a=void 0},n="up-active",o="a, [up-href]",p=function(){return s.navs.join(",")},c=function(t){return g.isPresent(t)?g.normalizeUrl(t,{stripTrailingSlash:!0}):void 0},r="up-normalized-urls",d=function(t){var e;return(e=t.data(r))||(e=u(t),t.data(r,e)),e},u=function(t){var e,n,r,o,i,u,s,a,l,p;if(l=[],up.link.isSafe(t))for(u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(e=u[n],p=g.presentAttr(t,e))for(s=p.split(/\s+/),r=0,i=s.length;i>r;r++)a=s[r],"#"!==a&&(a=c(a),l.push(a));return l},i=function(){var t;return t=[up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()],new up.UrlSet(t,{normalizeUrl:c})},b=function(){return h=a,a=i(),a.isEqual(h)?void 0:y(e("body"))},y=function(t){var e,n;return e=g.selectInSubtree(t,p()),n=g.selectInSubtree(e,o),w(n)},k=function(t){var e;return t.closest(p()).length?(e=g.selectInSubtree(t,o),w(e)):y(t)},w=function(t){return a||(a=i()),g.each(t,function(t){var n,r,o,i,u,l,p,c,h,f,m,v;if(n=e(t),v=d(n),r=t.classList,a.matchesAny(v)){for(c=s.currentClasses,f=[],o=0,l=c.length;l>o;o++)u=c[o],f.push(r.add(u));return f}for(h=s.currentClasses,m=[],i=0,p=h.length;p>i;i++)u=h[i],m.push(r.remove(u));return m})},l=function(t){var n;return n=e(t),n.is(o)&&(n=g.presence(n.parent(o))||n),n},m=function(){var e,r,o,i,u,s;return o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),u=g.options(o[0]),e=l(i),u.preload||e.addClass(n),r?(s=r(),g.isPromise(s)?g.always(s,function(){return v(e)}):up.warn("Expected block to return a promise, but got %o",s),s):void 0},v=function(t){var e;return e=l(t),e.removeClass(n)},up.on("up:history:pushed up:history:replaced up:history:restored up:modal:opened up:modal:closed up:popup:opened up:popup:closed",function(t){return b()}),up.on("up:fragment:inserted",function(t,e){return k(e)}),up.on("up:framework:reset",f),{config:s,start:m,stop:v}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.radio=function(t){var e,n,r,o;return o=up.util,e=o.config({hungry:["[up-hungry]"],hungryTransition:null}),r=function(){return e.reset()},n=function(){return e.hungry.join(",")},up.on("up:framework:reset",r),{config:e,hungrySelector:n}}(jQuery)}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;return e()&&up.link.isFollowable(t)?(i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)):void 0})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
1
+ (function(){window.up={version:"0.57.0",deprecateRenamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.warn("Deprecated: up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F,$,A,O,R,j,D,M,U,_,N,q,L,z,H,I,K,V,B,Q,W,X,J,G,Y,Z,tt,et,nt,rt,ot,it,ut,st,at,lt,pt,ct,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,Tt,St,Et,Pt,xt,Ct,Ft,$t,At,Ot,Rt,jt,Dt,Mt,Ut,_t,Nt,qt,Lt,zt,Ht,It,Kt,Vt,Bt,Qt,Wt,Xt,Jt,Gt,Yt,Zt,te,ee,ne,re,oe,ie,ue,se,ae,le,pe,ce,fe,he,de,me,ve,ge,ye,be,we,ke,Te,Se,Ee,Pe,xe,Ce,Fe,$e,Ae,Oe,Re,je,De,Me,Ue,_e,Ne,qe,Le,ze,He,Ie,Ke,Ve,Be;return Yt=function(){},y=function(){return Promise.resolve()},It=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},$t=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},ee=function(t,e){var n,r,o;return r=le(t),n=r.protocol+"//"+r.hostname,$t(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.search:void 0)!==!1&&(n+=r.search),(null!=e?e.hash:void 0)===!0&&(n+=r.hash),n},ct=function(t){var e;return e=le(location.href),t=le(t),e.protocol!==t.protocol||e.host!==t.host},le=function(t){var e;return wt(t)&&(t=Z(t)),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),at(e.hostname)&&(e.href=e.href),e)},Zt=function(t){return t?t.toUpperCase():"GET"},Vt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,p,c,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,c=f=0,d=v.length;f<d;c=++f){for(s=v[c],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;h<m;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===c&&(o=e),n=e}return o},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},Fe=function(t){var e,n,o,i,u,s,a,l,p,c;if(e=r(t),p=void 0,Ft(e))p=z(e);else if(c=fe(e.attr("up-id")))p=b("up-id",c);else if(i=fe(e.attr("id")))p=i.match(/^[a-z0-9\-_]+$/i)?"#"+i:b("id",i);else if(l=fe(e.attr("name")))p=z(e)+b("name",l);else if(o=fe(Gt(e)))for(p="",u=0,a=o.length;u<a;u++)s=o[u],p+="."+s;else p=(n=fe(e.attr("aria-label")))?b("aria-label",n):z(e);return p},Ft=function(t){return t.is("html, body, head, title")},z=function(t){return t.prop("tagName").toLowerCase()},b=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},Gt=function(t){var e,n;return e=t.attr("class")||"",n=je(e),be(n,function(t){return t.match(/^up-/)})},j=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},g=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;n<o;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},v=Object.assign||g,Ie=function(t){var e,n,r;n=[];for(e in t)r=t[e],n.push(r);return n},re=Object.values||Ie,Ne=r.trim,qt=function(t){return At(t)?function(e){return e[t]}:t},Lt=function(t,e){var n,r,o,i,u;if(0===t.length)return[];for(e=qt(e),u=[],n=o=0,i=t.length;o<i;n=++o)r=t[n],u.push(e(r,n));return u},q=Lt,L=function(t,e){var n,r;for(r=[];(n=t.next())&&!n.done;)r.push(e(n.value));return r},Ue=function(t,e){var n,r,o,i;for(i=[],n=r=0,o=t-1;0<=o?r<=o:r>=o;n=0<=o?++r:--r)i.push(e(n));return i},Tt=function(t){return null===t},Rt=function(t){return void 0===t},ft=function(t){return!Rt(t)},kt=function(t){return Rt(t)||Tt(t)},bt=function(t){return!kt(t)},at=function(t){return!!kt(t)||!yt(t)&&(!(!Et(t)||0!==Object.keys(t).length)||0===t.length)},fe=function(t,e){return null==e&&(e=xt),e(t)?t:void 0},xt=function(t){return!at(t)},yt=function(t){return"function"==typeof t},At=function(t){return"string"==typeof t||t instanceof String},pt=function(t){return"boolean"==typeof t||t instanceof Boolean},St=function(t){return"number"==typeof t||t instanceof Number},Pt=function(t){return"object"==typeof t&&!Tt(t)&&(Rt(t.constructor)||t.constructor===Object)},Et=function(t){var e;return e=typeof t,"object"===e&&!Tt(t)||"function"===e},dt=function(t){return!(!t||1!==t.nodeType)},wt=function(t){return t instanceof jQuery},Ct=function(t){return Et(t)&&yt(t.then)},ut=Array.isArray,gt=function(t){return t instanceof FormData},_e=function(t){return Array.prototype.slice.call(t)},A=function(t){return ut(t)?t=t.slice():Pt(t)&&(t=v({},t)),t},Z=function(t){return wt(t)?t.get(0):At(t)?r(t).get(0):t},Kt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],v.apply(null,[{}].concat(t.call(e)))},Xt=function(t,e){return e?Kt(e,t):t?A(t):{}},ae=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],_(e,bt)},_=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;r<o;r++)if(n=t[r],e(n)){i=n;break}return i},d=function(t,e){var n,r,o,i,u;for(e=qt(e),u=!1,r=o=0,i=t.length;o<i;r=++o)if(n=t[r],e(n,r)){u=!0;break}return u},f=function(t,e){var n,r,o,i,u;for(e=qt(e),u=!0,r=o=0,i=t.length;o<i;r=++o)if(n=t[r],!e(n,r)){u=!1;break}return u},P=function(t){return Pe(t,bt)},qe=function(t){return t.length<2?t:Re(m(t))},Le=function(t,e){var n;return t.length<2?t:(e=qt(e),n=new Set,Pe(t,function(t,r){var o;return o=e(t,r),!n.has(o)&&(n.add(o),!0)}))},Re=function(t){var e;return e=[],t.forEach(function(t){return e.push(t)}),e},m=function(t){var e;return e=new Set,t.forEach(function(t){return e.add(t)}),e},Pe=function(t,e){var n;return e=qt(e),n=[],q(t,function(t,r){if(e(t,r))return n.push(t)}),n},be=function(t,e){return e=qt(e),Pe(t,function(t,n){return!e(t,n)})},it=function(t,e){return Pe(t,function(t){return F(e,t)})},p=function(t,e){return S(t,e,"add")},Te=function(t,e){return S(t,e,"remove")},S=function(t,e,n){var r;return r=Z(t).classList,ut(e)?q(e,function(t){return r[n](t)}):r[n](e)},c=function(t,e){return p(t,e),function(){return Te(t,e)}},tt=function(t,e){var n;return n=Z(t).classList,n.contains(e)},he=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;t<o;t++)n=r[t],i.push(e.attr(n));return i}(),_(o,xt)},Oe=function(t,e){return setTimeout(e,t)},Jt=function(t){return setTimeout(t,0)},Bt=function(t){return Promise.resolve().then(t)},Nt=function(t){return t[t.length-1]},E=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Ee=It(function(){var t,e,n;return t=r("<div>"),e=t.get(0),t.attr("up-viewport",""),Ve(e,{position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),n=e.offsetWidth-e.clientWidth,t.remove(),n}),N=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=ve(t,"overflowY"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Be=function(t,e,n){var o,i,u;return o=r(t),i=ye(o,Object.keys(e)),u=function(){return Ve(o,i)},Ve(o,e),n?(n(),u()):u},Y=function(t){return t=Z(t),t.offsetHeight},x=function(t){var e;return e=Be(t,{transition:"none"}),Y(t),e},zt=function(t){var e;return e=Z(t),{top:ge(e,"marginTop"),right:ge(e,"marginRight"),bottom:ge(e,"marginBottom"),left:ge(e,"marginLeft")}},Ht=function(t,e){var n,o,i,u,s,a;return e=Xt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=zt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},O=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;r<o;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},Ce=function(t,e){var n;return n=r(),t.is(e)&&(n=n.add(t)),n=n.add(t.find(e))},xe=function(t,e){var n,r;return r=Ce(t,e),n=t.parents(e),r.add(n)},I=function(t){return 27===t.keyCode},F=function(t,e){return t.indexOf(e)>=0},T=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Mt=function(t,e){var n,r;if((n=Z(t))&&(r="function"==typeof n.getAttribute?n.getAttribute(e):void 0,At(r)&&""!==Ne(r)))return JSON.parse(r)},ie=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;n<r;n++)u=i[n],u in o&&(e[u]=o[u]);return e},V=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=A(o),n=0,r=i.length;n<r;n++)u=i[n],delete e[u];return e},jt=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},Dt=function(t){var e;return e=Rt(t.button)||0===t.button,e&&jt(t)},ze=function(){return new Promise(Yt)},ne=function(){return r()},Ae=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],kt(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},ke=function(t,e){var n;if(n=t.indexOf(e),n>=0)return t.splice(n,1),e},K=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],yt(n)?n.apply(null,e):n},C=function(t){var e;return e=se(t),Object.preventExtensions(e),e},se=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,yt(n)&&(n=n()),v(e,n)},e.reset(),e},He=function(t){var e,n;return t=Z(t),e=t.parentNode,n=_e(t.childNodes),q(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},oe=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=ve(t,"position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},vt=function(t){var e,n;for(e=r(t);;){if(n=ve(e,"position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},X=function(t,e){var n,o,i,u;return n=r(t),o=oe(n),i=n.position(),u=o.offset(),Ve(n,{position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},W=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],ut(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),Ke().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},H=function(t){return t.replace(/[&<>"]/g,function(t){return l[t]})},ce=function(t,e){var n;return n=t[e],delete t[e],n},Se=function(t,e,n){return t[n]=ce(t,e)},M=function(t,e,n){if(ft(t[e]))return up.warn("Deprecated: Object key { %s } has been renamed to { %s } (found in %o)",e,n,t),Se(t,e,n)},pe=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},Q=function(t){var e;return e=Nt(t),Pt(e)?t.pop():{}},u=/[^\-\_]+?(?=[A-Z\-\_]|$)/g,$=function(t,e,n){var r;return r=t.match(u),r=Lt(r,n),r.join(e)},Ut=function(t){return $(t,"-",function(t){return t.toLowerCase()})},w=function(t){return $(t,"",function(t,e){return 0===e?t.toLowerCase():t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})},_t=function(t){return R(t,Ut)},k=function(t){return R(t,w)},R=function(t,e){var n,r,o;r={};for(n in t)o=t[n],n=e(n),r[n]=o;return r},ue=function(t){return ge(t,"opacity")},Ke=It(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),ot=function(t){return t},ht=function(t){return t=Z(t),!r.contains(document.documentElement,t)},de=function(e){var n,r;return n=Wt(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},a=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=Nt(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;if(!this.currentTask&&(this.currentTask=this.queue.shift()))return t=this.currentTask(),h(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=Lt(e,de),this.poke(),this.promise()},e}(),De=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},$e=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return Lt(e,function(t){return t()})}},me=function(t){var e,n;return n=void 0,e=new Promise(function(e){return n=Oe(t,e)}),e.cancel=function(){return clearTimeout(n)},e},rt=function(t){var e,n,r,o;return e=Ht(t),r=E(),n=e.left+.5*e.width,o=.5*r.width,n<o?"left":"right"},U=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},nt=function(t){return Ve(t,{display:"none"})},ve=function(t,e){var n;return t=Z(t),n=window.getComputedStyle(t),B(n,e)},ge=function(t,e){var n;return n=ve(t,e),bt(n)?parseFloat(n):void 0},ye=function(t,e){var n;return t=Z(t),n=t.style,B(n,e)},B=function(e,n){return At(n)?e[n]:ie.apply(null,[e].concat(t.call(n)))},Ve=function(t,e){var n,r,o,i;t=Z(t),o=t.style,r=[];for(n in e)i=e[n],i=te(n,i),r.push(o[n]=i);return r},te=function(t,e){return kt(e)?e="":s.has(t)&&(e=D(e)),e},s=m(["top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","width","height","maxWidth","maxHeight","minWidth","minHeight"]),D=function(t){return St(t)||At(t)&&/^\d+$/.test(t)?t.toString()+"px":t},et=function(t){var e,n,r,o,i;return Pt(t)?i=t:(n=Z(n),i=getComputedStyle(n)),o=i.transitionProperty,e=i.transitionDuration,r="none"===o||"all"===o&&0===e,!r},G=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;n<r;n++)o=t[n],ut(o)?e=e.concat(o):e.push(o);return e},J=function(t,e){return G(Lt(t,e))},Ot=function(t){return!!t},h=function(t,e){return t.then(e,e)},Qt=function(t){return null!=t?t["catch"](Yt):void 0},Wt=function(){var t,e,n;return n=void 0,e=void 0,t=new Promise(function(t,r){return n=t,e=r}),t.resolve=n,t.reject=e,t.promise=function(){return t},t},we=function(t){var e;try{return t()}catch(t){return e=t,Promise.reject(e)}},Me=function(t,e){var n,r,o,i,u;for(e=qt(e),u=0,o=0,i=t.length;o<i;o++)n=t[o],r=e(n),bt(r)&&(u+=r);return u},lt=function(t){return r(t).parents("body").length>0},st=function(t){return Object.prototype.hasOwnProperty(t)},mt=function(t,e){return typeof t==typeof e&&(ut(t)?t.length===e.length&&f(t,function(t,n){return mt(t,e[n])}):Et(t)?W("isEqual cannot compare objects yet"):t===e)},je=function(t,e){var n;return null==e&&(e=" "),n=t.split(e),n=Lt(n,Ne),n=Pe(n,xt)},{offsetParent:oe,fixedToAbsolute:X,isFixed:vt,presentAttr:he,parseUrl:le,normalizeUrl:ee,normalizeMethod:Zt,methodAllowsPayload:Vt,createElementFromHtml:j,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:Fe,attributeSelector:b,assign:v,assignPolyfill:g,copy:A,merge:Kt,options:Xt,option:ae,fail:W,each:q,eachIterator:L,map:Lt,flatMap:J,times:Ue,any:d,all:f,detect:_,select:Pe,reject:be,intersect:it,compact:P,uniq:qe,uniqBy:Le,last:Nt,isNull:Tt,isDefined:ft,isUndefined:Rt,isGiven:bt,isMissing:kt,isPresent:xt,isBlank:at,presence:fe,isObject:Et,isFunction:yt,isString:At,isBoolean:pt,isNumber:St,isElement:dt,isJQuery:wt,isPromise:Ct,isOptions:Pt,isArray:ut,isFormData:gt,isUnmodifiedKeyEvent:jt,isUnmodifiedMouseEvent:Dt,nullJQuery:ne,element:Z,setTimer:Oe,nextFrame:Jt,measure:Ht,addClass:p,removeClass:Te,hasClass:tt,addTemporaryClass:c,writeTemporaryStyle:Be,forceRepaint:Y,concludeCssTransition:x,escapePressed:I,copyAttributes:O,selectInSubtree:Ce,selectInDynasty:xe,contains:F,toArray:_e,castedAttr:T,jsonAttr:Mt,clientSize:E,only:ie,except:V,trim:Ne,unresolvablePromise:ze,setMissingAttrs:Ae,remove:ke,memoize:It,scrollbarWidth:Ee,documentHasVerticalScrollbar:N,config:C,openConfig:se,unwrapElement:He,camelCase:w,camelCaseKeys:k,kebabCase:Ut,kebabCaseKeys:_t,error:W,pluckData:pe,pluckKey:ce,renameKey:Se,deprecateRenamedKey:M,extractOptions:Q,isDetached:ht,noop:Yt,asyncNoop:y,opacity:ue,whenReady:Ke,identity:ot,escapeHtml:H,DivertibleChain:a,submittedValue:De,sequence:$e,promiseTimer:me,previewable:de,evalOption:K,horizontalScreenHalf:rt,detachWith:U,flatten:G,isTruthy:Ot,isSingletonElement:Ft,newDeferred:Wt,always:h,muteRejection:Qt,rejectOnError:we,isBodyDescendant:lt,isBasicObjectProperty:st,isCrossDomain:ct,microtask:Bt,isEqual:mt,hide:nt,cssLength:D,readComputedStyle:ve,readComputedStyleNumber:ge,readInlineStyle:ye,writeInlineStyle:Ve,hasCssTransition:et,splitValues:je,sum:Me,values:re}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store=this.config.store||new up.store.Memory}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):t.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return!this.config.cachable||this.config.cachable(t)},r.prototype.clear=function(){return this.store.clear()},r.prototype.log=function(){var t;if(t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix)return t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)},r.prototype.keys=function(){return this.store.keys()},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;if(o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=void 0,r=void 0,t.each(o,function(t){return function(e){var o,i;if(o=t.store.get(e),i=o.timestamp,!r||r>i)return n=e,r=i}}(this)),n))return this.store.remove(n)},r.prototype.alias=function(e,n){var r;if(r=this.get(e,{silent:!0}),t.isDefined(r))return this.set(n,r)},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n,r;if(this.isEnabled()&&this.isCachable(t))return this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),r={timestamp:this.timestamp(),value:e},this.store.set(n,r)},r.prototype.remove=function(t){var e;if(this.isCachable(t))return e=this.normalizeStoreKey(t),this.store.remove(e)},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),!e||(n=this.timestamp()-t.timestamp,n<e)},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store.get(this.normalizeStoreKey(t)))?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t;t=up.util,up.CompilePass=function(){function e(t,e,n){this.$root=t,this.compilers=e,null==n&&(n={}),this.root=this.$root[0],this.$skipSubtrees=$(n.skip),this.$skipSubtrees.length&&this.root.querySelector("[up-keep]")||(this.$skipSubtrees=void 0)}return e.prototype.compile=function(){return up.log.group("Compiling fragment %o",this.root,function(t){return function(){var e,n,r,o,i;for(o=t.compilers,i=[],n=0,r=o.length;n<r;n++)e=o[n],i.push(t.runCompiler(e));return i}}(this))},e.prototype.runCompiler=function(e){var n;if(n=this.$select(e.selector),n.length)return up.log.group(e.isSystem?void 0:"Compiling '%s' on %d element(s)",e.selector,n.length,function(r){return function(){var o,i,u,s,a;if(e.batch)r.compileBatch(e,n);else for(o=0,u=n.length;o<u;o++)s=n[o],r.compileOneElement(e,$(s));if(i=e.keep)return a=t.isString(i)?i:"",n.attr("up-keep",a)}}(this))},e.prototype.compileOneElement=function(t,e){var n,r,o,i;if(n=[e],1!==t.length&&(r=up.syntax.data(e),n.push(r)),i=t.apply(e[0],n),o=this.normalizeDestructor(i))return up.syntax.destructor(e,o)},e.prototype.compileBatch=function(e,n){var r,o,i;if(r=[n],1!==e.length&&(o=t.map(n,up.syntax.data),r.push(o)),i=e.apply(n.get(),r),this.normalizeDestructor(i))return up.fail("Compilers with { batch: true } cannot return destructors")},e.prototype.normalizeDestructor=function(e){return t.isFunction(e)?e:t.isArray(e)&&t.all(e,t.isFunction)?(up.warn("up.compiler(): Returning an array of destructor functions is deprecated. Return a single function instead."),t.sequence.apply(t,e)):void 0},e.prototype.$select=function(e){var n,r;return t.isFunction(e)&&(e=e()),n=t.selectInSubtree(this.$root,e),(r=this.$skipSubtrees)&&(n=n.filter(function(){var t;return t=$(this),0===t.closest(r).length})),n},e}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.CssTransition=function(){function n(n,r,o){this.startMotion=e(this.startMotion,this),this.resumeOldTransition=e(this.resumeOldTransition,this),this.pauseOldTransition=e(this.pauseOldTransition,this),this.finish=e(this.finish,this),this.onTransitionEnd=e(this.onTransitionEnd,this),this.stopListenToTransitionEnd=e(this.stopListenToTransitionEnd,this),this.listenToTransitionEnd=e(this.listenToTransitionEnd,this),this.stopFallbackTimer=e(this.stopFallbackTimer,this),this.startFallbackTimer=e(this.startFallbackTimer,this),this.onFinishEvent=e(this.onFinishEvent,this),this.stopListenToFinishEvent=e(this.stopListenToFinishEvent,this),this.listenToFinishEvent=e(this.listenToFinishEvent,this),this.start=e(this.start,this),this.$element=n,this.element=t.element(n),this.lastFrameCamel=t.camelCaseKeys(r),this.lastFrameKebab=t.kebabCaseKeys(r),this.lastFrameKeysKebab=Object.keys(this.lastFrameKebab),this.finishEvent=o.finishEvent,this.duration=o.duration,this.delay=o.delay,this.totalDuration=this.delay+this.duration,this.easing=o.easing,this.finished=!1}return n.prototype.start=function(){return 0===this.lastFrameKeysKebab.length?(this.finished=!0,Promise.resolve()):(this.deferred=t.newDeferred(),this.pauseOldTransition(),this.startTime=new Date,this.startFallbackTimer(),this.listenToFinishEvent(),this.listenToTransitionEnd(),this.startMotion(),this.deferred.promise())},n.prototype.listenToFinishEvent=function(){if(this.finishEvent)return this.$element.on(this.finishEvent,this.onFinishEvent)},n.prototype.stopListenToFinishEvent=function(){if(this.finishEvent)return this.$element.off(this.finishEvent,this.onFinishEvent)},n.prototype.onFinishEvent=function(t){return t.stopPropagation(),this.finish()},n.prototype.startFallbackTimer=function(){var e;return e=100,this.fallbackTimer=t.setTimer(this.totalDuration+e,function(t){return function(){return t.finish()}}(this))},n.prototype.stopFallbackTimer=function(){return clearTimeout(this.fallbackTimer)},n.prototype.listenToTransitionEnd=function(){return this.$element.on("transitionend",this.onTransitionEnd)},n.prototype.stopListenToTransitionEnd=function(){return this.$element.off("transitionend",this.onTransitionEnd)},n.prototype.onTransitionEnd=function(e){var n,r;if(e.target===this.element&&(r=new Date-this.startTime,r>.25*this.totalDuration&&(n=e.originalEvent.propertyName,t.contains(this.lastFrameKeysKebab,n))))return this.finish()},n.prototype.finish=function(){if(!this.finished)return this.finished=!0,this.stopFallbackTimer(),this.stopListenToFinishEvent(),this.stopListenToTransitionEnd(),t.concludeCssTransition(this.element),this.resumeOldTransition(),this.deferred.resolve()},n.prototype.pauseOldTransition=function(){var e,n,r,o;if(e=t.readComputedStyle(this.element,["transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction"]),t.hasCssTransition(e))return"all"!==e.transitionProperty&&(o=e.transitionProperty.split(/\s*,\s*/),r=t.readComputedStyle(this.element,o),n=t.camelCaseKeys(r),this.setOldTransitionTargetFrame=t.writeTemporaryStyle(this.element,n)),this.setOldTransition=t.concludeCssTransition(this.element)},n.prototype.resumeOldTransition=function(){return"function"==typeof this.setOldTransitionTargetFrame&&this.setOldTransitionTargetFrame(),"function"==typeof this.setOldTransition?this.setOldTransition():void 0},n.prototype.startMotion=function(){return t.writeInlineStyle(this.element,{transitionProperty:Object.keys(this.lastFrameKebab).join(", "),transitionDuration:this.duration+"ms",transitionDelay:this.delay+"ms",transitionTimingFunction:this.easing}),t.writeInlineStyle(this.element,this.lastFrameCamel)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return t=this.options.provideTarget?this.plans[0]:this.oldPlan(),t?(t.resolveNesting(),t.selector()):this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?(t.addHungrySteps(),t.resolveNesting(),t.steps):this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.addHungrySteps=e(this.addHungrySteps,this),this.parseSteps=e(this.parseSteps,this),this.selector=e(this.selector,this),this.resolveNesting=e(this.resolveNesting,this),this.addSteps=e(this.addSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this);var r;this.reveal=n.reveal,this.origin=n.origin,this.hungry=n.hungry,this.transition=n.transition,this.response=n.response,this.oldLayer=n.layer,r=up.dom.resolveSelector(t,this.origin),this.parseSteps(r)}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.addSteps=function(t){return this.steps=this.steps.concat(t)},n.prototype.resolveNesting=function(){var e;if(!(this.steps.length<2))return e=t.copy(this.steps),e=t.uniqBy(e,function(t){return t.$old[0]}),e=t.select(e,function(){return function(n,r){return t.all(e,function(t,e){var o,i;return e===r||(o=n.$old[0],i=t.$old[0],t.pseudoClass||!$.contains(i,o))})}}(this)),e[0].reveal=this.steps[0].reveal,this.steps=e},n.prototype.selector=function(){return t.map(this.steps,"expression").join(", ")},n.prototype.parseSteps=function(e){var n,r;return n=/\ *,\ */,this.steps=[],r=e.split(n),t.each(r,function(t){return function(e,n){var r,o,i,u;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],r=0===n&&t.reveal,t.steps.push({expression:e,selector:u,pseudoClass:i,transition:t.transition,origin:t.origin,reveal:r})}}(this))},n.prototype.addHungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(i=[],this.hungry)for(e=$(up.radio.hungrySelector()),l=t.option(up.radio.config.hungryTransition,this.transition),u=0,s=e.length;u<s;u++)o=e[u],n=$(o),a=t.selectorForElement(n),(r=this.response.first(a))&&i.push({selector:a,$old:n,$new:r,transition:l,reveal:!1,origin:null});return this.addSteps(i)},n}()}.call(this),function(){var t;t=up.util,up.ExtractStep=function(){function t(){}return t}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;if(null!==this.scheduledValue&&!this.currentTimer&&!this.currentCallback)return this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;if(t=this.readFieldValue(),this.isNewValue(t))return this.scheduledValue=t,
2
+ this.cancelTimer(),this.scheduleTimer()},n}()}.call(this),function(){}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){if(up.link.shouldProcessEvent(t,e))return up.bus.consumeAction(t),this.followLink(e)},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){var r,o,i,u,s;for(i=["a","[up-href]"],u=[],r=0,o=i.length;r<o;r++)s=i[r],u.push(e.push(""+s+n+t));return u}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onClick.apply(e,r))}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onMousedown.apply(e,r))}}(this))},r.prototype.followLink=function(e,n){var r;return n=t.options(n),r={message:"Following link",$link:e,$element:e},up.bus.whenEmitted("up:link:follow",r).then(function(t){return function(){return up.feedback.start(e,n,function(){return t.followNow(e,n)})}}(this))},r.prototype.preloadLink=function(e,n){return n=t.options(n),this.preloadNow(e,n)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t;t=up.util,up.HtmlParser=function(){function e(e){this.html=e,this.wrapNoscriptInHtml(),this.parsedDoc=t.createElementFromHtml(this.html)}return e.prototype.title=function(){var t;return null!=(t=this.parsedDoc.querySelector("head title"))?t.textContent:void 0},e.prototype.first=function(t){var e;if(e=$.find(t,this.parsedDoc)[0])return $(e)},e.prototype.prepareForInsertion=function(t){var e;return e=t[0],this.unwrapNoscriptInElement(e),$(e)},e.prototype.wrapNoscriptInHtml=function(){var e;return e=/<noscript[^>]*>((.|\s)*?)<\/noscript>/gi,this.html=this.html.replace(e,function(e){return function(n,r){return e.didWrapNoscript=!0,'<div class="up-noscript" data-html="'+t.escapeHtml(r)+'"></div>'}}(this))},e.prototype.unwrapNoscriptInElement=function(t){var e,n,r,o,i,u,s;if(this.didWrapNoscript){for(s=t.querySelectorAll(".up-noscript"),o=[],e=0,n=s.length;e<n;e++)u=s[e],i=u.getAttribute("data-html"),r=document.createElement("noscript"),r.textContent=i,o.push(u.parentNode.replaceChild(r,u));return o}},e}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.reset=e(this.reset,this),this.whileForwardingFinishEvent=e(this.whileForwardingFinishEvent,this),this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkCluster=e(this.unmarkCluster,this),this.markCluster=e(this.markCluster,this),this.whenElementFinished=e(this.whenElementFinished,this),this.emitFinishEvent=e(this.emitFinishEvent,this),this.finishOneElement=e(this.finishOneElement,this),this.isActive=e(this.isActive,this),this.expandFinishRequest=e(this.expandFinishRequest,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.activeClass="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.activeClass,this.finishEvent="up:"+t+":finish",this.finishCount=0,this.clusterCount=0}return n.prototype.claim=function(e,n,r){var o;return null==r&&(r={}),o=$(e),r.trackMotion=t.option(r.trackMotion,up.motion.isEnabled()),r.trackMotion===!1?t.microtask(n):(r.trackMotion=!1,this.finish(o).then(function(t){return function(){var e;return e=t.whileForwardingFinishEvent(o,n),e=e.then(function(){return t.unmarkCluster(o)}),t.markCluster(o,e),e}}(this)))},n.prototype.finish=function(e){var n,r;return this.finishCount++,0!==this.clusterCount&&up.motion.isEnabled()?(n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)):Promise.resolve()},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.isActive=function(e){return t.hasClass(e,this.activeClass)},n.prototype.finishOneElement=function(t){var e;return e=$(t),this.emitFinishEvent(e),this.whenElementFinished(e)},n.prototype.emitFinishEvent=function(e,n){return null==n&&(n={}),n=t.merge({$element:e,message:!1},n),up.emit(this.finishEvent,n)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markCluster=function(t,e){return this.clusterCount++,t.addClass(this.activeClass),t.data(this.dataKey,e)},n.prototype.unmarkCluster=function(t){return this.clusterCount--,t.removeClass(this.activeClass),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n.prototype.whileForwardingFinishEvent=function(e,n){var r;return e.length<2?n():(r=function(n){return function(r){if(!r.forwarded)return t.each(e,function(t){var e;if(e=$(t),t!==r.target&&n.isActive(e))return n.emitFinishEvent(e,{forwarded:!0})})}}(this),e.on(this.finishEvent,r),n().then(function(t){return function(){return e.off(t.finishEvent,r)}}(this)))},n.prototype.reset=function(){return this.finish().then(function(t){return function(){return t.finishCount=0,t.clusterCount=0}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferSearchToParams=e(this.transferSearchToParams,this),this.transferParamsToUrl=e(this.transferParamsToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","params","data","target","failTarget","headers","timeout","preload","cache"]},o.prototype.normalize=function(){return t.deprecateRenamedKey(this,"data","params"),this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToParams():this.transferParamsToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=t.presence(e.hash),this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferParamsToUrl=function(){if(this.params&&!t.isFormData(this.params))return this.url=up.params.buildURL(this.url,this.params),this.params=void 0},o.prototype.transferSearchToParams=function(){var e;if(e=up.params.fromURL(this.url))return this.params=up.params.merge(this.params,e),this.url=t.normalizeUrl(this.url,{search:!1})},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,p,c,f,h,d;p=new XMLHttpRequest,c=t.copy(e.headers),h=e.params,f=e.method,d=e.url,s=up.proxy.wrapMethod(f,h),f=s[0],h=s[1],h?(delete c["Content-Type"],h=up.params.toFormData(h)):h=null,u=up.protocol.config,e.target&&(c[u.targetHeader]=e.target),e.failTarget&&(c[u.failTargetHeader]=e.failTarget),e.isCrossDomain()||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(c[u.csrfHeader]=o),p.open(f,d);for(i in c)l=c[i],p.setRequestHeader(i,l);return a=function(){var t;return t=e.buildResponse(p),t.isSuccess()?n(t):r(t)},p.onload=a,p.onerror=a,p.ontimeout=a,e.timeout&&(p.timeout=e.timeout),p.send(h)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return this.transferSearchToParams(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(up.params.toArray(this.params),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){if(!this.isSafe()&&!this.isCrossDomain())return up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.params)},o.prototype.cacheKey=function(){var t;return t=up.params.toQuery(this.params),[this.url,this.method,t,this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.getHeader=e(this.getHeader,this),this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o.prototype.getHeader=function(t){return this.xhr.getResponseHeader(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};up.store||(up.store={}),t=up.util,up.store.Memory=function(){function n(){this.values=e(this.values,this),this.keys=e(this.keys,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.get=e(this.get,this),this.clear=e(this.clear,this),this.clear()}return n.prototype.clear=function(){return this.data={}},n.prototype.get=function(t){return this.data[t]},n.prototype.set=function(t,e){return this.data[t]=e},n.prototype.remove=function(t){return delete this.data[t]},n.prototype.keys=function(){return Object.keys(this.data)},n.prototype.values=function(){return t.values(this.data)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.store.Session=function(t){function r(t){this.saveToSessionStorage=e(this.saveToSessionStorage,this),this.loadFromSessionStorage=e(this.loadFromSessionStorage,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.clear=e(this.clear,this),this.rootKey=t,this.loadFromSessionStorage()}return n(r,t),r.prototype.clear=function(){return r.__super__.clear.call(this),this.saveToSessionStorage()},r.prototype.set=function(t,e){return r.__super__.set.call(this,t,e),this.saveToSessionStorage()},r.prototype.remove=function(t){return r.__super__.remove.call(this,t),this.saveToSessionStorage()},r.prototype.loadFromSessionStorage=function(){var t;try{(t="undefined"!=typeof sessionStorage&&null!==sessionStorage?sessionStorage.getItem(this.rootKey):void 0)&&(this.data=JSON.parse(t))}catch(t){}return this.data||(this.data={})},r.prototype.saveToSessionStorage=function(){var t;t=JSON.stringify(this.data);try{return"undefined"!=typeof sessionStorage&&null!==sessionStorage?sessionStorage.setItem(this.rootKey,t):void 0}catch(t){}},r}(up.store.Memory)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.UrlSet=function(){function n(n,r){this.urls=n,null==r&&(r={}),this.isEqual=e(this.isEqual,this),this.matchesAny=e(this.matchesAny,this),this.doesMatchPrefix=e(this.doesMatchPrefix,this),this.doesMatchFully=e(this.doesMatchFully,this),this.matches=e(this.matches,this),this.normalizeUrl=r.normalizeUrl||t.normalizeUrl,this.urls=t.map(this.urls,this.normalizeUrl),this.urls=t.compact(this.urls)}return n.prototype.matches=function(t){return"*"===t.substr(-1)?this.doesMatchPrefix(t.slice(0,-1)):this.doesMatchFully(t)},n.prototype.doesMatchFully=function(e){return t.contains(this.urls,e)},n.prototype.doesMatchPrefix=function(e){return t.detect(this.urls,function(t){return 0===t.indexOf(e)})},n.prototype.matchesAny=function(e){return t.detect(e,this.matches)},n.prototype.isEqual=function(e){return t.isEqual(this.urls,null!=e?e.urls:void 0)},n}()}.call(this),function(){var t=[].slice;up.browser=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P;return S=up.util,v=function(t,e){var n;return null==e&&(e={}),n=new up.Request(S.merge(e,{url:t})),n.navigate()},T=function(t){return t.submit()},y=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],console[n].apply(console,e)},n=/\%[odisf]/g,k=function(t){var n,r,o,i,u,s,a,l,p;if(s=200,o="",S.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',o='"';else if(S.isUndefined(t))l="undefined";else if(S.isNumber(t)||S.isFunction(t))l=t.toString();else if(S.isArray(t))l="["+S.map(t,k).join(", ")+"]",o="]";else if(S.isJQuery(t))l="$("+S.map(t,k).join(", ")+")",o=")";else if(S.isElement(t)){for(n=e(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],i=0,u=a.length;i<u;i++)r=a[i],(p=n.attr(r))&&(l+=" "+r+'="'+p+'"');l+=">",o=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=o),l},b=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],w.apply(null,[S.identity,n].concat(t.call(e)))},w=function(){var e,r,o,i;return r=arguments[0],i=arguments[1],e=3<=arguments.length?t.call(arguments,2):[],S.isBlank(i)?"":(o=0,i.replace(n,function(){var t;return t=e[o],t=r(k(t)),o+=1,t}))},E=function(){return location.href},h=S.memoize(function(){return!window.atob}),c=function(){return S.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},o=S.memoize(function(){return"transition"in document.documentElement.style}),a=S.memoize(function(){return"oninput"in document.createElement("input")}),p=S.memoize(function(){return!!window.Promise}),s=S.memoize(function(){return!!window.FormData}),l=S.memoize(function(){return s()&&!!FormData.prototype.entries}),u=S.memoize(function(){return!!window.DOMParser}),r=S.memoize(function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd}),i=S.memoize(function(){return!!window.customElements}),d=S.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}),g=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,S.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},P=function(t){return t.preload||S.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},m=function(){return!h()&&d()&&r()&&u()&&s()&&o()&&a()&&p()},f=function(){var t;return(t=document.scrollingElement)?t.tagName:"html"},{url:E,navigate:v,submitForm:T,canPushState:c,canFormData:s,canInspectFormData:l,canCustomElements:i,documentViewportSelector:f,whenConfirmed:P,isSupported:m,puts:y,sprintf:b,sprintfWithFormattedArgs:w,popCookie:g}}(jQuery)}.call(this),function(){var t=[].slice;up.bus=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P;return w=up.util,c={},h=0,g={},E=function(t){return function(n){var r,o,i;return r=n.$element||e(this),o=[n,r],i=t.length,1!==i&&2!==i&&o.push(up.syntax.data(r)),t.apply(r.get(0),o)}},S=function(t,e){var n,r,o;return n=w.copy(t),s(n),o=n.pop(),r=void 0,e?(r=E(o),o._asJqueryListener=r,o._descriptionNumber&&up.fail("up.on(): The callback %o cannot be registered more than once"),o._descriptionNumber=++h):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},s=function(t){var e;return e=w.splitValues(t[0]),e=w.map(e,function(t){var e;return(e=g[t])?(up.warn("Deprecated: "+t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},p=function(){var n,r,o;return o=1<=arguments.length?t.call(arguments,0):[],up.browser.isSupported()?(n=S(o,!0),v(o),(r=e(document)).on.apply(r,n),function(){return k.apply(null,o)}):function(){}},k=function(){var n,r,o;return o=1<=arguments.length?t.call(arguments,0):[],n=S(o,!1),a(o),(r=e(document)).off.apply(r,n)},v=function(t){var e;return e=T(t),c[e]=t},a=function(t){var e,n;return e=T(t),n=w.last(t),delete n._descriptionNumber,delete n._asJqueryListener,delete c[e]},T=function(t){return w.last(t)._descriptionNumber},i=function(t,n){var r,o;return null==n&&(n={}),o=e.Event(t,n),r=n.$target||n.$element||e(document),f(t,n),r.trigger(o),o},f=function(e,n){var r,o,i;return n.hasOwnProperty("message")?(r=n.message,delete n.message,r!==!1&&(w.isArray(r)?(i=r,r=i[0],o=2<=i.length?t.call(i,1):[]):o=[],r)?w.isPresent(n)?up.puts.apply(up,[r+" (%s (%o))"].concat(t.call(o),[e],[n])):up.puts.apply(up,[r+" (%s)"].concat(t.call(o),[e])):void 0):w.isPresent(n)?up.puts("Emitted event %s (%o)",e,n):up.puts("Emitted event %s",e)},d=function(){var e,n;return e=1<=arguments.length?t.call(arguments,0):[],n=i.apply(null,e),!n.isDefaultPrevented()},P=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],new Promise(function(t,n){return d.apply(null,e)?t():n(new Error("Event "+e[0]+" was prevented"))})},m=function(t){return p("keydown","body",function(e){if(w.escapePressed(e))return t(e)})},l=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},r=function(t){if(l(t),"up:action:consumed"!==t.type)return i("up:action:consumed",{$element:e(t.target),message:!1})},b=function(){var t,e,n;n=[];for(e in c)t=c[e],n.push(t.isDefault=!0);return n},y=function(){var t,e,n,r,o,i;e=[];for(o in c)t=c[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;n<r;n++)t=e[n],i.push(k.apply(null,t));return i},u=function(){return i("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},o=function(t,e){return g[t]=e},n=function(){return up.browser.isSupported()?(i("up:framework:boot",{message:"Booting framework"}),i("up:framework:booted",{message:"Framework booted"}),w.nextFrame(function(){return w.whenReady().then(function(){return i("up:app:boot",{message:"Booting user application"}),i("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},p("up:framework:booted",b),p("up:framework:reset",y),{on:p,off:k,emit:i,nobodyPrevents:d,whenEmitted:P,onEscape:m,emitReset:u,haltEvent:l,consumeAction:r,deprecateRenamedEvent:o,boot:n}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){up.params=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F,$,A;return A=up.util,r=0,e=1,i=2,n=3,o=4,T=function(t){return A.isMissing(t)?r:A.isArray(t)?e:A.isString(t)?i:A.isFormData(t)?n:A.isObject(t)?o:up.fail("Unsupport params type: %o",t)},x=function(t){switch(T(t)){case r:return[];case e:return t;case i:return c(t);case n:return l(t);case o:return p(t)}},F=function(t){switch(T(t)){case r:return{};case e:case i:case n:return h(x(t));case o:return t}},C=function(t){switch(T(t)){case r:return new FormData;case e:case i:case o:return f(x(t));case n:return t}},$=function(t){switch(T(t)){case r:return"";case i:return t;case e:case n:case o:return d(x(t))}},s=function(t){var e,n;if(n=t.value,w(n))return e=encodeURIComponent(t.name),A.isGiven(n)&&(e+="=",e+=encodeURIComponent(n)),e},w=function(t){return A.isMissing(t)||A.isString(t)||A.isNumber(t)||A.isBoolean(t)},E=function(t,e,n){if(!A.isBasicObjectProperty(e))return t[e]=n},S=function(t,e){if(!A.isBasicObjectProperty(e))return t[e]},d=function(t){var e;return e=A.map(t,s),e=A.compact(e),e.join("&")},c=function(t){var e,n,r,o,i,u,s,a;for(e=[],u=t.split("&"),n=0,r=u.length;n<r;n++)i=u[n],i&&(s=i.split("="),o=s[0],a=s[1],o=decodeURIComponent(o),a=A.isGiven(a)?decodeURIComponent(a):null,e.push({name:o,value:a}));return e},p=function(t){var e,n,r;e=[];for(n in t)r=t[n],e.push({name:n,value:r});return e},h=function(t){var e,n,r,o;for(o={},n=0,r=t.length;n<r;n++)e=t[n],E(o,e.name,e.value);return o},l=function(t){var e;return e=[],A.eachIterator(t.entries(),function(t){var n,r;return r=t,n=r[0],t=r[1],e.push({name:n,value:t})}),e},f=function(t){var e,n,r,o;for(n=new FormData,r=0,o=t.length;r<o;r++)e=t[r],n.append(e.name,e.value);return n},m=function(t,e){var n,r;return n=[t,$(e)],n=A.select(n,A.isPresent),r=A.contains(t,"?")?"&":"?",n.join(r)},u=function(t,e,n){var r;return r=[{name:e,value:n}],a(t,r)},k=function(t,u){var s,l,p,c;switch(T(t)){case r:return k({},u);case e:return l=x(u),t.concat(l);case n:return s=new FormData,a(s,t),a(s,u),s;case i:return p=$(u),c=A.select([t,p],A.isPresent),c.join("&");case o:return A.merge(t,F(u))}},b=function(t,u){var s,a;switch(T(t)){case r:return;case e:return s=A.detect(t,function(t){return t.name===u}),null!=s?s.value:void 0;case n:return a=t.get(u),A.isNull(a)&&(a=void 0),a;case i:return S(F(t),u);case o:return S(t,u)}},a=function(t,u){var s,a,l,p;switch(T(t)){case e:return p=x(u),t.push.apply(t,p),t;case n:for(p=x(u),a=0,l=p.length;a<l;a++)s=p[a],t.append(s.name,s.value);return t;case o:return A.assign(t,F(u));case i:case r:return k(t,u)}},P=function(e){var n,r,o;return r=t(e),o=up.form.submitButtonSelector(),n=t(document.activeElement),n.is(o)&&r.has(n)?n[0]:r.find(o)[0]},g=function(t){var e,n;if(t=A.element(t))return n=t.querySelectorAll(up.form.fieldSelector()),(e=P(t))&&(n=A.toArray(n),n.push(e)),A.flatMap(n,v)},v=function(t){var e,n,r,o,i,u,s,a,l,p,c,f;if(a=[],(t=A.element(t))&&(u=t.name)&&!t.disabled)if(c=t.tagName,f=t.type,"SELECT"===c)for(l=t.querySelectorAll("option"),n=0,o=l.length;n<o;n++)s=l[n],s.selected&&a.push({name:u,value:s.value});else if("checkbox"===f||"radio"===f)t.checked&&a.push({name:u,value:t.value});else if("file"===f)for(p=t.files,r=0,i=p.length;r<i;r++)e=p[r],a.push({name:u,value:e});else a.push({name:u,value:t.value});return a},y=function(t){var e,n;if(n=A.parseUrl(t),e=n.search)return e=e.replace(/^\?/,"")},{toArray:x,toObject:F,toQuery:$,toFormData:C,buildURL:m,get:b,add:u,assign:a,merge:k,fromForm:g,fromURL:y}}(jQuery)}.call(this),function(){}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;if(n=t.getResponseHeader(e.methodHeader))return l.normalizeMethod(n)},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m;return d=up.util,e=up.browser,f=new up.store.Session("up.log"),n=d.config({prefix:"[UP] ",enabled:f.get("enabled"),collapse:!1}),c=function(){return n.reset()},a=function(t){return""+n.prefix+t},r=function(){var r,o;if(o=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],n.enabled&&o)return e.puts.apply(e,["debug",a(o)].concat(t.call(r)))},p=function(){var r,o;if(o=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],n.enabled&&o)return e.puts.apply(e,["log",a(o)].concat(t.call(r)))},m=function(){var n,r;if(r=arguments[0],n=2<=arguments.length?t.call(arguments,1):[],r)return e.puts.apply(e,["warn",a(r)].concat(t.call(n)))},s=function(){var r,o,i,u;if(i=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=r.pop(),!n.enabled||!i)return o();u=n.collapse?"groupCollapsed":"group",e.puts.apply(e,[u,a(i)].concat(t.call(r)));try{return o()}finally{i&&e.puts("groupEnd")}},u=function(){var n,r;if(r=arguments[0],n=2<=arguments.length?t.call(arguments,1):[],r)return e.puts.apply(e,["error",a(r)].concat(t.call(n)))},l=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=n.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",e.puts("log",t)},up.on("up:framework:boot",l),up.on("up:framework:reset",c),h=function(t){return f.set("enabled",t),n.enabled=t},i=function(){return h(!0)},o=function(){return h(!1)},{puts:p,debug:r,error:u,warn:m,group:s,config:n,enable:i,disable:o}}(jQuery),up.puts=up.log.puts,up.warn=up.log.warn}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,p,c;return c=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+c.escapeHtml(t)+"</span>"},p=c.config({$toast:null}),l=function(){return i(),p.reset()},s=function(e){return c.isArray(e)?(e[0]=c.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=c.escapeHtml(e),e},u=function(){return!!p.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),p.$toast=a},i=function(){if(u())return p.$toast.remove(),p.$toast=null},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m;return m=up.util,e={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},a=!0,i=[],l=[],c=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),s(i,r)},h=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],r=n.apply(null,e),a&&(r.priority=u(r.selector)||up.fail("Unregistered priority for system macro %o",r.selector)),s(l,r)},u=function(t){var n,r;for(r in e)if(n=e[r],t.indexOf(r)>=0)return n},n=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=m.extractOptions(e),r=m.options(r,{selector:o,isSystem:a,priority:0,batch:!1,keep:!1}),m.assign(n,r)},s=function(t,e){var n,r;for(r=0;(n=t[r])&&n.priority>=e.priority;)r+=1;return t.splice(r,0,e)},o=function(t,e){var n,r;return r=l.concat(i),n=new up.CompilePass(t,r,e),n.compile()},f=function(t,e){var n;return t=m.element(t),(n=t.upDestructors)||(n=[],t.upDestructors=n,t.classList.add("up-can-clean")),n.push(e)},r=function(t){var e;return e=m.selectInSubtree(t,".up-can-clean"),m.each(e,function(t){var e,n,r,o,i;if(n=t.upDestructors){for(i=[],r=0,o=n.length;r<o;r++)e=n[r],i.push(e());return i}})},p=function(t){var e;if(e=m.element(t))return m.jsonAttr(e,"up-data")||{}},d=function(){return i=m.select(i,"isSystem"),l=m.select(l,"isSystem")},up.on("up:framework:booted",function(){return a=!1}),up.on("up:framework:reset",d),{compiler:c,macro:h,destructor:f,compile:o,clean:r,data:p}}(jQuery),up.compiler=up.syntax.compiler,up.destructor=up.syntax.destructor,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),p=void 0,u=void 0,d=function(){return n.reset(),p=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(p=u,u=void 0),u=t},h=function(t){if(i("replaceState",t))return up.emit("up:history:replaced",{url:t})},c=function(t,e){if(e=v.options(e,{force:!1}),t=s(t),(e.force||!o(t))&&up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t}))return i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return!(!up.browser.canPushState()||!n.enabled)&&(i=e(),window.history[t](i,"",o),a(r()),!0)},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:p}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){if(v.isPresent(p))return v.setMissingAttrs(t,{"up-href":p,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)}),up.on("up:framework:reset",d),{config:n,push:c,replace:h,url:r,isUrl:o,previousUrl:function(){return p},normalizeUrl:s}}(jQuery)}.call(this),function(){var t=[].slice;up.layout=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C;return S=up.util,o=S.config({duration:0,viewports:[".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),a=new up.Cache({size:30,key:up.history.normalizeUrl}),T=new up.MotionTracker("scrolling"),c=function(){return o.reset(),a.clear(),T.reset()},v=function(t,n,r){var u;return u=e(t),r=S.options(r),r.duration=S.option(r.duration,o.duration),r.easing=S.option(r.easing,o.easing),i(u).then(function(){return up.motion.isEnabled()&&r.duration>0?k(u,n,r):g(u,n)})},k=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(T.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(T.eventName)}),o},T.claim(t,r)},g=function(t,e){return t.scrollTop(e),Promise.resolve()},i=function(t){var e;return up.motion.isEnabled()?(e=E(t),T.finish(e)):Promise.resolve()},r=function(){var t;return t=o.anchoredRight.join(","),e(t)},l=function(){var n,r,i,u,s,a,l;return u=function(t,e){var n;return n=S.sum(e,function(e){return S.readComputedStyleNumber(t,e)})||0,n+t.offsetHeight},a=function(t){return u(t,["top","margin-top"])},s=function(t){return u(t,["bottom","margin-bottom"])},r=e(o.fixedTop.join(", ")),
3
+ n=e(o.fixedBottom.join(", ")),l=S.map(r,a),i=S.map(n,s),{top:Math.max.apply(Math,[0].concat(t.call(l))),bottom:Math.max.apply(Math,[0].concat(t.call(i)))}},h=function(t,n){var r;return r=e(t).first(),up.puts("Revealing fragment %o",r.get(0)),n=S.options(n),S.rejectOnError(function(){var t,i,u,s,a,p,c,f,h,d,m,g,y;return t=n.viewport?e(n.viewport):E(r),m=S.option(n.snap,o.snap),y=t.is(up.browser.documentViewportSelector()),g=y?S.clientSize().height:t.outerHeight(),f=t.scrollTop(),a=f,c=void 0,p=void 0,y?(p=l(g),c=0):(p={top:0,bottom:0},c=f),h=function(){return a+p.top},d=function(){return a+g-p.bottom},i=S.measure(r,{relative:t,includeMargin:!0}),u=i.top+c,s=u+Math.min(i.height,o.substance),s>d()&&(a+=s-d()),(u<h()||n.top)&&(a=u-p.top),a<m&&i.top<.5*g&&(a=0),a!==f?v(t,a,n):Promise.resolve()})},y=function(t,n){var r,o,i,u,s,a,l;return n=S.options(n),r=e(t),u=n.hash,a=n.reveal,s=n.restoreScroll,o=S.only(n,"duration"),s?(i=S.presence(s,S.isObject),f({around:r,scrollTops:i})):u&&a===!0?d(u,o):a?(S.isElement(a)||S.isJQuery(a)?r=e(a):S.isString(a)&&(l=up.dom.resolveSelector(a,n.origin),r=up.first(l)),r.length?h(r,o):void 0):Promise.resolve()},d=function(t){var e;return t&&(e=u(t))?h(e,{top:!0}):Promise.resolve()},P=function(){return[up.browser.documentViewportSelector()].concat(t.call(o.viewports)).join(",")},E=function(t,n){var r;return null==n&&(n={}),r=e(t),r.closest(P())},C=function(t){var n;return n=e(t),S.selectInSubtree(n,P())},x=function(){return e(P())},b=function(t){return S.selectorForElement(t)},w=function(){var t,n,r,i,u;for(u={},i=o.viewports,n=0,r=i.length;n<r;n++)t=i[n],e(t).each(function(){var t,n,r;return t=e(this),n=b(t),r=t.scrollTop(),u[n]=r});return u},s=function(t){var n,r;return null==t&&(t=void 0),t||(t=document.body),r=e(t),n=r.find("[up-fixed]"),S.isPresent(o.fixedTop)&&(n=n.add(r.find(o.fixedTop.join(", ")))),S.isPresent(o.fixedBottom)&&(n=n.add(r.find(o.fixedBottom.join(", ")))),n},m=function(t){var e,n;return null==t&&(t={}),n=S.option(t.url,up.history.url()),e=S.option(t.tops,w()),a.set(n,e)},f=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=C(t.around),e=E(t.around),r=e.add(n)):r=x(),o=t.scrollTops||a.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=S.map(r,function(t){var e,n;return e=b(t),n=o[e]||0,v(t,n,{duration:0})}),Promise.all(t)})},n=function(t,n){var r,o,i,u,s,a,l,p,c,f,h;for(n=S.options(n,{afterMeasure:S.noop}),i=up.layout.viewportOf(t),c=S.measure(t,{relative:!0,inner:!0}),f=t.offset(),n.afterMeasure(),S.writeInlineStyle(t,{position:"static"===S.readComputedStyle(t,"position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),r=e('<div class="up-bounds"></div>'),u=S.merge(c,{position:"absolute"}),S.writeInlineStyle(r,u),r.insertBefore(t),t.appendTo(r),h=c.top,p=function(t){if(0!==t)return h+=t,S.writeInlineStyle(r,{top:h})},p(f.top-t.offset().top),o=up.layout.fixedChildren(t),a=0,l=o.length;a<l;a++)s=o[a],S.fixedToAbsolute(s,i);return{$element:t,$bounds:r,moveTop:p}},u=function(t){var e,n;if(t=p(t))return e=S.attributeSelector("id",t),n="a"+S.attributeSelector("name",t),up.first(e+","+n)},p=function(t){return t&&"#"===t[0]&&(t=t.substr(1)),S.presence(t)},up.on("up:app:booted",function(){return d(location.hash)}),up.on("up:framework:reset",c),{reveal:h,revealHash:d,firstHashTarget:u,scroll:v,config:o,viewportOf:E,viewportsWithin:C,viewports:x,scrollTops:w,saveScroll:m,restoreScroll:f,scrollAfterInsertFragment:y,anchoredRight:r,fixedChildren:s,absolutize:n}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F,$,A,O,R;return O=up.util,o=O.config({fallbacks:["body"],fallbackTransition:null}),S=function(){return o.reset()},P=function(e,n){var r;if(n!==!1)return r=t(e),O.isPresent(n)&&(n=O.normalizeUrl(n)),r.attr("up-source",n)},F=function(e){var n;return n=t(e).closest("[up-source]"),O.presence(n.attr("up-source"))||up.browser.url()},E=function(t,e){var n,r;return O.isString(t)?(r=t,O.contains(r,"&")&&(O.isPresent(e)?(n=O.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=O.selectorForElement(t),r},T=function(t,e,n){var o,i,u,s,a,l,p,c,f,h;if(n=O.options(n),n.inspectResponse=u=function(){return up.browser.navigate(e,O.only(n,"method","params"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||u(),O.unresolvablePromise();h=O.merge(n,{humanizedTarget:"target"}),i=O.merge(n,{humanizedTarget:"failure target",provideTarget:void 0,restoreScroll:!1}),O.renameKey(i,"failTransition","transition"),O.renameKey(i,"failLayer","layer"),O.renameKey(i,"failReveal","reveal");try{a=r(t,h),s=r(n.failTarget,i)}catch(t){return o=t,Promise.reject(o)}return f=new up.Request({url:e,method:n.method,data:n.data,params:n.params,target:a,failTarget:s,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout}),p=function(t){return w(!0,a,f,t,h)},l=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=w(!1,s,f,t,i),O.always(e,n))},c=up.request(f),n.preload||(c=c.then(p,l)),c},w=function(t,e,n,r,o){var i,u,s,a;return a=r.url,u=a,(i=n.hash)&&(o.hash=i,u+=i),s="GET"===r.method,t?s?(o.history===!1||O.isString(o.history)||(o.history=u),o.source===!1||O.isString(o.source)||(o.source=a)):(O.isString(o.history)||(o.history=!1),O.isString(o.source)||(o.source="keep")):s?(o.history!==!1&&(o.history=u),o.source!==!1&&(o.source=a)):(o.history=!1,o.source="keep"),x(o)&&r.title&&(o.title=r.title),p(e,r.text,o)},x=function(t){return!(t.title===!1||O.isString(t.title)||t.history===!1&&t.title!==!0)},p=function(t,e,r){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return r=O.options(r,{historyMethod:"push",keep:!0,layer:"auto"}),r.saveScroll!==!1&&up.layout.saveScroll(),O.rejectOnError(function(){var o,i,u,s,a,l,p;for("function"==typeof r.provideTarget&&r.provideTarget(),s=new up.HtmlParser(e),o=n(t,s,r),x(r)&&(a=s.title())&&(r.title=a),R(r),p=[],i=0,u=o.length;i<u;i++)l=o[i],up.log.group("Swapping fragment %s",l.selector,function(){var t,e;return t=O.merge(r,O.only(l,"origin","reveal")),s.prepareForInsertion(l.$new),e=$(l.$old,l.$new,l.pseudoClass,l.transition,t),p.push(e)});return Promise.all(p)})})},r=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},n=function(t,e,n){var r;return n=O.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},R=function(t){if(t=O.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),O.isString(t.title))return document.title=t.title},$=function(t,e,n,r,o){var i,a,p,f,h;return r||(r="none"),"keep"===o.source&&(o=O.merge(o,{source:F(t)})),P(e,o.source),n?(a=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(a):t.append(a),m(a.children(),o),h=up.layout.scrollAfterInsertFragment(a,o),h=h.then(function(){return up.animate(a,r,o)}),h=h.then(function(){return O.unwrapElement(a)})):(p=c(t,e,o))?(l(p),Promise.resolve()):(o.keepPlans=A(t,e,o),i=t.parent(),f=O.merge(o,{beforeStart:function(){return y(t),u(t,{log:!1})},afterInsert:function(){return up.hello(e,o)},beforeDetach:function(){return up.syntax.clean(t)},afterDetach:function(){return t.remove(),s(t,{$parent:i,log:!1})}}),up.morph(t,e,r,f))},A=function(e,n,r){var o,i,u,s,a,l,p,f;if(s=[],r.keep)for(f=e.find("[up-keep]"),u=0,l=f.length;u<l;u++)a=f[u],o=t(a),(p=c(o,n,O.merge(r,{descendantsOnly:!0})))&&(i=o.clone(),O.detachWith(o,i),p.$newElement.replaceWith(o),s.push(p));return s},c=function(t,e,n){var r,o,i,u,s;if(n.keep&&(r=t,(u=O.castedAttr(r,"up-keep"))&&(O.isString(u)||(u="&"),u=E(u,r),o=n.descendantsOnly?e.find(u):O.selectInSubtree(e,u),o=o.first(),o.length&&o.is("[up-keep]")&&(s={$element:r,$newElement:o,newData:up.syntax.data(o)},i=O.merge(s,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i)))))return s},m=function(e,n){var r,o,i,u,s,p;for(r=t(e),n=O.options(n,{keepPlans:[]}),i=[],p=n.keepPlans,o=0,u=p.length;o<u;o++)s=p[o],l(s),i.push(s.$element[0]);return up.syntax.compile(r,{skip:i}),a(r,n),r},a=function(t,e){return up.emit("up:fragment:inserted",{$element:t,message:["Inserted fragment %o",t.get(0)],origin:e.origin})},l=function(t){var e;return e=O.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},u=function(t,e){var n;return C(t,e)&&(n=["Destroying fragment %o",t.get(0)]),up.emit("up:fragment:destroy",{$element:t,message:n})},s=function(t,e){var n,r;return C(t,e)&&(r=["Destroyed fragment %o",t.get(0)]),n=e.$parent||up.fail("Missing { $parent } option"),up.emit("up:fragment:destroyed",{$target:n,$parent:n,$element:t,message:r})},v=function(t){var e;return e=".up-destroying",0===t.closest(e).length},f=function(t,e){var n;return e=O.options(e,{layer:"auto"}),n=E(t,e.origin),"auto"===e.layer?d(n,e.origin):h(n,e.layer)},d=function(t,e){var n,r,o,i,u,s;for(i=["popup","modal","page"],n=void 0,O.isPresent(e)&&(s=g(e),O.remove(i,s),i.unshift(s)),r=0,u=i.length;r<u&&(o=i[r],!(n=h(t,o)));r++);return n},h=function(e,n){var r,o,i,u,s,a;for(o=t(e),i=void 0,s=0,a=o.length;s<a;s++)if(u=o[s],r=t(u),v(r)&&b(r,n)){i=r;break}return i},g=function(e){var n;if(n=t(e),n.length)return up.popup.contains(n)?"popup":up.modal.contains(n)?"modal":"page"},b=function(t,e){return!e||g(t)===e},e=function(e,n){var r,o;return n=O.options(n),o=E(e,n.origin),r=t(O.option(n.root,document)),r.find(o).filter(function(e,r){var o;return o=t(r),v(o)&&b(o,n.layer)})},i=function(e,n){var r,o,i;return r=t(e),n=O.options(n,{animation:!1}),0===r.length?Promise.resolve():(y(r),u(r,n),R(n),o=function(){var t;return t=up.motion.animateOptions(n),up.motion.animate(r,n.animation,t)},i=function(){var t;return t=r.parent(),up.syntax.clean(r),r.remove(),s(r,{$parent:t})},o().then(i))},C=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},y=function(t){return t.addClass("up-destroying")},k=function(t,e){var n;return e=O.options(e,{cache:!1}),n=e.url||F(t),T(t,n,e)},up.on("up:app:boot",function(){var e;return e=t(document.body),P(e,up.browser.url()),m(e)}),up.on("up:framework:reset",S),{replace:T,reload:k,destroy:i,extract:p,first:f,all:e,source:F,resolveSelector:E,hello:m,config:o,layerOf:g}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.all=up.dom.all,up.hello=up.dom.hello,up.deprecateRenamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F;return C=up.util,y={},a={},b={},l={},g=new up.MotionTracker("motion"),s=C.config({duration:300,delay:0,easing:"ease",enabled:!0}),T=function(){return g.reset(),y=C.copy(a),b=C.copy(l),s.reset()},d=function(){return s.enabled},r=function(t,n,r){var o,u,s,a;return o=e(t),r=i(r),u=p(n),a=F(o,n,r),a?(s=function(){return u(o,r)},g.claim(o,s,r)):S(o,n)},F=function(t,e,n){return n=i(n),d()&&!m(e)&&n.duration>0&&!C.isSingletonElement(t)},S=function(t,e){return C.isOptions(e)&&C.writeInlineStyle(t,e),Promise.resolve()},n=0,o=function(t,e,n){var r;return n=C.merge(n,{finishEvent:g.finishEvent}),r=new up.CssTransition(t,e,n),r.start()},i=function(){var e,n,r,o,i;return n=1<=arguments.length?t.call(arguments,0):[],i=n.shift()||{},e=C.isJQuery(n[0])?n.shift():C.nullJQuery(),o=C.isObject(n[0])?n.shift():{},r={},r.easing=C.option(i.easing,C.presentAttr(e,"up-easing"),o.easing,s.easing),r.duration=Number(C.option(i.duration,C.presentAttr(e,"up-duration"),o.duration,s.duration)),r.delay=Number(C.option(i.delay,C.presentAttr(e,"up-delay"),o.delay,s.delay)),r.trackMotion=i.trackMotion,r},c=function(t){return y[t]||up.fail("Unknown animation %o",t)},h=function(t){return g.finish(t)},v=function(t,n,r,o){var u,s,a,l,p,c,h,d,m,v,y,b,w,k,T;return o=C.options(o),o=C.assign(o,i(o)),a=e(t),s=e(n),u=a.add(s),k=f(r),T=F(a,k,o),d=C.pluckKey(o,"beforeStart")||C.noop,c=C.pluckKey(o,"afterInsert")||C.noop,h=C.pluckKey(o,"beforeDetach")||C.noop,p=C.pluckKey(o,"afterDetach")||C.noop,d(),y=function(){var t;return t=C.merge(o,{duration:0}),up.layout.scrollAfterInsertFragment(s,t)},T?g.isActive(a)&&o.trackMotion===!1?k(a,s,o):(up.puts("Morphing %o to %o with transition %o",a.get(0),s.get(0),r),l=up.layout.viewportOf(a),b=l.scrollTop(),m=up.layout.absolutize(a,{afterMeasure:function(){return s.insertBefore(a),c()}}),w=function(){var t;return t=y(),t=t.then(function(){var t;return t=l.scrollTop(),m.moveTop(t-b),k(a,s,o)}),t=t.then(function(){return h(),a.detach(),m.$bounds.remove(),p()})},g.claim(u,w,o)):(h(),P(a,s),c(),p(),v=y())},f=function(t){var e;if(!m(t))return C.isFunction(t)?t:C.isArray(t)?u.apply(null,t):C.isString(t)?t.indexOf("/")>=0?u.apply(null,t.split("/")):(e=b[t])?f(e):void 0:up.fail("Unknown transition %o",t)},u=function(t,e){var n,r;return m(t)&&m(t)?void 0:(r=p(t)||C.asyncNoop,n=p(e)||C.asyncNoop,function(t,e,o){return Promise.all([r(t,o),n(e,o)])})},p=function(t){return m(t)?void 0:C.isFunction(t)?t:C.isString(t)?c(t):C.isOptions(t)?function(e,n){return o(e,t,n)}:up.fail("Unknown animation %o",t)},P=function(t,e){return t.replaceWith(e)},k=function(t,e){return b[t]=f(e)},w=function(t,e){return y[t]=p(e)},E=function(){return a=C.copy(y),l=C.copy(b)},m=function(t){return!t||"none"===t||C.isBlank(t)},w("fade-in",function(t,e){return C.writeInlineStyle(t,{opacity:0}),o(t,{opacity:1},e)}),w("fade-out",function(t,e){return C.writeInlineStyle(t,{opacity:1}),o(t,{opacity:0},e)}),x=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},w("move-to-top",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=n.top+n.height,o(t,x(0,-r),e)}),w("move-from-top",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=n.top+n.height,C.writeInlineStyle(t,x(0,-r)),o(t,x(0,0),e)}),w("move-to-bottom",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=C.clientSize().height-n.top,o(t,x(0,r),e)}),w("move-from-bottom",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=C.clientSize().height-n.top,C.writeInlineStyle(t,x(0,r)),o(t,x(0,0),e)}),w("move-to-left",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=n.left+n.width,o(t,x(-r,0),e)}),w("move-from-left",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=n.left+n.width,C.writeInlineStyle(t,x(-r,0)),o(t,x(0,0),e)}),w("move-to-right",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=C.clientSize().width-n.left,o(t,x(r,0),e)}),w("move-from-right",function(t,e){var n,r;return C.writeInlineStyle(t,x(0,0)),n=C.measure(t),r=C.clientSize().width-n.left,C.writeInlineStyle(t,x(r,0)),o(t,x(0,0),e)}),w("roll-down",function(t,e){var n,o,i;return o=t.height(),i=C.writeTemporaryStyle(t,{height:"0px",overflow:"hidden"}),n=r(t,{height:o+"px"},e),n.then(i),n}),k("move-left",["move-to-left","move-from-right"]),k("move-right",["move-to-right","move-from-left"]),k("move-up",["move-to-top","move-from-bottom"]),k("move-down",["move-to-bottom","move-from-top"]),k("cross-fade",["fade-out","fade-in"]),up.on("up:framework:booted",E),up.on("up:framework:reset",T),{morph:v,animate:r,animateOptions:i,willAnimate:F,finish:h,finishCount:function(){return g.finishCount},transition:k,animation:w,config:s,isEnabled:d,isNone:m}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F,$,A,O,R,j,D,M,U;return M=up.util,n=void 0,S=void 0,O=void 0,b=void 0,R=void 0,P=[],l=M.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return l.cacheSize},expiry:function(){return l.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;r<o;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(S),S=null},s=function(){return clearTimeout(O),O=null},F=function(){return n=null,u(),s(),b=0,l.reset(),i.clear(),R=!1,P=[]},F(),y=function(){var e,n,r,o,i,u;return e=1<=arguments.length?t.call(arguments,0):[],M.isString(e[0])&&(u=e.shift()),i=e.shift()||{},u&&(i.url=u),o=up.Request.wrap(i),o.isSafe()||a(),n=o.cache===!1,!n&&(r=p(o))?up.puts("Re-using cached response for %s %s",o.method,o.url):(r=v(o),A(o,r),r["catch"](function(){return C(o)})),o.preload||(g(),M.always(r,m)),r},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},y.apply(null,e).then(r,n)})},f=function(){return 0===b},c=function(){return b>0},g=function(){var t;if(b+=1,!O)return t=function(){if(c())return up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),R=!0},O=M.setTimer(l.slowDelay,t)},m=function(){if(b-=1,f()&&(s(),R))return up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),R=!1},v=function(t){return b<l.maxRequests?d(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return d(t)},e=M.previewable(e),P.push(e),e.promise},d=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),M.always(n,$),M.always(n,w),n):(M.microtask(w),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;if(n=t.request,t.url&&n.url!==t.url)return e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)},$=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},w=function(){var t;"function"==typeof(t=P.shift())&&t()},o=i.alias,A=i.set,C=i.remove,a=i.clear,up.bus.deprecateRenamedEvent("up:proxy:received","up:proxy:loaded"),T=function(t){var e,r;if(r=parseInt(M.presentAttr(t,"up-delay"))||l.preloadDelay,!t.is(n))return n=t,u(),e=function(){return M.muteRejection(k(t)),n=null},j(e,r)},j=function(t,e){return S=setTimeout(t,e)},D=function(t){if(t.is(n))return n=void 0,u()},k=function(t,n){var r,o;return r=e(t),up.link.isSafe(r)?(o={message:["Preloading link %o",r.get(0)],$element:r,$link:r},up.bus.whenEmitted("up:link:preload",o).then(function(){var t;return t=up.link.followVariantForLink(r),t.preloadLink(r,n)})):Promise.reject(new Error("Won't preload unsafe link"))},h=function(t){return M.contains(l.safeMethods,t)},U=function(t,e){return M.contains(l.wrapMethods,t)&&(e=up.params.add(e,up.protocol.config.methodParam,t),t="POST"),[t,e]},up.compiler("a[up-preload], [up-href][up-preload]",function(t){if(up.link.isSafe(t))return t.on("mouseenter touchstart",function(e){if(up.link.shouldProcessEvent(e,t))return T(t)}),t.on("mouseleave",function(){return D(t)})}),up.on("up:framework:reset",F),{preload:k,ajax:r,request:y,get:p,alias:o,clear:a,remove:C,isIdle:f,isBusy:c,isSafeMethod:h,wrapMethod:U,config:l}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m;return d=up.util,m=function(t,e){var n;return e=d.options(e),n=d.option(e.target,"body"),up.replace(n,t,e)},u=function(e,n){var r,o;return r=t(e),o=a(r),o.followLink(r,n)},o=function(e,n){var r,o,i;return r=t(e),n=d.options(n),i=d.option(n.url,r.attr("up-href"),r.attr("href")),o=d.option(n.target,r.attr("up-target")),n.failTarget=d.option(n.failTarget,r.attr("up-fail-target")),n.fallback=d.option(n.fallback,r.attr("up-fallback")),n.transition=d.option(n.transition,d.castedAttr(r,"up-transition"),"none"),n.failTransition=d.option(n.failTransition,d.castedAttr(r,"up-fail-transition"),"none"),n.history=d.option(n.history,d.castedAttr(r,"up-history")),n.reveal=d.option(n.reveal,d.castedAttr(r,"up-reveal"),!0),n.failReveal=d.option(n.failReveal,d.castedAttr(r,"up-fail-reveal"),!0),n.cache=d.option(n.cache,d.castedAttr(r,"up-cache")),n.restoreScroll=d.option(n.restoreScroll,d.castedAttr(r,"up-restore-scroll")),n.method=s(r,n),n.origin=d.option(n.origin,r),n.layer=d.option(n.layer,r.attr("up-layer"),"auto"),n.failLayer=d.option(n.failLayer,r.attr("up-fail-layer"),"auto"),n.confirm=d.option(n.confirm,r.attr("up-confirm")),n=d.merge(n,up.motion.animateOptions(n,r)),up.browser.whenConfirmed(n).then(function(){return up.replace(o,i,n)})},i=function(t,e){return e=d.options(e),e.preload=!0,o(t,e)},s=function(e,n){var r;return r=t(e),n=d.options(n),d.option(n.method,r.attr("up-method"),r.attr("data-method"),"get").toUpperCase()},r=function(){},l=[],n=function(t,e){var n;return n=new up.FollowVariant(t,e),l.push(n),n.registerEvents(),n},p=function(t){return!!a(t,{"default":!1})},a=function(n,r){var o,i;return r=d.options(r),o=t(n),i=d.detect(l,function(t){return t.matchesLink(o)}),r["default"]!==!1&&(i||(i=e)),i},f=function(e){var n;if(n=t(e),!p(n))return n.attr("up-follow","")},h=function(e,n){var r,o;return o=e.target,!!d.isUnmodifiedMouseEvent(e)&&(o===n.get(0)||(r=t(o).closest("a, [up-href], "+up.form.fieldSelector()).not(n),!r.length))},c=function(e,n){var r,o;return r=t(e),o=s(r,n),up.proxy.isSafeMethod(o)},e=n("[up-target], [up-follow]",{follow:function(t,e){return o(t,e)},preload:function(t,e){return i(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=d.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?f(t):e["up-target"]=n,d.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(e){var n,r,o,i,u,s,a,l,p,c;if(n=e.find("a, [up-href]"),(p=e.attr("up-expand"))&&(n=n.filter(p)),u=n.get(0)){for(c=/^up-/,a={},a["up-href"]=t(u).attr("href"),l=u.attributes,o=0,i=l.length;o<i;o++)r=l[o],s=r.name,s.match(c)&&(a[s]=r.value);return d.setMissingAttrs(e,a),e.removeAttr("up-expand"),f(e)}}),{visit:m,follow:u,makeFollowable:f,isSafe:c,isFollowable:p,shouldProcessEvent:h,followMethod:s,addFollowVariant:n,followVariantForLink:a,allowDefault:r}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var t=[].slice;up.form=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v;return m=up.util,r=m.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:["select","input:not([type=submit]):not([type=image])","button[type]:not([type=submit])","textarea"],submitButtons:["input[type=submit]","input[type=image]","button[type=submit]","button:not([type])"],observeDelay:0}),a=function(){return r.reset()},o=function(){return r.fields.join(",")},c=function(){return r.submitButtons.join(",")},p=function(t,n){var r,o,i;return r=e(t).closest("form"),n=m.options(n),o=m.option(n.target,r.attr("up-target"),"body"),i=m.option(n.url,r.attr("action"),up.browser.url()),n.failTarget=m.option(n.failTarget,r.attr("up-fail-target"))||m.selectorForElement(r),n.reveal=m.option(n.reveal,m.castedAttr(r,"up-reveal"),!0),n.failReveal=m.option(n.failReveal,m.castedAttr(r,"up-fail-reveal"),!0),n.fallback=m.option(n.fallback,r.attr("up-fallback")),n.history=m.option(n.history,m.castedAttr(r,"up-history"),!0),n.transition=m.option(n.transition,m.castedAttr(r,"up-transition"),"none"),n.failTransition=m.option(n.failTransition,m.castedAttr(r,"up-fail-transition"),"none"),n.method=m.option(n.method,r.attr("up-method"),r.attr("data-method"),r.attr("method"),"post").toUpperCase(),n.headers=m.option(n.headers,{}),n.cache=m.option(n.cache,m.castedAttr(r,"up-cache")),n.restoreScroll=m.option(n.restoreScroll,m.castedAttr(r,"up-restore-scroll")),n.origin=m.option(n.origin,r),n.layer=m.option(n.layer,r.attr("up-layer"),"auto"),n.failLayer=m.option(n.failLayer,r.attr("up-fail-layer"),"auto"),n.params=up.params.fromForm(r),n=m.merge(n,up.motion.animateOptions(n,r)),n.validate&&(n.headers||(n.headers={}),n.transition=!1,n.failTransition=!1,n.headers[up.protocol.config.validateHeader]=n.validate),up.bus.whenEmitted("up:form:submit",{message:"Submitting form",$form:r,$element:r}).then(function(){var t;return up.feedback.start(r),up.browser.canPushState()||n.history===!1?(t=up.replace(o,i,n),m.always(t,function(){return up.feedback.stop(r)}),t):(r.get(0).submit(),m.unresolvablePromise())})},u=function(){var n,i,u,a,l,p,c,f,h,d;return d=arguments[0],c=2<=arguments.length?t.call(arguments,1):[],f={},a=void 0,1===c.length?a=c[0]:c.length>1&&(f=m.options(c[0]),a=c[1]),n=e(d),u=null,h=m.option(a,m.presentAttr(n,"up-observe")),u=m.isString(h)?new Function("value","$field",h):h||up.fail("up.observe: No change callback given"),l=m.option(m.presentAttr(n,"up-delay"),f.delay,r.observeDelay),l=parseInt(l),i=m.selectInSubtree(n,o()),p=m.map(i,function(t){return s(e(t),l,u)}),m.sequence.apply(m,p)},s=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},n=function(t,e){return u(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return p(n)})})},l=function(t,e){var n;return n=m.option(e.target,t.attr("up-validate")),m.isBlank(n)&&(n||(n=m.detect(r.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),m.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),r.validateTargets),m.isString(n)||(n=m.selectorForElement(n)),n},v=function(t,n){var r,o,i;return r=e(t),n=m.options(n),n.origin=r,n.target=l(r,n),n.failTarget=n.target,n.reveal=m.option(n.reveal,m.castedAttr(r,"up-reveal"),!1),n.history=!1,n.headers=m.option(n.headers,{}),n.validate=r.attr("name")||"__none__",n=m.merge(n,up.motion.animateOptions(n,r)),o=r.closest("form"),i=up.submit(o,n)},d=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],m.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),m.isPresent(n)&&o.push(n),o},h=function(t,n){var r,o,i;return r=e(t),n=m.options(n),i=m.option(n.target,r.attr("up-switch")),m.isPresent(i)||up.fail("No switch target given for %o",r.get(0)),o=d(r),e(i).each(function(){return f(e(this),o)})},f=function(t,n){var r,o,u,s;return r=e(t),n||(n=d(i(r))),(o=r.attr("up-hide-for"))?(o=m.splitValues(o),u=0===m.intersect(n,o).length):(s=(s=r.attr("up-show-for"))?m.splitValues(s):[":present",":checked"],u=m.intersect(n,s).length>0),r.toggle(u),r.addClass("up-switched")},i=function(t){var n,r;return n=e("[up-switch]"),r=m.detect(n,function(n){var r;return r=e(n).attr("up-switch"),t.is(r)}),r?e(r):m.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),m.muteRejection(p(e))}),up.on("change","[up-validate]",function(t,e){return m.muteRejection(v(e))}),up.compiler("[up-switch]",function(t){return h(t)}),up.on("change","[up-switch]",function(t,e){return h(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return f(t)}),up.compiler("[up-observe]",function(t){return u(t)}),up.compiler("[up-autosubmit]",function(t){return n(t)}),up.compiler("[autofocus]",{batch:!0},function(t){return t.last().focus()}),up.on("up:framework:reset",a),{config:r,submit:p,observe:u,validate:v,switchTargets:h,autosubmit:n,fieldSelector:o,submitButtonSelector:c}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y;return g=up.util,a=g.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),m=g.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),i=new g.DivertibleChain,d=function(){var t;return null!=(t=m.$popup)&&t.remove(),m.reset(),i.reset(),a.reset()},e=function(){var t,e,n;switch(n={},e=g.measure(m.$popup),g.isFixed(m.$anchor)?(t=m.$anchor.get(0).getBoundingClientRect(),n.position="fixed"):t=g.measure(m.$anchor),m.position){case"bottom-right":n.top=t.top+t.height,n.left=t.left+t.width-e.width;break;case"bottom-left":n.top=t.top+t.height,n.left=t.left;break;case"top-right":n.top=t.top-e.height,n.left=t.left+t.width-e.width;break;case"top-left":n.top=t.top-e.height,n.left=t.left;break;default:up.fail("Unknown position option '%s'",m.position)}return m.$popup.attr("up-position",m.position),g.writeInlineStyle(m.$popup,n)},c=function(){return m.coveredTitle=null,m.coveredUrl=null},p=function(t){var e;return e=g.$createElementFromSelector(".up-popup"),g.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),m.$popup=e},y=function(){return m.$popup.show()},f=function(){return"opened"===m.phase||"opening"===m.phase},n=function(t,e){return i.asap(s,function(){return r(t,e)})},r=function(n,r){var o,i,u,s,l,c,f;return o=t(n),o.length||up.fail("Cannot attach popup to non-existing element %o",n),r=g.options(r),f=g.option(g.pluckKey(r,"url"),o.attr("up-href"),o.attr("href")),s=g.option(g.pluckKey(r,"html")),f||s||up.fail("up.popup.attach() requires either an { url } or { html } option"),c=g.option(g.pluckKey(r,"target"),o.attr("up-popup"))||up.fail("No target selector given for [up-popup]"),l=g.option(r.position,o.attr("up-position"),a.position),r.animation=g.option(r.animation,o.attr("up-animation"),a.openAnimation),r.sticky=g.option(r.sticky,g.castedAttr(o,"up-sticky"),a.sticky),r.history=!!up.browser.canPushState()&&g.option(r.history,g.castedAttr(o,"up-history"),a.history),r.confirm=g.option(r.confirm,o.attr("up-confirm")),r.method=up.link.followMethod(o,r),r.layer="popup",r.failTarget=g.option(r.failTarget,o.attr("up-fail-target")),r.failLayer=g.option(r.failLayer,o.attr("up-fail-layer"),"auto"),r.provideTarget=function(){return p(c)},i=up.motion.animateOptions(r,o,{duration:a.openDuration,easing:a.openEasing}),u=g.merge(r,{animation:!1}),r.preload&&f?up.replace(c,f,r):up.browser.whenConfirmed(r).then(function(){return up.bus.whenEmitted("up:popup:open",{url:f,message:"Opening popup"}).then(function(){var t;return m.phase="opening",m.$anchor=o,m.position=l,r.history&&(m.coveredUrl=up.browser.url(),m.coveredTitle=document.title),m.sticky=r.sticky,t=s?up.extract(c,s,u):up.replace(c,f,u),t=t.then(function(){return e(),y(),up.animate(m.$popup,r.animation,i)}),t=t.then(function(){return m.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},u=function(t){return i.asap(function(){return s(t)})},s=function(t){var e;return f()?(t=g.options(t,{animation:a.closeAnimation,history:m.coveredUrl,title:m.coveredTitle}),e=up.motion.animateOptions(t,{duration:a.closeDuration,easing:a.closeEasing}),g.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:m.$popup}).then(function(){return m.phase="closing",m.url=null,m.coveredUrl=null,m.coveredTitle=null,up.destroy(m.$popup,t).then(function(){return m.phase="closed",m.$popup=null,m.$anchor=null,m.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},h=function(t,e){return e=g.options(e),e.preload=!0,r(t,e)},v=function(t,e){return g.hasClass(t,"up-current")?u():n(t,e)},o=function(){if(!m.sticky)return c(),u()},l=function(e){var n;return n=t(e),n.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return v(t,e)},preload:function(t,e){return h(t,e)}}),up.on("click up:action:consumed",function(e){var n;if(n=t(e.target),!n.closest(".up-popup, [up-popup]").length)return g.muteRejection(u())}),up.on("up:fragment:inserted",function(t,e){var n;if(l(e)){if(n=e.attr("up-source"))return m.url=n}else if(t.origin&&l(t.origin))return g.muteRejection(o())}),up.bus.onEscape(function(){return g.muteRejection(u())}),up.on("click",".up-popup [up-close]",function(t){return g.muteRejection(u()),up.bus.consumeAction(t)}),up.on("up:history:restore",function(){return g.muteRejection(u())}),up.on("up:framework:reset",d),
4
+ {attach:n,close:u,url:function(){return m.url},coveredUrl:function(){return m.coveredUrl},config:a,contains:l,isOpen:f}}(jQuery)}.call(this),function(){up.modal=function(t){var e,n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k,T,S,E,P,x,C,F,$;return P=up.util,u=P.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),d=P.openConfig({"default":{}}),S=P.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),r=new P.DivertibleChain,k=function(){var t;return null!=(t=S.$modal)&&t.remove(),x(),S.reset(),r.reset(),u.reset(),d.reset()},E=function(){var t;return t=f("template"),P.evalOption(t,{closeLabel:f("closeLabel")})},l=function(){return S.coveredTitle=null,S.coveredUrl=null},a=function(e,n){var r,o,i,u;return i=t(E()),i.attr("up-flavor",S.flavor),P.isPresent(S.position)&&i.attr("up-position",S.position),o=i.find(".up-modal-dialog"),u=P.only(n,"width","maxWidth","height"),P.writeInlineStyle(o,u),S.closable||i.find(".up-modal-close").remove(),r=i.find(".up-modal-content"),P.$createPlaceholder(e,r),i.hide(),i.appendTo(document.body),S.$modal=i},C=function(){return S.$modal.show()},T=function(){var e,n,r,o,i;if(P.documentHasVerticalScrollbar())return e=t("body"),o=P.scrollbarWidth(),n=P.readComputedStyleNumber(e,"paddingRight"),r=o+n,i=P.writeTemporaryStyle(e,{paddingRight:r,overflowY:"hidden"}),S.unshifters.push(i),up.layout.anchoredRight().each(function(){var e,n,r,i;return e=t(this),n=P.readComputedStyleNumber(e,"right"),r=o+n,i=P.writeTemporaryStyle(e,{right:r}),S.unshifters.push(i)})},x=function(){var t,e;for(t=[];e=S.unshifters.pop();)t.push(e());return t},v=function(){return"opened"===S.phase||"opening"===S.phase},m=function(e,n){return n=P.options(n),n.$link=t(e),y(n)},w=function(t,e){return e=P.options(e),e.$link=t,e.preload=!0,b(e)},$=function(t,e){return e=P.options(e),e.url=t,y(e)},p=function(t,e,n){return n=P.options(n),n.html=e,n.history=P.option(n.history,!1),n.target=t,y(n)},y=function(t){return r.asap(i,function(){return b(t)})},b=function(t){var n,r,o,i,s;return t=P.options(t),n=P.option(P.pluckKey(t,"$link"),P.nullJQuery()),s=P.option(P.pluckKey(t,"url"),n.attr("up-href"),n.attr("href")),o=P.option(P.pluckKey(t,"html")),i=P.option(P.pluckKey(t,"target"),n.attr("up-modal")),F(i),t.flavor=P.option(t.flavor,n.attr("up-flavor"),u.flavor),t.position=P.option(t.position,n.attr("up-position"),f("position",t.flavor)),t.position=P.evalOption(t.position,{$link:n}),t.width=P.option(t.width,n.attr("up-width"),f("width",t.flavor)),t.maxWidth=P.option(t.maxWidth,n.attr("up-max-width"),f("maxWidth",t.flavor)),t.height=P.option(t.height,n.attr("up-height"),f("height")),t.animation=P.option(t.animation,n.attr("up-animation"),f("openAnimation",t.flavor)),t.animation=P.evalOption(t.animation,{position:t.position}),t.backdropAnimation=P.option(t.backdropAnimation,n.attr("up-backdrop-animation"),f("backdropOpenAnimation",t.flavor)),t.backdropAnimation=P.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=P.option(t.sticky,P.castedAttr(n,"up-sticky"),f("sticky",t.flavor)),t.closable=P.option(t.closable,P.castedAttr(n,"up-closable"),f("closable",t.flavor)),t.confirm=P.option(t.confirm,n.attr("up-confirm")),t.method=up.link.followMethod(n,t),t.layer="modal",t.failTarget=P.option(t.failTarget,n.attr("up-fail-target")),t.failLayer=P.option(t.failLayer,n.attr("up-fail-layer"),"auto"),r=up.motion.animateOptions(t,n,{duration:f("openDuration",t.flavor),easing:f("openEasing",t.flavor)}),t.history=P.option(t.history,P.castedAttr(n,"up-history"),f("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return a(i,t)},t.preload?up.replace(i,s,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:s,message:"Opening modal"}).then(function(){var n,u;return S.phase="opening",S.flavor=t.flavor,S.sticky=t.sticky,S.closable=t.closable,S.position=t.position,t.history&&(S.coveredUrl=up.browser.url(),S.coveredTitle=document.title),n=P.merge(t,{animation:!1}),u=o?up.extract(i,o,n):up.replace(i,s,n),u=u.then(function(){return T(),C(),e(t.animation,t.backdropAnimation,r)}),u=u.then(function(){return S.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},F=function(t){return P.isBlank(t)?up.fail("Cannot open a modal without a target selector"):"body"===t?up.fail("Cannot open the <body> in a modal"):void 0},o=function(t){return r.asap(function(){return i(t)})},i=function(t){var n,r,o,i;return t=P.options(t),v()?(i=P.option(t.animation,f("closeAnimation")),i=P.evalOption(i,{position:S.position}),r=P.option(t.backdropAnimation,f("backdropCloseAnimation")),r=P.evalOption(r,{position:S.position}),n=up.motion.animateOptions(t,{duration:f("closeDuration"),easing:f("closeEasing")}),o=P.options(P.except(t,"animation","duration","easing","delay"),{history:S.coveredUrl,title:S.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:S.$modal,message:"Closing modal"}).then(function(){var t;return S.phase="closing",S.url=null,S.coveredUrl=null,S.coveredTitle=null,t=e(i,r,n),t=t.then(function(){return up.destroy(S.$modal,o)}),t=t.then(function(){return x(),S.phase="closed",S.$modal=null,S.flavor=null,S.sticky=null,S.closable=null,S.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},g=function(t){return null==t&&(t=!0),S.$modal.toggleClass("up-modal-animating",t)},e=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(g(),r=Promise.all([up.animate(S.$modal.find(".up-modal-viewport"),t,n),up.animate(S.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return g(!1)}))},n=function(){if(!S.sticky)return l(),o()},s=function(e){var n;return n=t(e),n.closest(".up-modal").length>0},c=function(t,e){return null==e&&(e={}),up.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),P.assign(h(t),e)},h=function(t){return d[t]||(d[t]={})},f=function(t,e){var n;return null==e&&(e=S.flavor),e&&(n=h(e)[t]),P.isMissing(n)&&(n=u[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return m(t,e)},preload:function(t,e){return w(t,e)}}),up.on("click",".up-modal",function(e){var n;if(S.closable)return n=t(e.target),n.closest(".up-modal-dialog").length||n.closest("[up-modal]").length?void 0:(up.bus.consumeAction(e),P.muteRejection(o()))}),up.on("up:fragment:inserted",function(t,e){var r;if(s(e)){if(r=e.attr("up-source"))return S.url=r}else if(t.origin&&s(t.origin)&&!up.popup.contains(e))return P.muteRejection(n())}),up.bus.onEscape(function(){if(S.closable)return P.muteRejection(o())}),up.on("click",".up-modal [up-close]",function(t){return P.muteRejection(o()),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),d.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return P.isPresent(t.$link)?P.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",function(){return P.muteRejection(o())}),up.on("up:framework:reset",k),{visit:$,follow:m,extract:p,close:o,url:function(){return S.url},coveredUrl:function(){return S.coveredUrl},config:u,flavors:d,contains:s,isOpen:v,flavor:c}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,p,c,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),c=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,p=function(){var t;return null!=(t=c.$tooltip)&&t.remove(),c.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(e={},n=f.measure(c.$tooltip),f.isFixed(c.$anchor)?(t=c.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=f.measure(c.$anchor),c.position){case"top":e.top=t.top-n.height,e.left=t.left+.5*(t.width-n.width);break;case"left":e.top=t.top+.5*(t.height-n.height),e.left=t.left-n.width;break;case"right":e.top=t.top+.5*(t.height-n.height),e.left=t.left+t.width;break;case"bottom":e.top=t.top+t.height,e.left=t.left+.5*(t.width-n.width);break;default:up.fail("Unknown position option '%s'",c.position)}return c.$tooltip.attr("up-position",c.position),f.writeInlineStyle(c.$tooltip,e)},a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),c.$tooltip=e},n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,p,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),p=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),c.phase="opening",c.$anchor=o,a({text:h,html:l}),c.position=p,e(),up.animate(c.$tooltip,u,i).then(function(){return c.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),c.phase="closing",up.destroy(c.$tooltip,t).then(function(){return c.phase="closed",c.$tooltip=null,c.$anchor=null})):Promise.resolve()},l=function(){return"opening"===c.phase||"opened"===c.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(){return i()}),up.on("up:framework:reset",p),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,p,c,f,h,d,m,v,g,y,b,w,k;return g=up.util,s=g.config({currentClasses:["up-current"],navs:["[up-nav]"]}),f=void 0,a=void 0,h=function(){return s.reset(),f=void 0,a=void 0},n="up-active",o="a, [up-href]",p=function(){return s.navs.join(",")},c=function(t){if(g.isPresent(t))return g.normalizeUrl(t,{stripTrailingSlash:!0})},r="up-normalized-urls",d=function(t){var e;return(e=t.data(r))||(e=u(t),t.data(r,e)),e},u=function(t){var e,n,r,o,i,u,s,a,l,p;if(l=[],up.link.isSafe(t))for(u=["href","up-href","up-alias"],n=0,o=u.length;n<o;n++)if(e=u[n],p=g.presentAttr(t,e))for(s=g.splitValues(p),r=0,i=s.length;r<i;r++)a=s[r],"#"!==a&&(a=c(a),l.push(a));return l},i=function(){var t;return t=[up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()],new up.UrlSet(t,{normalizeUrl:c})},b=function(){if(f=a,a=i(),!a.isEqual(f))return y(e("body"))},y=function(t){var e,n;return e=g.selectInSubtree(t,p()),n=g.selectInSubtree(e,o),w(n)},k=function(t){var e;return t.closest(p()).length?(e=g.selectInSubtree(t,o),w(e)):y(t)},w=function(t){return a||(a=i()),g.each(t,function(t){var n,r,o,i,u,l,p,c,f,h,m,v;if(n=e(t),v=d(n),r=t.classList,a.matchesAny(v)){for(c=s.currentClasses,h=[],o=0,l=c.length;o<l;o++)u=c[o],h.push(r.add(u));return h}for(f=s.currentClasses,m=[],i=0,p=f.length;i<p;i++)u=f[i],m.push(r.remove(u));return m})},l=function(t){var n;return n=e(t),n.is(o)&&(n=g.presence(n.parent(o))||n),n},m=function(){var e,r,o,i,u,s;if(o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),u=g.options(o[0]),e=l(i),u.preload||e.addClass(n),r)return s=r(),g.isPromise(s)?g.always(s,function(){return v(e)}):up.warn("Expected block to return a promise, but got %o",s),s},v=function(t){var e;return e=l(t),e.removeClass(n)},up.on("up:history:pushed up:history:replaced up:history:restored up:modal:opened up:modal:closed up:popup:opened up:popup:closed",function(){return b()}),up.on("up:fragment:inserted",function(t,e){return k(e)}),up.on("up:framework:reset",h),{config:s,start:m,stop:v}}(jQuery),up.deprecateRenamedModule("navigation","feedback")}.call(this),function(){up.radio=function(){var t,e,n,r;return r=up.util,t=r.config({hungry:["[up-hungry]"],hungryTransition:null}),n=function(){return t.reset()},e=function(){return t.hungry.join(",")},up.on("up:framework:reset",n),{config:t,hungrySelector:e}}(jQuery)}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;if(e()&&up.link.isFollowable(t))return i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
@@ -3,6 +3,8 @@
3
3
  #= require_tree ./unpoly/classes
4
4
  #= require ./unpoly/browser
5
5
  #= require ./unpoly/bus
6
+ #= require ./unpoly/params
7
+ #= require ./unpoly/cookie
6
8
  #= require ./unpoly/protocol
7
9
  #= require ./unpoly/log
8
10
  #= require ./unpoly/toast
@@ -23,7 +23,7 @@ up.browser = (($) ->
23
23
  @method up.browser.navigate
24
24
  @param {string} url
25
25
  @param {string} [options.method='get']
26
- @param {Object|Array} [options.data]
26
+ @param {object|Array|FormData|string} [options.params]
27
27
  @internal
28
28
  ###
29
29
  navigate = (url, options = {}) ->
@@ -202,6 +202,14 @@ up.browser = (($) ->
202
202
  canFormData = u.memoize ->
203
203
  !!window.FormData
204
204
 
205
+ ###**
206
+ @function up.browser.canInspectFormData
207
+ @return {boolean}
208
+ @internal
209
+ ###
210
+ canInspectFormData = u.memoize ->
211
+ canFormData() && !!FormData.prototype.entries
212
+
205
213
  ###**
206
214
  Returns whether this browser supports the [`DOMParser`](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser)
207
215
  interface.
@@ -241,13 +249,6 @@ up.browser = (($) ->
241
249
  # When updating minimum jQuery, also update the dependency in package.json.
242
250
  major >= 2 || (major == 1 && minor >= 9)
243
251
 
244
- ###**
245
- Returns and deletes a cookie with the given name
246
- Inspired by Turbolinks: https://github.com/rails/turbolinks/blob/83d4b3d2c52a681f07900c28adb28bc8da604733/lib/assets/javascripts/turbolinks.coffee#L292
247
-
248
- @function up.browser.popCookie
249
- @internal
250
- ###
251
252
  popCookie = (name) ->
252
253
  value = document.cookie.match(new RegExp(name+"=(\\w+)"))?[1]
253
254
  if u.isPresent(value)
@@ -292,55 +293,38 @@ up.browser = (($) ->
292
293
  canPromise()
293
294
 
294
295
  ###**
295
- @internal
296
- ###
297
- sessionStorage = u.memoize ->
298
- try
299
- # All supported browsers have sessionStorage, so we do not support
300
- # the case where window.sessionStorage is undefined.
301
- window.sessionStorage
302
- catch
303
- # Unfortunately Chrome explodes upon access of window.sessionStorage when
304
- # user blocks third-party cookies and site data and this page is embedded
305
- # as an <iframe>. See https://bugs.chromium.org/p/chromium/issues/detail?id=357625
306
- polyfilledSessionStorage()
296
+ Return the [scrolling element](https://developer.mozilla.org/en-US/docs/Web/API/document/scrollingElement)
297
+ for the browser's main content area.
307
298
 
308
- ###**
299
+ @function up.browser.documentViewportSelector
309
300
  @internal
310
301
  ###
311
- polyfilledSessionStorage = ->
312
- data = {}
313
- getItem: (prop) -> data[prop]
314
- setItem: (prop, value) -> data[prop] = value
315
-
316
- ###**
317
- Returns `'foo'` if the hash is `'#foo'`.
318
-
319
- Returns undefined if the hash is `'#'`, `''` or `undefined`.
320
-
321
- @function up.browser.hash
322
- @internal
323
- ###
324
- hash = (value) ->
325
- value ||= location.hash
326
- value ||= ''
327
- value = value.substr(1) if value[0] == '#'
328
- u.presence(value)
302
+ documentViewportSelector = ->
303
+ # The spec says this should be <html> in standards mode
304
+ # and <body> in quirks mode. However, it is currently (2018-07)
305
+ # always <body> in Webkit browsers (not Blink). Luckily Webkit
306
+ # also supports document.scrollingElement.
307
+ if element = document.scrollingElement
308
+ element.tagName
309
+ else
310
+ # IE11
311
+ 'html'
329
312
 
330
313
  <% if ENV['JS_KNIFE'] %>knife: eval(Knife.point)<% end %>
331
314
  url: url
332
315
  navigate: navigate
333
316
  submitForm: submitForm
334
317
  canPushState: canPushState
318
+ canFormData: canFormData
319
+ canInspectFormData: canInspectFormData
335
320
  canCustomElements: canCustomElements
321
+ documentViewportSelector: documentViewportSelector
336
322
  whenConfirmed: whenConfirmed
337
323
  isSupported: isSupported
338
324
  puts: puts
339
325
  sprintf: sprintf
340
326
  sprintfWithFormattedArgs: sprintfWithFormattedArgs
341
- sessionStorage: sessionStorage
342
327
  popCookie: popCookie
343
- hash: hash
344
328
 
345
329
  )(jQuery)
346
330
 
@@ -68,7 +68,16 @@ up.bus = (($) ->
68
68
  upListenerToJqueryListener = (upListener) ->
69
69
  (event) ->
70
70
  $me = event.$element || $(this)
71
- upListener.apply($me.get(0), [event, $me, up.syntax.data($me)])
71
+ args = [event, $me]
72
+
73
+ # Do not retrieve and parse [up-data] unless the listener function
74
+ # expects a third argument. Note that we must pass data for an argument
75
+ # count of 0, since then the function might take varargs.
76
+ expectedArgCount = upListener.length
77
+ unless expectedArgCount == 1 || expectedArgCount == 2
78
+ args.push(up.syntax.data($me))
79
+
80
+ upListener.apply($me.get(0), args)
72
81
 
73
82
  ###**
74
83
  Converts an argument list for `up.on()` to an argument list for `jQuery.on`.
@@ -91,6 +100,8 @@ up.bus = (($) ->
91
100
  if isNew
92
101
  jqueryListener = upListenerToJqueryListener(upListener)
93
102
  upListener._asJqueryListener = jqueryListener
103
+ if upListener._descriptionNumber
104
+ up.fail('up.on(): The callback %o cannot be registered more than once')
94
105
  upListener._descriptionNumber = ++nextUpDescriptionNumber
95
106
  else
96
107
  jqueryListener = upListener._asJqueryListener
@@ -99,10 +110,10 @@ up.bus = (($) ->
99
110
  jqueryDescription
100
111
 
101
112
  fixRenamedEvents = (description) ->
102
- events = description[0].split(/\s+/)
113
+ events = u.splitValues(description[0])
103
114
  events = u.map events, (event) ->
104
115
  if newEvent = renamedEvents[event]
105
- up.log.warn("#{event} has been renamed to #{newEvent}")
116
+ up.warn("Deprecated: #{event} has been renamed to #{newEvent}")
106
117
  newEvent
107
118
  else
108
119
  event
@@ -247,6 +258,9 @@ up.bus = (($) ->
247
258
 
248
259
  forgetUpDescription = (upDescription) ->
249
260
  number = upDescriptionNumber(upDescription)
261
+ upListener = u.last(upDescription)
262
+ delete upListener._descriptionNumber
263
+ delete upListener._asJqueryListener
250
264
  delete liveUpDescriptions[number]
251
265
 
252
266
  upDescriptionNumber = (upDescription) ->
@@ -444,7 +458,7 @@ up.bus = (($) ->
444
458
  @experimental
445
459
  ###
446
460
 
447
- renamedEvent = (oldEvent, newEvent) ->
461
+ deprecateRenamedEvent = (oldEvent, newEvent) ->
448
462
  renamedEvents[oldEvent] = newEvent
449
463
 
450
464
  ###**
@@ -461,7 +475,7 @@ up.bus = (($) ->
461
475
  boot = ->
462
476
  if up.browser.isSupported()
463
477
  emit('up:framework:boot', message: 'Booting framework')
464
- # Unpoly modules now snapshot themselves to suppot reset()
478
+ # Unpoly modules now snapshot themselves to support reset()
465
479
  emit('up:framework:booted', message: 'Framework booted')
466
480
  u.nextFrame ->
467
481
  # At this point all user-provided compilers have been registered.
@@ -492,7 +506,7 @@ up.bus = (($) ->
492
506
  emitReset: emitReset
493
507
  haltEvent: haltEvent
494
508
  consumeAction: consumeAction
495
- renamedEvent: renamedEvent
509
+ deprecateRenamedEvent: deprecateRenamedEvent
496
510
  boot: boot
497
511
 
498
512
  )(jQuery)
@@ -14,7 +14,7 @@ class up.Cache
14
14
  @param {number|Function(): number} [config.expiry]
15
15
  The number of milliseconds after which a cache entry
16
16
  will be discarded.
17
- @param {string} [config.log]
17
+ @param {string} [config.logPrefix]
18
18
  A prefix for log entries printed by this cache object.
19
19
  @param {Function(any): string} [config.key]
20
20
  A function that takes an argument and returns a string key
@@ -25,7 +25,7 @@ class up.Cache
25
25
  cachable.
26
26
  ###
27
27
  constructor: (@config = {}) ->
28
- @store = {}
28
+ @store = @config.store || new up.store.Memory()
29
29
 
30
30
  maxKeys: =>
31
31
  u.evalOption(@config.size)
@@ -37,7 +37,7 @@ class up.Cache
37
37
  if @config.key
38
38
  @config.key(key)
39
39
  else
40
- @key.toString()
40
+ key.toString()
41
41
 
42
42
  isEnabled: =>
43
43
  @maxKeys() isnt 0 && @expiryMillis() isnt 0
@@ -49,7 +49,7 @@ class up.Cache
49
49
  true
50
50
 
51
51
  clear: =>
52
- @store = {}
52
+ @store.clear()
53
53
 
54
54
  log: (args...) =>
55
55
  if @config.logPrefix
@@ -57,21 +57,21 @@ class up.Cache
57
57
  up.puts(args...)
58
58
 
59
59
  keys: =>
60
- Object.keys(@store)
60
+ @store.keys()
61
61
 
62
62
  makeRoomForAnotherKey: =>
63
63
  storeKeys = u.copy(@keys())
64
64
  max = @maxKeys()
65
65
  if max && storeKeys.length >= max
66
- oldestKey = null
67
- oldestTimestamp = null
66
+ oldestKey = undefined
67
+ oldestTimestamp = undefined
68
68
  u.each storeKeys, (key) =>
69
- promise = @store[key] # we don't need to call cacheKey here
70
- timestamp = promise.timestamp
69
+ entry = @store.get(key) # we don't need to call cacheKey here
70
+ timestamp = entry.timestamp
71
71
  if !oldestTimestamp || oldestTimestamp > timestamp
72
72
  oldestKey = key
73
73
  oldestTimestamp = timestamp
74
- delete @store[oldestKey] if oldestKey
74
+ @store.remove(oldestKey) if oldestKey
75
75
 
76
76
  alias: (oldKey, newKey) =>
77
77
  value = @get(oldKey, silent: true)
@@ -86,14 +86,15 @@ class up.Cache
86
86
  @makeRoomForAnotherKey()
87
87
  storeKey = @normalizeStoreKey(key)
88
88
  @log("Setting entry %o to %o", storeKey, value)
89
- @store[storeKey] =
89
+ timestampedValue =
90
90
  timestamp: @timestamp()
91
91
  value: value
92
+ @store.set(storeKey, timestampedValue)
92
93
 
93
94
  remove: (key) =>
94
95
  if @isCachable(key)
95
96
  storeKey = @normalizeStoreKey(key)
96
- delete @store[storeKey]
97
+ @store.remove(storeKey)
97
98
 
98
99
  isFresh: (entry) =>
99
100
  millis = @expiryMillis()
@@ -104,7 +105,7 @@ class up.Cache
104
105
  true
105
106
 
106
107
  get: (key, options = {}) =>
107
- if @isCachable(key) && (entry = @store[@normalizeStoreKey(key)])
108
+ if @isCachable(key) && (entry = @store.get(@normalizeStoreKey(key)))
108
109
  if @isFresh(entry)
109
110
  @log("Cache hit for '%s'", key) unless options.silent
110
111
  entry.value
@@ -115,3 +116,12 @@ class up.Cache
115
116
  else
116
117
  @log("Cache miss for '%s'", key) unless options.silent
117
118
  undefined
119
+
120
+ # first: (keyOrKeys) =>
121
+ # @all(keyOrKeys)[0]
122
+ #
123
+ # all: (keys = @keys()) =>
124
+ # keys = u.wrapArray(keys)
125
+ # matches = u.map keys, (key) =>
126
+ # @get(key)
127
+ # u.select(matches, u.isPresent)
@@ -0,0 +1,87 @@
1
+ #= require ./record
2
+
3
+ u = up.util
4
+
5
+ class up.CompilePass
6
+
7
+ constructor: (@$root, @compilers, options = {}) ->
8
+ @root = @$root[0]
9
+
10
+ # Exclude all elements that are descendants of the subtrees we want to keep.
11
+ # The exclusion process is very expensive (in one case compiling 100 slements
12
+ # took 1.5s because of this). That's why we only do it if (1) $skipSubtrees
13
+ # was given and (2) there is an [up-keep] element in $root.
14
+ @$skipSubtrees = $(options.skip)
15
+ unless @$skipSubtrees.length && @root.querySelector('[up-keep]')
16
+ @$skipSubtrees = undefined
17
+
18
+ compile: ->
19
+ up.log.group "Compiling fragment %o", @root, =>
20
+ for compiler in @compilers
21
+ @runCompiler(compiler)
22
+
23
+ runCompiler: (compiler) ->
24
+ $matches = @$select(compiler.selector)
25
+ return unless $matches.length
26
+
27
+ up.log.group ("Compiling '%s' on %d element(s)" unless compiler.isSystem), compiler.selector, $matches.length, =>
28
+ if compiler.batch
29
+ @compileBatch(compiler, $matches)
30
+ else
31
+ for match in $matches
32
+ @compileOneElement(compiler, $(match))
33
+
34
+ # up.compiler() has a legacy { keep } option that will automatically
35
+ # set [up-keep] on the elements it compiles
36
+ if keepValue = compiler.keep
37
+ value = if u.isString(keepValue) then keepValue else ''
38
+ $matches.attr('up-keep', value)
39
+
40
+ compileOneElement: (compiler, $element) ->
41
+ compileArgs = [$element]
42
+ # Do not retrieve and parse [up-data] unless the compiler function
43
+ # expects a second argument. Note that we must pass data for an argument
44
+ # count of 0, since then the function might take varargs.
45
+ unless compiler.length == 1
46
+ data = up.syntax.data($element)
47
+ compileArgs.push(data)
48
+
49
+ result = compiler.apply($element[0], compileArgs)
50
+
51
+ if destructor = @normalizeDestructor(result)
52
+ up.syntax.destructor($element, destructor)
53
+
54
+ compileBatch: (compiler, $elements) ->
55
+ compileArgs = [$elements]
56
+ # Do not retrieve and parse [up-data] unless the compiler function
57
+ # expects a second argument. Note that we must pass data for an argument
58
+ # count of 0, since then the function might take varargs.
59
+ unless compiler.length == 1
60
+ dataList = u.map($elements, up.syntax.data)
61
+ compileArgs.push(dataList)
62
+
63
+ result = compiler.apply($elements.get(), compileArgs)
64
+
65
+ if @normalizeDestructor(result)
66
+ up.fail('Compilers with { batch: true } cannot return destructors')
67
+
68
+ normalizeDestructor: (result) ->
69
+ if u.isFunction(result)
70
+ result
71
+ else if u.isArray(result) && u.all(result, u.isFunction)
72
+ up.warn('up.compiler(): Returning an array of destructor functions is deprecated. Return a single function instead.')
73
+ u.sequence(result...)
74
+
75
+ $select: (selector) ->
76
+ if u.isFunction(selector)
77
+ selector = selector()
78
+
79
+ $matches = u.selectInSubtree(@$root, selector)
80
+
81
+ # Assign @$skipSubtrees to a local variable because jQuery#filter needs `this`.
82
+ if $skipSubtrees = @$skipSubtrees
83
+ $matches = $matches.filter ->
84
+ $match = $(this)
85
+ $match.closest($skipSubtrees).length == 0
86
+
87
+ $matches
@@ -0,0 +1,29 @@
1
+ ## Working example for this: https://codepen.io/anon/pen/MBVewo
2
+ #class up.FocusTracker
3
+ #
4
+ # constructor: ->
5
+ # @discardDelay = 80
6
+ # fieldSelector = up.form.fieldSelector()
7
+ # $(document).on('focusin', fieldSelector, @fieldFocused)
8
+ # $(document).on('focusout', fieldSelector, @fieldBlurred)
9
+ # @reset()
10
+ #
11
+ # reset: ->
12
+ # clearTimeout(@discardTimer)
13
+ # @field = undefined
14
+ #
15
+ # fieldFocused: (event) =>
16
+ # clearTimeout(@discardTimer)
17
+ # @field = event.currentTarget
18
+ #
19
+ # fieldBlurred: (event) =>
20
+ # clearTimeout(@discardTimer)
21
+ # @discardTimer = u.setTimer(@discardDelay, @discardField)
22
+ #
23
+ # discardField: =>
24
+ # @field = undefined
25
+ #
26
+ # lastField: ->
27
+ # if u.isDetached(@field)
28
+ # @discardField()
29
+ # @field
@@ -28,7 +28,7 @@ class up.FollowVariant
28
28
  fullSelector: (additionalClause = '') =>
29
29
  parts = []
30
30
  @selectors.forEach (variantSelector) ->
31
- ['a', '[up-href]'].forEach (tagSelector) ->
31
+ for tagSelector in ['a', '[up-href]']
32
32
  parts.push "#{tagSelector}#{variantSelector}#{additionalClause}"
33
33
  parts.join(', ')
34
34
 
@@ -38,12 +38,15 @@ class up.FollowVariant
38
38
  up.on 'mousedown', @fullSelector('[up-instant]'), (args...) =>
39
39
  u.muteRejection @onMousedown(args...)
40
40
 
41
- followLink: ($link, options = {}) =>
42
- up.bus.whenEmitted('up:link:follow', $element: $link).then =>
41
+ followLink: ($link, options) =>
42
+ options = u.options(options)
43
+ followEventAttrs = { message: 'Following link', $link: $link, $element: $link }
44
+ up.bus.whenEmitted('up:link:follow', followEventAttrs).then =>
43
45
  up.feedback.start $link, options, =>
44
46
  @followNow($link, options)
45
47
 
46
- preloadLink: ($link, options = {}) =>
48
+ preloadLink: ($link, options) =>
49
+ options = u.options(options)
47
50
  @preloadNow($link, options)
48
51
 
49
52
  matchesLink: ($link) =>