unpoly-rails 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 073e4830deaf5d1a5bcb5c021f12574b0667225b
4
- data.tar.gz: ca7cefb937a6a874a1978991e7412dd125199ca4
3
+ metadata.gz: c60ec685f23e250d3f28fb9d04edf7373e8b6639
4
+ data.tar.gz: 2bd25cfa0b00d08ef506bb8018069171cdafc0c2
5
5
  SHA512:
6
- metadata.gz: c7af376508ef0086147a8ea8227ac2b5d77fb7f86d40396237d9889942725c27984da000dc83317d831e1a931e6eeb328f05dfd88364bb4c370d923214cd46fe
7
- data.tar.gz: f026aa47769d84312e78e50dae936c5cd1eb5e332942ab71dd8a1e0962446be16a5a4285f57b565394be9094e8b6bb9057ba713df151319946bef214d87846d9
6
+ metadata.gz: baae73f4cc49096dea5212f6f24eb2db2d95ddf4092ab5e0b82fd5d86276d95f88887ec3e66765d4489b85a4dffcfaa30b242799c210d1cb9b415fdc3807a8ca
7
+ data.tar.gz: bfac196548dc68b88a2962f34c4df7e899e257a36f8f8bb680dccc5f2e8230f83877e0d8988d33047225ca2ba34cd2073acb3df6528c4f9a62cffff2248d296c
data/CHANGELOG.md CHANGED
@@ -14,6 +14,24 @@ Unreleased
14
14
  ### Breaking changes
15
15
 
16
16
 
17
+ 0.22.0
18
+ ------
19
+
20
+ ### Compatible changes
21
+
22
+ - Fix a bug where using the `up-confirm` attribute would result in an infinite loop
23
+ - Unpoly no longer displays confirmation dialogs when [preloading](/up-preload) a link that
24
+ has both [`up-preload`](/up-preload) and `up-confirm` attributes.
25
+
26
+
27
+ ### Breaking changes
28
+
29
+ - `up.proxy.idle()` is now [`up.proxy.isIdle()`](/up.proxy.isIdle)
30
+ - `up.proxy.busy()` is now [`up.proxy.isBusy()`](/up.proxy.isBusy)
31
+ - Event `up:proxy:busy` is now [`up:proxy:slow`](/up:proxy:slow)
32
+ - Event `up:proxy:idle` is now [`up:proxy:idle`](/up:proxy:recover)
33
+
34
+
17
35
  0.21.0
18
36
  ------
19
37
 
data/dist/unpoly.js CHANGED
@@ -2204,10 +2204,12 @@ we can't currently get rid off.
2204
2204
  /**
2205
2205
  @function up,browser.confirm
2206
2206
  @return {Promise}
2207
+ @param {String} options.confirm
2208
+ @param {Boolean} options.preload
2207
2209
  @internal
2208
2210
  */
2209
- confirm = function(message) {
2210
- if (u.isBlank(message) || confirm(message)) {
2211
+ confirm = function(options) {
2212
+ if (options.preload || u.isBlank(options.confirm) || window.confirm(options.confirm)) {
2211
2213
  return u.resolvedPromise();
2212
2214
  } else {
2213
2215
  return u.unresolvablePromise();
@@ -5652,8 +5654,8 @@ the user performs the click.
5652
5654
  Spinners
5653
5655
  --------
5654
5656
 
5655
- You can [listen](/up.on) to the [`up:proxy:busy`](/up:proxy:busy)
5656
- and [`up:proxy:idle`](/up:proxy:idle) events to implement a spinner
5657
+ You can [listen](/up.on) to the [`up:proxy:slow`](/up:proxy:slow)
5658
+ and [`up:proxy:recover`](/up:proxy:recover) events to implement a spinner
5657
5659
  that appears during a long-running request,
5658
5660
  and disappears once the response has been received:
5659
5661
 
@@ -5666,8 +5668,8 @@ Here is the Javascript to make it alive:
5666
5668
  show = function() { $element.show() };
5667
5669
  hide = function() { $element.hide() };
5668
5670
 
5669
- showOff = up.on('up:proxy:busy', show);
5670
- hideOff = up.on('up:proxy:idle', hide);
5671
+ showOff = up.on('up:proxy:slow', show);
5672
+ hideOff = up.on('up:proxy:recover', hide);
5671
5673
 
5672
5674
  hide();
5673
5675
 
@@ -5679,11 +5681,11 @@ Here is the Javascript to make it alive:
5679
5681
 
5680
5682
  });
5681
5683
 
5682
- The `up:proxy:busy` event will be emitted after a delay of 300 ms
5684
+ The `up:proxy:slow` event will be emitted after a delay of 300 ms
5683
5685
  to prevent the spinner from flickering on and off.
5684
5686
  You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.config) like this:
5685
5687
 
5686
- up.proxy.config.busyDelay = 150;
5688
+ up.proxy.config.slowDelay = 150;
5687
5689
 
5688
5690
  @class up.proxy
5689
5691
  */
@@ -5692,13 +5694,13 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5692
5694
  var slice = [].slice;
5693
5695
 
5694
5696
  up.proxy = (function($) {
5695
- var $waitingLink, ajax, alias, busy, busyDelayTimer, busyEventEmitted, cache, cacheKey, cancelBusyDelay, cancelPreloadDelay, checkPreload, clear, config, get, idle, isIdempotent, load, loadEnded, loadOrQueue, loadStarted, normalizeRequest, pendingCount, pokeQueue, preload, preloadDelayTimer, queue, queuedRequests, remove, reset, responseReceived, set, startPreloadDelay, u;
5697
+ var $waitingLink, ajax, alias, cache, cacheKey, cancelBusyDelay, cancelPreloadDelay, checkPreload, clear, config, get, isBusy, isIdempotent, isIdle, load, loadEnded, loadOrQueue, loadStarted, normalizeRequest, pendingCount, pokeQueue, preload, preloadDelayTimer, queue, queuedRequests, remove, reset, responseReceived, set, slowDelayTimer, slowEventEmitted, startPreloadDelay, u;
5696
5698
  u = up.util;
5697
5699
  $waitingLink = void 0;
5698
5700
  preloadDelayTimer = void 0;
5699
- busyDelayTimer = void 0;
5701
+ slowDelayTimer = void 0;
5700
5702
  pendingCount = void 0;
5701
- busyEventEmitted = void 0;
5703
+ slowEventEmitted = void 0;
5702
5704
  queuedRequests = [];
5703
5705
 
5704
5706
  /**
@@ -5712,8 +5714,8 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5712
5714
  @param {Number} [config.cacheExpiry=300000]
5713
5715
  The number of milliseconds until a cache entry expires.
5714
5716
  Defaults to 5 minutes.
5715
- @param {Number} [config.busyDelay=300]
5716
- How long the proxy waits until emitting the [`up:proxy:busy` event](/up:proxy:busy).
5717
+ @param {Number} [config.slowDelay=300]
5718
+ How long the proxy waits until emitting the [`up:proxy:slow` event](/up:proxy:slow).
5717
5719
  Use this to prevent flickering of spinners.
5718
5720
  @param {Number} [config.maxRequests=4]
5719
5721
  The maximum number of concurrent requests to allow before additional
@@ -5737,7 +5739,7 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5737
5739
  @stable
5738
5740
  */
5739
5741
  config = u.config({
5740
- busyDelay: 300,
5742
+ slowDelay: 300,
5741
5743
  preloadDelay: 75,
5742
5744
  cacheSize: 70,
5743
5745
  cacheExpiry: 1000 * 60 * 5,
@@ -5838,8 +5840,8 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5838
5840
  return preloadDelayTimer = null;
5839
5841
  };
5840
5842
  cancelBusyDelay = function() {
5841
- clearTimeout(busyDelayTimer);
5842
- return busyDelayTimer = null;
5843
+ clearTimeout(slowDelayTimer);
5844
+ return slowDelayTimer = null;
5843
5845
  };
5844
5846
  reset = function() {
5845
5847
  $waitingLink = null;
@@ -5847,7 +5849,7 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5847
5849
  cancelBusyDelay();
5848
5850
  pendingCount = 0;
5849
5851
  config.reset();
5850
- busyEventEmitted = false;
5852
+ slowEventEmitted = false;
5851
5853
  cache.clear();
5852
5854
  return queuedRequests = [];
5853
5855
  };
@@ -5928,15 +5930,12 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5928
5930
  Returns `true` if the proxy is not currently waiting
5929
5931
  for a request to finish. Returns `false` otherwise.
5930
5932
 
5931
- The proxy will also emit an [`up:proxy:idle` event](/up:proxy:idle) if it
5932
- used to busy, but is now idle.
5933
-
5934
- @function up.proxy.idle
5933
+ @function up.proxy.isIdle
5935
5934
  @return {Boolean}
5936
5935
  Whether the proxy is idle
5937
5936
  @experimental
5938
5937
  */
5939
- idle = function() {
5938
+ isIdle = function() {
5940
5939
  return pendingCount === 0;
5941
5940
  };
5942
5941
 
@@ -5944,32 +5943,29 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5944
5943
  Returns `true` if the proxy is currently waiting
5945
5944
  for a request to finish. Returns `false` otherwise.
5946
5945
 
5947
- The proxy will also emit an [`up:proxy:busy` event](/up:proxy:busy) if it
5948
- used to be idle, but is now busy.
5949
-
5950
- @function up.proxy.busy
5946
+ @function up.proxy.isBusy
5951
5947
  @return {Boolean}
5952
5948
  Whether the proxy is busy
5953
5949
  @experimental
5954
5950
  */
5955
- busy = function() {
5951
+ isBusy = function() {
5956
5952
  return pendingCount > 0;
5957
5953
  };
5958
5954
  loadStarted = function() {
5959
5955
  var emission, wasIdle;
5960
- wasIdle = idle();
5956
+ wasIdle = isIdle();
5961
5957
  pendingCount += 1;
5962
5958
  if (wasIdle) {
5963
5959
  emission = function() {
5964
- if (busy()) {
5965
- up.emit('up:proxy:busy', {
5960
+ if (isBusy()) {
5961
+ up.emit('up:proxy:slow', {
5966
5962
  message: 'Proxy is busy'
5967
5963
  });
5968
- return busyEventEmitted = true;
5964
+ return slowEventEmitted = true;
5969
5965
  }
5970
5966
  };
5971
- if (config.busyDelay > 0) {
5972
- return busyDelayTimer = setTimeout(emission, config.busyDelay);
5967
+ if (config.slowDelay > 0) {
5968
+ return slowDelayTimer = setTimeout(emission, config.slowDelay);
5973
5969
  } else {
5974
5970
  return emission();
5975
5971
  }
@@ -5981,34 +5977,34 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
5981
5977
  are taking long to finish.
5982
5978
 
5983
5979
  By default Unpoly will wait 300 ms for an AJAX request to finish
5984
- before emitting `up:proxy:busy`. You can configure this time like this:
5980
+ before emitting `up:proxy:slow`. You can configure this time like this:
5985
5981
 
5986
- up.proxy.config.busyDelay = 150;
5982
+ up.proxy.config.slowDelay = 150;
5987
5983
 
5988
- Once all responses have been received, an [`up:proxy:idle`](/up:proxy:idle)
5984
+ Once all responses have been received, an [`up:proxy:recover`](/up:proxy:recover)
5989
5985
  will be emitted.
5990
5986
 
5991
5987
  Note that if additional requests are made while Unpoly is already busy
5992
- waiting, **no** additional `up:proxy:busy` events will be triggered.
5988
+ waiting, **no** additional `up:proxy:slow` events will be triggered.
5993
5989
 
5994
- @event up:proxy:busy
5990
+ @event up:proxy:slow
5995
5991
  @stable
5996
5992
  */
5997
5993
  loadEnded = function() {
5998
5994
  pendingCount -= 1;
5999
- if (idle() && busyEventEmitted) {
6000
- up.emit('up:proxy:idle', {
5995
+ if (isIdle() && slowEventEmitted) {
5996
+ up.emit('up:proxy:recover', {
6001
5997
  message: 'Proxy is idle'
6002
5998
  });
6003
- return busyEventEmitted = false;
5999
+ return slowEventEmitted = false;
6004
6000
  }
6005
6001
  };
6006
6002
 
6007
6003
  /**
6008
6004
  This event is [emitted]/(up.emit) when [AJAX requests](/up.ajax)
6009
- have [taken long to finish](/up:proxy:busy), but have finished now.
6005
+ have [taken long to finish](/up:proxy:slow), but have finished now.
6010
6006
 
6011
- @event up:proxy:idle
6007
+ @event up:proxy:recover
6012
6008
  @stable
6013
6009
  */
6014
6010
  loadOrQueue = function(request) {
@@ -6173,8 +6169,8 @@ You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.conf
6173
6169
  alias: alias,
6174
6170
  clear: clear,
6175
6171
  remove: remove,
6176
- idle: idle,
6177
- busy: busy,
6172
+ isIdle: isIdle,
6173
+ isBusy: isBusy,
6178
6174
  config: config,
6179
6175
  defaults: function() {
6180
6176
  return u.error('up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.');
@@ -6370,7 +6366,7 @@ Read on
6370
6366
  options.origin = u.option(options.origin, $link);
6371
6367
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'));
6372
6368
  options = u.merge(options, up.motion.animateOptions(options, $link));
6373
- return up.browser.confirm(options.confirm).then(function() {
6369
+ return up.browser.confirm(options).then(function() {
6374
6370
  return up.replace(target, url, options);
6375
6371
  });
6376
6372
  };
@@ -7271,8 +7267,8 @@ open dialogs with sub-forms, etc. all without losing form state.
7271
7267
  the submission is loading.
7272
7268
 
7273
7269
  You can also [implement a spinner](/up.proxy/#spinners)
7274
- by [listening](/up.on) to the [`up:proxy:busy`](/up:proxy:busy)
7275
- and [`up:proxy:idle`](/up:proxy:idle) events.
7270
+ by [listening](/up.on) to the [`up:proxy:slow`](/up:proxy:slow)
7271
+ and [`up:proxy:recover`](/up:proxy:recover) events.
7276
7272
 
7277
7273
  @selector form[up-target]
7278
7274
  @param {String} up-target
@@ -7859,7 +7855,7 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
7859
7855
  options.history = up.browser.canPushState() ? u.option(options.history, u.castedAttr($link, 'up-history'), config.history) : false;
7860
7856
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'));
7861
7857
  animateOptions = up.motion.animateOptions(options, $link);
7862
- return up.browser.confirm(options.confirm).then(function() {
7858
+ return up.browser.confirm(options).then(function() {
7863
7859
  var promise, wasOpen;
7864
7860
  if (up.bus.nobodyPrevents('up:popup:open', {
7865
7861
  url: url,
@@ -8413,7 +8409,7 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
8413
8409
  options.history = up.browser.canPushState() ? u.option(options.history, u.castedAttr($link, 'up-history'), config.history) : false;
8414
8410
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'));
8415
8411
  animateOptions = up.motion.animateOptions(options, $link);
8416
- return up.browser.confirm(options.confirm).then(function() {
8412
+ return up.browser.confirm(options).then(function() {
8417
8413
  var promise, wasOpen;
8418
8414
  if (up.bus.nobodyPrevents('up:modal:open', {
8419
8415
  url: url,
data/dist/unpoly.min.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(){window.up={}}).call(this),function(){var e=[].slice;up.util=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T,P,E,D,C,A,U,O,F,R,M,j,K,z,L,I,W,q,N,H,_,Q,V,J,B,X,G,Y,Z,et,tt,nt,rt,ot,ut,it,at,st,lt,ct,pt,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,St,xt,$t,Tt,Pt,Et,Dt,Ct,At,Ut,Ot,Ft,Rt,Mt,jt,Kt;return Z=function(t){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?e.call(arguments,0):[],r?n:(r=!0,n=t.apply(null,o))}},H=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},it=function(e,t){var n,r,o;return n=dt(e),r=n.protocol+"//"+n.hostname,H(n.protocol,n.port)||(r+=":"+n.port),o=n.pathname,"/"!==o[0]&&(o="/"+o),(null!=t?t.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),r+=o,(null!=t?t.hash:void 0)===!0&&(r+=n.hash),(null!=t?t.search:void 0)!==!1&&(r+=n.search),r},dt=function(e){var n;return n=null,_(e)?(n=t("<a>").attr({href:e}).get(0),A(n.hostname)&&(n.href=n.href)):n=Ft(e),n},ut=function(e){return e?e.toUpperCase():"GET"},n=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=e.split(/[ >]/),o=null,f=c=0,m=v.length;m>c;f=++c){for(a=v[f],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],p=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",n=t(l),r&&n.appendTo(r),0===f&&(o=n),r=n}return o},h=function(e,t){var n;return n=document.createElement(e),q(t)&&(n.innerHTML=t),n},r=function(e,t){var r;return null==t&&(t=document.body),r=n(e),r.addClass("up-placeholder"),r.appendTo(t),r},Pt=function(e){var n,r,o,u,i,a,s,l,c;if(n=t(e),l=void 0,up.puts("Creating selector from element %o",n.get(0)),c=ht(n.attr("up-id")))l="[up-id='"+c+"']";else if(u=ht(n.attr("id")))l="#"+u;else if(s=ht(n.attr("name")))l="[name='"+s+"']";else if(r=ht(ot(n)))for(l="",o=0,a=r.length;a>o;o++)i=r[o],l+="."+i;else l=n.prop("tagName").toLowerCase();return l},ot=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),Tt(n,function(e){return q(e)&&!e.match(/^up-/)})},v=function(e){var t,n,r,o,u,i,a,s,l,c,p,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},i=function(e){return"</"+e+">"},t="(?:.|\\n)*?",u=function(e){return"("+e+")"},f=new RegExp(l("head")+t+l("title")+u(t)+i("title")+t+i("body"),"i"),o=new RegExp(l("body")+u(t)+i("body"),"i"),(r=e.match(o))?(s=document.createElement("html"),n=h("body",r[1]),s.appendChild(n),(p=e.match(f))&&(a=h("head"),s.appendChild(a),c=h("title",p[1]),a.appendChild(c)),s):h("div",e)},x=t.extend,Ot=t.trim,b=function(e,t){var n,r,o,u,i;for(i=[],r=n=0,u=e.length;u>n;r=++n)o=e[r],i.push(t(o,r));return i},G=b,Ct=function(e,t){var n,r,o,u;for(u=[],r=n=0,o=e-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)u.push(t(r));return u},L=function(e){return null===e},Q=function(e){return void 0===e},O=function(e){return!Q(e)},z=function(e){return Q(e)||L(e)},M=function(e){return!z(e)},A=function(e){return z(e)||W(e)&&0===Object.keys(e).length||0===e.length},ht=function(e,t){return null==t&&(t=q),t(e)?e:void 0},q=function(e){return!A(e)},R=function(e){return"function"==typeof e},_=function(e){return"string"==typeof e},I=function(e){return"number"==typeof e},j=function(e){return"object"==typeof e&&!!e},W=function(e){return j(e)||"function"==typeof e},F=function(e){return!(!e||1!==e.nodeType)},K=function(e){return e instanceof jQuery},N=function(e){return W(e)&&R(e.then)},U=function(e){return N(e)&&R(e.resolve)},C=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ut=function(e){return Array.prototype.slice.call(e)},d=function(e){return C(e)?e.slice():x({},e)},Ft=function(e){return K(e)?e.get(0):e},et=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],x.apply(null,[{}].concat(e.call(t)))},ft=function(e,t){var n,r,o,u;if(o=e?d(e):{},t)for(r in t)n=t[r],u=o[r],M(u)?W(n)&&W(u)&&(o[r]=ft(u,n)):o[r]=n;return o},pt=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],y(t,M)},y=function(e,t){var n,r,o,u;for(u=void 0,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){u=n;break}return u},i=function(e,t){var n,r,o,u;for(u=!1,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){u=!0;break}return u},u=function(e,t){var n,r,o,u;for(u=!0,r=0,o=e.length;o>r;r++)if(n=e[r],!t(n)){u=!1;break}return u},c=function(e){return Tt(e,M)},Rt=function(e){var t;return t={},Tt(e,function(e){return t.hasOwnProperty(e)?!1:t[e]=!0})},Tt=function(e,t){var n;return n=[],b(e,function(e){return t(e)?n.push(e):void 0}),n},gt=function(e,t){return Tt(e,function(e){return!t(e)})},D=function(e,t){return Tt(e,function(e){return f(t,e)})},vt=function(){var t,n,r,o;return t=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=function(){var e,o,u;for(u=[],e=0,o=r.length;o>e;e++)n=r[e],u.push(t.attr(n));return u}(),y(o,q)},rt=function(e){return setTimeout(e,0)},B=function(e){return e[e.length-1]},l=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},$t=Z(function(){var e,n,r;return e=t("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),e.appendTo(document.body),n=e.get(0),r=n.offsetWidth-n.clientWidth,e.remove(),r}),lt=function(t){var n;return n=void 0,function(){var r;return r=1<=arguments.length?e.call(arguments,0):[],null!=t&&(n=t.apply(null,r)),t=void 0,n}},Dt=function(e,t,n){var r,o;return o=e.css(Object.keys(t)),e.css(t),r=function(){return e.css(o)},n?(n(),r()):lt(r)},E=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),A(n)||"none"===n.transform?(t=function(){return e.css(n)},e.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):t=function(){},t},g=function(e,n,r){var u,i,a,s,l,c;return u=t(e),r=ft(r,{duration:300,delay:0,easing:"ease"}),i=t.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":r.duration+"ms","transition-delay":r.delay+"ms","transition-timing-function":r.easing},l=E(u),c=Dt(u,s),u.css(n),i.then(l),i.then(c),u.data(o,i),i.then(function(){return u.removeData(o)}),a=setTimeout(function(){return i.resolve()},r.duration+r.delay),i.then(function(){return clearTimeout(a)}),i},o="up-animation-deferred",T=function(e){return t(e).each(function(){var e;return(e=mt(this,o))?e.resolve():void 0})},Y=function(e,n){var r,o,u,i,a,s;return n=ft(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=e.position():(r=t(n.relative),a=e.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=e.offset(),o={left:i.left,top:i.top},n.inner?(o.width=e.width(),o.height=e.height()):(o.width=e.outerWidth(),o.height=e.outerHeight()),n.full&&(s=l(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},m=function(e,t){var n,r,o,u,i;for(u=e.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],i.push(n.specified?t.attr(n.name,n.value):void 0);return i},$=function(e,t){return e.find(t).addBack(t)},k=function(e){return 27===e.keyCode},f=function(e,t){return e.indexOf(t)>=0},s=function(e,t){var n;switch(n=e.attr(t)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},X=function(e){return e.getResponseHeader("X-Up-Location")},At=function(e){return e.getResponseHeader("X-Up-Title")},tt=function(e){return e.getResponseHeader("X-Up-Method")},ct=function(){var t,n,r,o,u,i;for(o=arguments[0],u=2<=arguments.length?e.call(arguments,1):[],t={},n=0,r=u.length;r>n;n++)i=u[n],o.hasOwnProperty(i)&&(t[i]=o[i]);return t},S=function(){var t,n,r,o,u,i;for(o=arguments[0],u=2<=arguments.length?e.call(arguments,1):[],t=d(o),n=0,r=u.length;r>n;n++)i=u[n],delete t[i];return t},V=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},J=function(e){var t;return t=Q(e.button)||0===e.button,t&&V(e)},St=function(){var e;return e=t.Deferred(),e.resolve(),e},xt=function(){return St().promise()},Mt=function(){return t.Deferred()},jt=function(){return Mt().promise()},at=function(){return t()},kt=function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],r=t.when.apply(t,[St()].concat(e.call(n))),r.resolve=Z(function(){return b(n,function(e){return e.resolve()})}),r},Et=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],r.push(z(e.attr(n))?e.attr(n,o):void 0);return r},yt=function(e,t){var n;return n=e.indexOf(t),n>=0?(e.splice(n,1),t):void 0},nt=function(e){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=e.length;u>o;o++)s=e[o],_(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(e){var n,r,o,u,i,s;for(r=at(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=e?e.find(s):t(s),r=r.add(n);return r},a.findWithSelf=function(e){var t;return t=a.find(e),a.doesMatch(e)&&(t=t.add(e)),t},a.doesMatch=function(e){var n;return n=t(e),i(a.parsed,function(e){return n.is(e)})},a.seekUp=function(e){var n,r,o;for(o=t(e),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||at()},a},a=function(t){var n,r,o,u,i,a,s,l,c,p,f,m;return null==t&&(t={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.log?(n[0]="["+t.log+"] "+n[0],up.puts.apply(up,n)):void 0},a=function(){return Object.keys(f)},l=function(){return z(t.size)?void 0:R(t.size)?t.size():I(t.size)?t.size:w("Invalid size config: %o",t.size)},o=function(){return z(t.expiry)?void 0:R(t.expiry)?t.expiry():I(t.expiry)?t.expiry:w("Invalid expiry config: %o",t.expiry)},c=function(e){return t.key?t.key(e):e.toString()},Ot=function(){var e,t,n,r;return r=d(a()),n=l(),n&&r.length>n&&(e=null,t=null,b(r,function(n){var r,o;return r=f[n],o=r.timestamp,!t||t>o?(e=n,t=o):void 0}),e)?delete f[e]:void 0},n=function(e,t){var n;return n=u(e,{silent:!0}),O(n)?p(t,n):void 0},m=function(){return(new Date).valueOf()},p=function(e,t){var n;return n=c(e),f[n]={timestamp:m(),value:t}},yt=function(e){var t;return t=c(e),delete f[t]},i=function(e){var t,n;return t=o(),t?(n=m()-e.timestamp,n<o()):!0},u=function(e,t){var n,r;return null==t&&(t={}),r=c(e),(n=f[r])?i(n)?(t.silent||s("Cache hit for '%s'",e),n.value):(t.silent||s("Discarding stale cache entry for '%s'",e),void yt(e)):void(t.silent||s("Cache miss for '%s'",e))},{alias:n,get:u,set:p,remove:yt,clear:r,keys:a}},p=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){return x(t,e)},t.reset(),Object.preventExtensions(t),t},Kt=function(e){var t,n;return e=Ft(e),t=e.parentNode,n=Ut(e.childNodes),b(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},st=function(e){var t,n;for(t=void 0;(e=e.parent())&&e.length;)if(n=e.css("position"),"absolute"===n||"relative"===n||e.is("body")){t=e;break}return t},P=function(e,n){var r,o,u,i;return r=t(e),o=st(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},bt=function(e){var t,n,r,o,u,i,a;for(i=wt(e),t=[],a=i.split("&"),n=0,r=a.length;r>n;n++)u=a[n],q(u)&&(o=u.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},wt=function(e){var n;return e?(n=t.param(e),n=n.replace(/\+/g,"%20")):""},w=function(){var n,r,o,u,i;throw r=1<=arguments.length?e.call(arguments,0):[],(u=up.log).error.apply(u,r),o=(i=up.browser).sprintf.apply(i,r),n=ht(t(".up-error"))||t('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},mt=function(e,n){var r,o;return r=t(e),o=r.data(n),r.removeData(n),o},{requestDataAsArray:bt,requestDataAsQuery:wt,offsetParent:st,fixedToAbsolute:P,presentAttr:vt,createElement:h,parseUrl:dt,normalizeUrl:it,normalizeMethod:ut,createElementFromHtml:v,$createElementFromSelector:n,$createPlaceholder:r,selectorForElement:Pt,extend:x,copy:d,merge:et,options:ft,option:pt,error:w,each:b,map:G,times:Ct,any:i,all:u,detect:y,select:Tt,reject:gt,intersect:D,compact:c,uniq:Rt,last:B,isNull:L,isDefined:O,isUndefined:Q,isGiven:M,isMissing:z,isPresent:q,isBlank:A,presence:ht,isObject:W,isFunction:R,isString:_,isElement:F,isJQuery:K,isPromise:N,isDeferred:U,isHash:j,isUnmodifiedKeyEvent:V,isUnmodifiedMouseEvent:J,nullJQuery:at,unJQuery:Ft,nextFrame:rt,measure:Y,temporaryCss:Dt,cssAnimate:g,finishCssAnimate:T,forceCompositing:E,escapePressed:k,copyAttributes:m,findWithSelf:$,contains:f,isArray:C,toArray:Ut,castedAttr:s,locationFromXhr:X,titleFromXhr:At,methodFromXhr:tt,clientSize:l,only:ct,except:S,trim:Ot,unresolvableDeferred:Mt,unresolvablePromise:jt,resolvedPromise:xt,resolvedDeferred:St,resolvableWhen:kt,setMissingAttrs:Et,remove:yt,memoize:Z,scrollbarWidth:$t,config:p,cache:a,unwrapElement:Kt,multiSelector:nt,error:w,pluckData:mt}}($),up.error=up.util.error}.call(this),function(){var e=[].slice;up.log=function(){var t,n,r,o,u,i;return o=function(e){return"\u1d1c\u1d18 "+e},t=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["debug",o(n)].concat(e.call(t))):void 0},u=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["log",o(n)].concat(e.call(t))):void 0},i=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["warn",o(n)].concat(e.call(t))):void 0},r=function(){var t,n,r,u;if(r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),!r)return n();(u=up.browser).puts.apply(u,["groupCollapsed",o(r)].concat(e.call(t)));try{return n()}finally{r&&console.groupEnd()}},n=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["error",o(n)].concat(e.call(t))):void 0},{puts:u,debug:t,error:n,warn:i,group:r}}(jQuery),up.puts=up.log.puts}.call(this),function(){var e=[].slice;up.browser=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b;return y=up.util,m=function(e,n){var r,o,u,i,a;return null==n&&(n={}),i=y.option(n.method,"get").toLowerCase(),"get"===i?(a=y.requestDataAsQuery(n.data),a&&(e=e+"?"+a),location.href=e):(r=t("<form method='post' action='"+e+"'></form>"),o=function(e){var n;return n=t('<input type="hidden">'),n.attr(e.name,e.value),n.appendTo(r)},o({name:up.proxy.config.wrapMethodParam,value:i}),(u=up.rails.csrfField())&&o(u),y.each(y.requestDataAsArray(n.data),o),r.hide().appendTo("body"),r.submit())},v=function(){var t,n,r;return r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],y.isDefined(console[r])||(r="log"),u()?console[r].apply(console,t):(n=g.apply(null,t),console[r](n))},n=/\%[odisf]/g,g=function(){var t,r,o,u;return u=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r=0,o=80,u.replace(n,function(){var e,n;return e=t[r],n=typeof e,"string"===n?(e=e.replace(/\s+/g," "),e.length>o&&(e=e.substr(0,o)+"\u2026"),e='"'+e+'"'):e="undefined"===n?"undefined":"number"===n||"function"===n?e.toString():JSON.stringify(e),e.length>o&&(e=e.substr(0,o)+" \u2026",("object"===n||"function"===n)&&(e+=" }")),r+=1,e})},b=function(){return location.href},c=y.memoize(function(){return y.isUndefined(document.addEventListener)}),p=y.memoize(function(){return c()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),i=y.memoize(function(){return y.isDefined(history.pushState)&&"get"===s()}),r=y.memoize(function(){return"transition"in document.documentElement.style}),o=y.memoize(function(){return"oninput"in document.createElement("input")}),u=y.memoize(function(){return!p()}),f=y.memoize(function(){var e,n,r,o;return o=t.fn.jquery,r=o.split("."),e=parseInt(r[0]),n=parseInt(r[1]),e>=2||1===e&&n>=9}),h=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,y.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},a=function(e){return y.isBlank(e)||a(e)?y.resolvedPromise():y.unresolvablePromise()},s=y.memoize(function(){return(h("_up_request_method")||"get").toLowerCase()}),d=function(){return!c()&&f()},l=function(){return console.group||(console.group=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["group"].concat(e.call(t)))}),console.groupCollapsed||(console.groupCollapsed=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["groupCollapsed"].concat(e.call(t)))}),console.groupEnd||(console.groupEnd=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["groupEnd"].concat(e.call(t)))})},{url:b,loadPage:m,confirm:a,canPushState:i,canCssTransition:r,canInputEvent:o,canLogSubstitution:u,isSupported:d,installPolyfills:l,puts:v,sprintf:g}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,emit,emitReset,forgetUpDescription,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,restoreSnapshot,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,upListenerToJqueryListener=function(e){return function(t){var n;return n=t.$element||$(this),e.apply(n.get(0),[t,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(e,t){var n,r,o;return n=u.copy(e),o=n.pop(),r=void 0,t?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||u.error("up.off: The event listener %o was never registered through up.on")),n.push(r),n},live=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(e=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(t=$(document)).on.apply(t,e),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],e=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(t=$(document)).off.apply(t,e)},rememberUpDescription=function(e){var t;return t=upDescriptionNumber(e),liveUpDescriptions[t]=e},forgetUpDescription=function(e){var t;return t=upDescriptionNumber(e),delete liveUpDescriptions[t]},upDescriptionNumber=function(e){return u.last(e)._descriptionNumber},emit=function(e,t){var n,r;return null==t&&(t={}),r=$.Event(e,t),(n=t.$element)?delete t.$element:n=$(document),logEmission(e,t),n.trigger(r),r},logEmission=function(e,t){var n,r,o;return t.hasOwnProperty("message")?(n=t.message,delete t.message,u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n?u.isPresent(t)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[e],[t])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[e])):void 0):u.isPresent(t)?up.puts("Emitted event %s (%o)",e,t):up.puts("Emitted event %s",e)},nobodyPrevents=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=emit.apply(null,e),t.isDefaultPrevented()?(up.puts("An observer prevented the event %s",e[0]),!1):!0},onEscape=function(e){return live("keydown","body",function(t){return u.escapePressed(t)?e(t):void 0})},snapshot=function(){var e,t,n,r;for(r=[],t=0,n=liveUpDescriptions.length;n>t;t++)e=liveUpDescriptions[t],r.push(e.isDefault=!0);return r},restoreSnapshot=function(){var e,t,n,r,o;for(t=u.reject(liveUpDescriptions,function(e){return e.isDefault}),o=[],n=0,r=t.length;r>n;n++)e=t[n],o.push(unbind.apply(null,e));return o},emitReset=function(){return up.emit("up:framework:reset",{message:"Resetting framework"})},boot=function(){return up.browser.isSupported()?(up.browser.installPolyfills(),up.emit("up:framework:boot",{message:"Booting framework"})):void 0},live("up:framework:boot",snapshot),live("up:framework:reset",restoreSnapshot),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,onEscape:onEscape,emitReset:emitReset,boot:boot}}(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(){var e=[].slice;up.syntax=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n="up-destroyable",r="up-destroyer",l=[],d=[],s=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],p.apply(null,[l].concat(e.call(t)))},f=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],p.apply(null,[d].concat(e.call(t)))},u=function(){var t,n,r,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),r=v.options(t[0],{priority:0}),{selector:o,callback:n,priority:r.priority,batch:r.batch,keep:r.keep}},p=function(){var t,n,r,o,i;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],up.browser.isSupported()){for(r=u.apply(null,t),n=0;(o=i[n])&&o.priority<=r.priority;)n+=1;return i.splice(n,0,r)}},o=function(e,t,o){var u,i;return up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,o),e.keep&&(i=v.isString(e.keep)?e.keep:"",t.attr("up-keep",i)),u=e.callback.apply(o,[t,c(t)]),v.isFunction(u)?(t.addClass(n),t.data(r,u)):void 0},a=function(e,n){var r;return n=v.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,u,i,a,c,p;for(c=[d,l],p=[],u=0,i=c.length;i>u;u++)a=c[u],p.push(function(){var u,i,l;for(l=[],u=0,i=a.length;i>u;u++)s=a[u],n=v.findWithSelf(e,s.selector),n=n.filter(function(){var e;return e=t(this),v.all(r,function(t){return 0===e.closest(t).length})}),l.push(n.length?up.log.group(s.isDefault?void 0:"Compiling '%s' on %d element(s)",s.selector,n.length,function(){return s.batch?o(s,n,n.get()):n.each(function(){return o(s,t(this),this)})}):void 0);return l}());return p})},i=function(e){return v.findWithSelf(e,"."+n).each(function(){var e,n;return e=t(this),(n=e.data(r))()})},c=function(e){var n,r;return n=t(e),r=n.attr("up-data"),v.isString(r)&&""!==v.trim(r)?JSON.parse(r):{}},h=function(){var e,t,n;for(n=[],e=0,t=l.length;t>e;e++)s=l[e],n.push(s.isDefault=!0);return n},m=function(){return l=v.select(l,function(e){return e.isDefault})},up.on("up:framework:boot",h),up.on("up:framework:reset",m),{compiler:s,macro:f,compile:a,clean:i,data:c}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(e){var t,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=void 0,i=void 0},a=function(e){return v.normalizeUrl(e,{hash:!0})},r=function(){return a(up.browser.url())},o=function(e){return a(e)===r()},s=function(e){return i&&(c=i,i=void 0),i=e},d=function(e,t){return u("replace",e,t)},p=function(e,t){return up.puts("Current location is now %s",e),u("push",e,t)},u=function(e,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=e+"State",a=t(),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},t=function(){return{fromUp:!0}},h=function(e){var t;return(null!=e?e.fromUp:void 0)?(t=r(),up.log.group("Restoring URL %s",t,function(){var e;return e=n.popTargets.join(", "),up.replace(e,t,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",e)},l=function(e){return up.log.group("History state popped to URL %s",r(),function(){var t;return s(r()),up.layout.saveScroll({url:c}),t=e.originalEvent.state,h(t)})},up.browser.canPushState()&&(f=function(){return e(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(e){return v.isPresent(c)?(v.setMissingAttrs(e,{"up-href":c,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(e,t,n){var r,o,i,a,s;return r=$(e),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:t},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(t),u.resolvedDeferred())},finishScrolling=function(e){return $(e).each(function(){var e;return(e=$(this).data(SCROLL_PROMISE_KEY))?e.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var e,t,n,r;return n=function(e,t){var n,r;return n=$(e),r=n.css(t),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %s",n.get(0),t),parseInt(r)+n.height()},t=function(){var e,t,o,u;for(o=$(config.fixedTop.join(", ")),u=[],e=0,t=o.length;t>e;e++)r=o[e],u.push(n(r,"top"));return u}(),e=function(){var e,t,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],e=0,t=o.length;t>e;e++)r=o[e],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(t))),bottom:Math.max.apply(Math,[0].concat(slice.call(e)))}},reveal=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(e),up.puts("Revealing fragment %o",e.get(0)),t=u.options(t),r=t.viewport?$(t.viewport):viewportOf(n),m=u.option(t.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||t.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,t):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(e){var t,n;return t=$(e),n=viewportSelector().seekUp(t),n.length||u.error("Could not find viewport for %o",t),n},viewportsWithin=function(e){var t;return t=$(e),viewportSelector().findWithSelf(t)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var e,t,n,r,o,u,i;for(u={},o=config.viewports,t=0,r=o.length;r>t;t++)i=o[t],e=$(i),e.length&&(n=i,i===document&&(n="document"),u[n]=e.scrollTop());return u},fixedChildren=function(e){var t,n;return null==e&&(e=void 0),e||(e=document.body),n=$(e),t=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(t=t.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(t=t.add(n.find(config.fixedBottom.join(", ")))),t},saveScroll=function(e){var t,n;return null==e&&(e={}),n=u.option(e.url,up.history.url()),t=u.option(e.tops,scrollTops()),up.puts("Saving scroll positions for URL %s (%o)",n,t),lastScrollTops.set(n,t)},restoreScroll=function(e){var t,n,r,o,i;return null==e&&(e={}),i=up.history.url(),r=void 0,e.around?(n=viewportsWithin(e.around),t=viewportOf(e.around),r=t.add(n)):r=viewports(),o=lastScrollTops.get(i),up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var e,t,n,i;for(t in o)i=o[t],n="document"===t?document:t,e=r.filter(n),scroll(e,i,{duration:0});return u.resolvedDeferred()})},revealOrRestoreScroll=function(e,t){var n,r,o,i;return n=$(e),t.restoreScroll?restoreScroll({around:n}):t.reveal?(t.source&&(i=u.parseUrl(t.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function($){var autofocus,destroy,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,findOldFragment,first,hello,isRealElement,oldFragmentNotFound,parseImplantSteps,parseResponse,processResponse,reload,replace,resolveSelector,setSource,source,swapElements,transferKeepableElements,u,updateHistory;return u=up.util,setSource=function(e,t){var n;return n=$(e),u.isPresent(t)&&(t=u.normalizeUrl(t)),n.attr("up-source",t)},source=function(e){var t;return t=$(e).closest("[up-source]"),u.presence(t.attr("up-source"))||up.browser.url()},resolveSelector=function(e,t){var n,r;return u.isString(e)?(r=e,u.contains(r,"&")&&(t?(n=u.selectorForElement(t),r=r.replace(/\&/,n)):u.error("Found origin reference (%s) in selector %s, but options.origin is missing","&",r))):r=u.selectorForElement(e),r},replace=function(e,t,n){var r,o,i,a;return up.puts("Replacing %s from %s (%o)",e,t,n),n=u.options(n),a=resolveSelector(e,n.origin),r=u.option(n.failTarget,"body"),r=resolveSelector(r,n.origin),up.browser.canPushState()||n.history===!1?(i={url:t,method:n.method,data:n.data,target:a,failTarget:r,cache:n.cache,preload:n.preload,headers:n.headers},o=up.ajax(i),o.done(function(e,r,o){return processResponse(!0,a,t,i,o,n)}),o.fail(function(e){return processResponse(!1,r,t,i,e,n)}),o):(n.preload||up.browser.loadPage(t,u.only(n,"method","data")),u.unresolvablePromise())},processResponse=function(e,t,n,r,o,i){var a,s,l,c;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),i.title=u.option(u.titleFromXhr(o),i.title),a="GET"===i.method,(c=u.locationFromXhr(o))?(n=c,e&&(s={url:n,method:u.methodFromXhr(o),target:t},up.proxy.alias(r,s))):a&&(l=u.requestDataAsQuery(i.data))&&(n=n+"?"+l),e?a?(i.history===!1||u.isString(i.history)||(i.history=n),i.source===!1||u.isString(i.source)||(i.source=n)):(u.isString(i.history)||(i.history=!1),u.isString(i.source)||(i.source="keep")):(i.transition=i.failTransition,i.failTransition=void 0,a?(i.history!==!1&&(i.history=n),i.source!==!1&&(i.source=n)):(i.source="keep",i.history=!1)),i.preload?u.resolvedPromise():extract(t,o.responseText,i)},extract=function(e,t,n){return up.log.group("Extracting %s from %d bytes of HTML",e,null!=t?t.length:void 0,function(){var r,o,i,a,s,l,c,p;for(n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0}),c=resolveSelector(e,n.origin),l=parseResponse(t,n),n.title||(n.title=l.title()),n.saveScroll!==!1&&up.layout.saveScroll(),"function"==typeof n.beforeSwap&&n.beforeSwap(),r=[],updateHistory(n),a=parseImplantSteps(c,n),o=0,i=a.length;i>o;o++)p=a[o],up.log.group("Updating %s",p.selector,function(){var e,t,o,u;return t=findOldFragment(p.selector,n),e=null!=(u=l.find(p.selector))?u.first():void 0,t&&e?(o=swapElements(t,e,p.pseudoClass,p.transition,n),r.push(o)):void 0});return"function"==typeof n.afterSwap&&n.afterSwap(),(s=up.motion).when.apply(s,r)})},findOldFragment=function(e,t){return first(".up-popup "+e)||first(".up-modal "+e)||first(e)||oldFragmentNotFound(e,t)},oldFragmentNotFound=function(e,t){var n;return t.requireMatch?(n="Could not find selector %s in current body HTML","#"===n[0]&&(n+=" (avoid using IDs)"),u.error(n,e)):void 0},parseResponse=function(e,t){var n;return n=u.createElementFromHtml(e),{title:function(){var e;return null!=(e=n.querySelector("title"))?e.textContent:void 0},find:function(r){var o;return(o=$.find(r,n)[0])?$(o):t.requireMatch?u.error("Could not find selector %s in response %o",r,e):void 0}}},updateHistory=function(e){return e.history?(e.title&&(document.title=e.title),up.history[e.historyMethod](e.history)):void 0},swapElements=function(e,t,n,r,o){var i,a,s,l;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(e)})),up.motion.finish(e),n?(i=t.contents().wrap('<span class="up-insertion"></span>').parent(),"before"===n?e.prepend(i):e.append(i),hello(i.children(),o),s=up.layout.revealOrRestoreScroll(i,o),s=s.then(function(){return up.animate(i,r,o)
2
- }),s=s.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(e,t,o))?(emitFragmentKept(a),s=u.resolvedPromise()):(l=function(){return o.keepPlans=transferKeepableElements(e,t,o),t.insertBefore(e),o.source!==!1&&setSource(t,o.source),autofocus(t),hello(t,o),up.morph(e,t,r,o)},s=destroy(e,{animation:l})),s},transferKeepableElements=function(e,t,n){var r,o,i,a,s,l,c,p;if(a=[],n.keep)for(p=e.find("[up-keep]"),i=0,l=p.length;l>i;i++)s=p[i],r=$(s),(c=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),r.replaceWith(o),c.$newElement.replaceWith(r),a.push(c));return a},findKeepPlan=function(e,t,n){var r,o,i,a,s;return n.keep&&(r=e,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?t.find(s):u.findWithSelf(t,s),o=o.first(),o.length&&o.is("[up-keep]")&&(i={$element:r,$newElement:o,newData:up.syntax.data(o)},a=u.merge(i,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",a))))?i:void 0},parseImplantSteps=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m;for(d=t.transition||t.animation||"none",n=/\ *,\ */,r=e.split(n),m=u.isString(m)?d.split(n):[d],l=[],o=i=0,a=r.length;a>i;o=++i)c=r[o],p=c.match(/^(.+?)(?:\:(before|after))?$/),p||u.error('Could not parse selector atom "%s"',c),e=p[1],"html"===e&&(e="body"),s=p[2],f=m[o]||u.last(m),l.push({selector:e,pseudoClass:s,transition:f});return l},hello=function(e,t){var n,r,o,i,a,s;for(n=$(e),t=u.options(t,{keepPlans:[]}),o=[],s=t.keepPlans,r=0,i=s.length;i>r;r++)a=s[r],emitFragmentKept(a),o.push(a.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,t),n},emitFragmentInserted=function(e,t){var n;return n=$(e),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:t.origin})},emitFragmentKept=function(e){var t;return t=u.merge(e,{message:["Kept fragment %o",e.$element.get(0)]}),up.emit("up:fragment:kept",t)},autofocus=function(e){var t,n;return n="[autofocus]:last",t=u.findWithSelf(e,n),t.length&&t.get(0)!==document.activeElement?t.focus():void 0},isRealElement=function(e){var t;return t=".up-ghost, .up-destroying",0===e.closest(t).length},first=function(e){var t,n,r,o,i,a;for(o=void 0,o=u.isString(e)?$(e).get():e,n=void 0,i=0,a=o.length;a>i;i++)if(r=o[i],t=$(r),isRealElement(t)){n=t;break}return n},destroy=function(e,t){var n,r,o,i,a;return n=$(e),n.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")||(i=["Destroying fragment %o",n.get(0)],a=["Destroyed fragment %o",n.get(0)]),up.bus.nobodyPrevents("up:fragment:destroy",{$element:n,message:i})?(t=u.options(t,{animation:!1}),r=up.motion.animateOptions(t),n.addClass("up-destroying"),u.isPresent(t.url)&&up.history.push(t.url),u.isPresent(t.title)&&(document.title=t.title),o=u.presence(t.animation,u.isDeferred)||up.motion.animate(n,t.animation,r),o.then(function(){return up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:a}),n.remove()}),o):$.Deferred()},reload=function(e,t){var n;return t=u.options(t,{cache:!1}),n=t.url||source(e),replace(e,n,t)},up.on("ready",function(){var e;return e=$(document.body),setSource(e,up.browser.url()),hello(e)}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello}}(jQuery),up.replace=up.flow.replace,up.extract=up.flow.extract,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first,up.hello=up.flow.hello}.call(this),function(){up.motion=function(e){var t,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T;return $=up.util,u={},s={},x={},l={},a=$.config({duration:300,delay:0,easing:"ease",enabled:!0}),y=function(){return u=$.copy(s),x=$.copy(l),a.reset()},m=function(){return a.enabled&&up.browser.canCssTransition()},n=function(t,o,u){var a;return a=e(t),f(a),u=r(u),"none"===o||o===!1?v():$.isFunction(o)?i(o(a,u),o):$.isString(o)?n(a,p(o),u):$.isHash(o)?m()?$.cssAnimate(a,o,u):(a.css(o),$.resolvedDeferred()):$.error("Unknown animation type for %o",o)},r=function(e,t){var n;return null==t&&(t=null),e=$.options(e),n={},n.easing=$.option(e.easing,null!=t?t.attr("up-easing"):void 0,a.easing),n.duration=Number($.option(e.duration,null!=t?t.attr("up-duration"):void 0,a.duration)),n.delay=Number($.option(e.delay,null!=t?t.attr("up-delay"):void 0,a.delay)),n},p=function(e){return u[e]||$.error("Unknown animation %o",e)},t="up-ghosting-deferred",T=function(e,n,r,o){var u,i,a,s,l,c,p;return l=void 0,a=void 0,c=void 0,s=void 0,u=up.layout.viewportOf(e),$.temporaryCss(n,{display:"none"},function(){return l=g(e,u),c=u.scrollTop()}),$.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),a=g(n,u),s=u.scrollTop()}),l.moveTop(s-c),e.hide(),p=$.temporaryCss(n,{opacity:"0"}),i=o(l.$ghost,a.$ghost),e.data(t,i),n.data(t,i),i.then(function(){return e.removeData(t),n.removeData(t),p(),l.$bounds.remove(),a.$bounds.remove()}),i},f=function(t){var n;return n=e(t),$.finishCssAnimate(n),d(n)},d=function(n){return n.each(function(){var n,r;return n=e(this),(r=$.pluckData(n,t))?r.resolve():void 0})},i=function(e,t){return $.isDeferred(e)?e:$.error("Did not return a promise with .then and .resolve methods: %o",t)},h=function(t,o,a,s){var l,p;return"none"===a&&(a=!1),p=e(t),l=e(o),c(p,a),c(l,a),up.log.group(a?"Morphing %o to %o (using %s)":void 0,p.get(0),l.get(0),a,function(){var e,t,o,c;return t=$.only(s,"reveal","restoreScroll","source"),t=$.extend(t,r(s)),m()?(f(p),f(l),a?(e=u[a])?(w(p,l,t),n(l,e,t)):(c=$.presence(a,$.isFunction)||x[a])?T(p,l,t,function(e,n){var r;return r=c(e,n,t),i(r,a)}):$.isString(a)&&a.indexOf("/")>=0?(o=a.split("/"),c=function(e,t,r){return b(n(e,o[0],r),n(t,o[1],r))},h(p,l,c,t)):$.error("Unknown transition %o",a):w(p,l,t)):w(p,l,t)})},c=function(e,t){var n;return t&&0===e.parents("body").length?(n=e.get(0),$.error("Can't morph a <%s> element (%o)",n.tagName,n)):void 0},w=function(e,t,n){return e.hide(),up.layout.revealOrRestoreScroll(t,n)},g=function(t,n){var r,o,u,i,a,s,l,c,p;for(i=$.measure(t,{relative:!0,inner:!0}),u=t.clone(),u.find("script").remove(),u.css({position:"static"===t.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),p=i.top,c=function(e){return 0!==e?(p+=e,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(t),c(t.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],$.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},S=function(e,t){return x[e]=t},o=function(e,t){return u[e]=t},k=function(){return s=$.copy(u),l=$.copy(x)},b=$.resolvableWhen,v=$.resolvedDeferred,o("none",v),o("fade-in",function(e,t){return e.css({opacity:0}),n(e,{opacity:1},t)}),o("fade-out",function(e,t){return e.css({opacity:1}),n(e,{opacity:0},t)}),o("move-to-top",function(e,t){var r,o;return r=$.measure(e),o=r.top+r.height,e.css({"margin-top":"0px"}),n(e,{"margin-top":"-"+o+"px"},t)}),o("move-from-top",function(e,t){var r,o;return r=$.measure(e),o=r.top+r.height,e.css({"margin-top":"-"+o+"px"}),n(e,{"margin-top":"0px"},t)}),o("move-to-bottom",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().height-r.top,e.css({"margin-top":"0px"}),n(e,{"margin-top":o+"px"},t)}),o("move-from-bottom",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().height-r.top,e.css({"margin-top":o+"px"}),n(e,{"margin-top":"0px"},t)}),o("move-to-left",function(e,t){var r,o;return r=$.measure(e),o=r.left+r.width,e.css({"margin-left":"0px"}),n(e,{"margin-left":"-"+o+"px"},t)}),o("move-from-left",function(e,t){var r,o;return r=$.measure(e),o=r.left+r.width,e.css({"margin-left":"-"+o+"px"}),n(e,{"margin-left":"0px"},t)}),o("move-to-right",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().width-r.left,e.css({"margin-left":"0px"}),n(e,{"margin-left":o+"px"},t)}),o("move-from-right",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().width-r.left,e.css({"margin-left":o+"px"}),n(e,{"margin-left":"0px"},t)}),o("roll-down",function(e,t){var r,o;return r=e.height(),o=$.temporaryCss(e,{height:"0px",overflow:"hidden"}),n(e,{height:r+"px"},t).then(o)}),S("none",v),S("move-left",function(e,t,r){return b(n(e,"move-to-left",r),n(t,"move-from-right",r))}),S("move-right",function(e,t,r){return b(n(e,"move-to-right",r),n(t,"move-from-left",r))}),S("move-up",function(e,t,r){return b(n(e,"move-to-top",r),n(t,"move-from-bottom",r))}),S("move-down",function(e,t,r){return b(n(e,"move-to-bottom",r),n(t,"move-from-top",r))}),S("cross-fade",function(e,t,r){return b(n(e,"fade-out",r),n(t,"fade-in",r))}),up.on("up:framework:boot",k),up.on("up:framework:reset",y),{morph:h,animate:n,animateOptions:r,finish:f,transition:S,animation:o,config:a,isEnabled:m,defaults:function(){return $.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:v,when:b,prependCopy:g}}(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 e=[].slice;up.proxy=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T,P,E,D,C,A,U,O,F,R;return R=up.util,n=void 0,P=void 0,i=void 0,x=void 0,a=void 0,D=[],m=R.config({busyDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],wrapMethodParam:"_method",safeMethods:["GET","OPTIONS","HEAD"]}),l=function(e){return S(e),[e.url,e.method,e.data,e.target].join("|")},s=R.cache({size:function(){return m.cacheSize},expiry:function(){return m.cacheExpiry},key:l}),h=function(e){var t,n,r,o,u,i,a;for(e=S(e),n=[e],"html"!==e.target&&(i=R.merge(e,{target:"html"}),n.push(i),"body"!==e.target&&(u=R.merge(e,{target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(t=n[r],a=s.get(t))return a},O=s.set,C=s.remove,d=s.clear,p=function(){return clearTimeout(P),P=null},c=function(){return clearTimeout(i),i=null},A=function(){return n=null,p(),c(),x=0,m.reset(),a=!1,s.clear(),D=[]},A(),o=s.alias,S=function(e){return e._normalized||(e.method=R.normalizeMethod(e.method),e.url&&(e.url=R.normalizeUrl(e.url)),e.target||(e.target="body"),e._normalized=!0),e},r=function(e){var t,n,r,o,u;return t=e.cache===!0,n=e.cache===!1,u=R.only(e,"url","method","data","target","headers","_normalized"),u=S(u),r=!0,g(u)||t?(o=h(u))&&!n?(up.puts("Re-using cached response for %s %s",u.method,u.url),r="pending"===o.state()):(o=w(u),O(u,o),o.fail(function(){return C(u)})):(d(),o=w(u)),r&&!e.preload&&(k(),o.always(b)),console.groupEnd(),o},v=function(){return 0===x},u=function(){return x>0},k=function(){var e,t;return t=v(),x+=1,t?(e=function(){return u()?(up.emit("up:proxy:busy",{message:"Proxy is busy"}),a=!0):void 0},m.busyDelay>0?i=setTimeout(e,m.busyDelay):e()):void 0},b=function(){return x-=1,v()&&a?(up.emit("up:proxy:idle",{message:"Proxy is idle"}),a=!1):void 0},w=function(e){return x<m.maxRequests?y(e):E(e)},E=function(e){var n,r;return up.puts("Queuing request for %s %s",e.method,e.url),n=t.Deferred(),r={deferred:n,request:e},D.push(r),n.promise()},y=function(e){var n;return up.emit("up:proxy:load",R.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=R.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,e.data=R.requestDataAsArray(e.data),R.contains(m.wrapMethods,e.method)&&(e.data.push({name:m.wrapMethodParam,value:e.method}),e.method="POST"),n=t.ajax(e),n.done(function(t,n,r){return U(e,r)}),n.fail(function(t){return U(e,t)}),n},U=function(e,t){var n;return up.emit("up:proxy:received",R.merge(e,{message:["Server responded with %s %s (%d bytes)",t.status,t.statusText,null!=(n=t.responseText)?n.length:void 0]})),$()},$=function(){var t,n;return(t=D.shift())?(n=y(t.request),n.done(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).resolve.apply(r,n)}),n.fail(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).reject.apply(r,n)})):void 0},g=function(e){return S(e),R.contains(m.safeMethods,e.method)},f=function(e){var t,r;return r=parseInt(R.presentAttr(e,"up-delay"))||m.preloadDelay,e.is(n)?void 0:(n=e,p(),t=function(){return T(e),n=null},F(t,r))},F=function(e,t){return P=setTimeout(e,t)},T=function(e,n){var r,o;return r=t(e),n=R.options(n),o=up.link.followMethod(r,n),g({method:o})?up.log.group("Preloading link %o",r,function(){return n.preload=!0,up.follow(r,n)}):(up.puts("Won't preload %o due to unsafe method %s",r,o),R.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(e,t){return up.link.childClicked(e,t)?void 0:f(t)}),up.on("up:framework:reset",A),{preload:T,ajax:r,get:h,alias:o,clear:d,remove:C,idle:v,busy:u,config:m,defaults:function(){return R.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery),up.ajax=up.proxy.ajax}.call(this),function(){up.link=function($){var allowDefault,childClicked,follow,followMethod,followVariantSelectors,isFollowable,makeFollowable,onAction,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(e,t){var n;return t=u.options(t),n=u.option(t.target,"body"),up.replace(n,e,t)},follow=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(t.target,n.attr("up-target"),"body"),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"),"body"),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.history=u.option(t.history,u.castedAttr(n,"up-history")),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.method=followMethod(n,t),t.origin=u.option(t.origin,n),t.confirm=u.option(t.confirm,n.attr("up-confirm")),t=u.merge(t,up.motion.animateOptions(t,n)),up.browser.confirm(t.confirm).then(function(){return up.replace(r,o,t)})},followMethod=function(e,t){var n;return n=$(e),t=u.options(t),u.option(t.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},childClicked=function(e,t){var n,r;return n=$(e.target),r=n.closest("a, [up-href]"),r.length&&t.find(r).length},shouldProcessLinkEvent=function(e,t){return u.isUnmodifiedMouseEvent(e)&&!childClicked(e,t)},followVariantSelectors=[],allowDefault=function(){},onAction=function(e,t){return followVariantSelectors.push(e),up.on("click","a"+e+", [up-href]"+e,function(e,n){return shouldProcessLinkEvent(e,n)?n.is("[up-instant]")?e.preventDefault():(e.preventDefault(),t(n)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,n){return shouldProcessLinkEvent(e,n)?(e.preventDefault(),t(n)):void 0})},isFollowable=function(e){return u.any(followVariantSelectors,function(t){return e.is(t)})},makeFollowable=function(e){var t;return t=$(e),isFollowable(t)?void 0:t.attr("up-follow","")},onAction("[up-target]",function(e){return follow(e)}),onAction("[up-follow]",function(e){return follow(e)}),up.macro("[up-expand]",function(e){var t,n,r,o,i,a,s,l,c,p;if(t=e.find("a, [up-href]"),(c=e.attr("up-expand"))&&(t=t.filter(c)),i=t.get(0)){for(p=/^up-/,s={},s["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],a=n.name,a.match(p)&&(s[a]=n.value);return u.setMissingAttrs(e,s),e.removeAttr("up-expand"),makeFollowable(e)}}),up.macro("[up-dash]",function(e){var t,n;return n=u.castedAttr(e,"up-dash"),t={"up-preload":"true","up-instant":"true"},n===!0?t["up-follow"]="":t["up-target"]=n,u.setMissingAttrs(e,t),e.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,shouldProcessLinkEvent:shouldProcessLinkEvent,childClicked:childClicked,followMethod:followMethod,onAction:onAction}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,currentValuesForSwitch,observe,observeForm,reset,resolveValidateTarget,submit,switchTargets,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},submit=function(e,t){var n,r,o,i,a;return n=$(e).closest("form"),t=u.options(t),i=u.option(t.target,n.attr("up-target"),"body"),a=u.option(t.url,n.attr("action"),up.browser.url()),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),t.history=u.option(t.history,u.castedAttr(n,"up-history"),!0),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.method=u.option(t.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),t.headers=u.option(t.headers,{}),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.origin=u.option(t.origin,n),t.data=n.serializeArray(),t=u.merge(t,up.motion.animateOptions(t,n)),r=n.find("input[type=file]").length,t.validate&&(t.headers||(t.headers={}),t.headers["X-Up-Validate"]=t.validate,r)?u.unresolvablePromise():(n.addClass("up-active"),r||!up.browser.canPushState()&&t.history!==!1?(n.get(0).submit(),u.unresolvablePromise()):(o=up.replace(i,a,t),o.always(function(){return n.removeClass("up-active")}),o))},observe=function(){var $element,args,callback,callbackArg,callbackPromise,callbackTimer,changeEvents,check,clearTimer,delay,knownValue,nextCallback,options,rawCallback,runNextCallback,selectorOrElement;return selectorOrElement=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===args.length&&(callbackArg=args[0]),args.length>1&&(options=u.options(args[0]),callbackArg=args[1]),$element=$(selectorOrElement),options=u.options(options),delay=u.option($element.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),callback=null,u.isGiven(options.change)&&u.error("up.observe now takes the change callback as the last argument"),rawCallback=u.option(u.presentAttr($element,"op-observe"),callbackArg),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||u.error("up.observe: No change callback given"),$element.is("form")?observeForm($element,options,callback):(knownValue=null,callbackTimer=null,callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var e;return nextCallback?(e=nextCallback(),nextCallback=null,e):void 0},check=function(){var e,t,n;return n=$element.val(),t=u.isNull(knownValue),knownValue===n||(knownValue=n,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($element.get(0),[n,$element])},e=function(){return callbackPromise.then(function(){var e;return e=runNextCallback(),callbackPromise=u.isPromise(e)?e:u.resolvedPromise()})},0===delay?e():setTimeout(e,delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$element.on(changeEvents,check),check(),function(){return $element.off(changeEvents,check),clearTimer()})},observeForm=function(e,t,n){var r,o;return r=u.multiSelector(config.fields).find(e),o=u.map(r,function(e){return observe(e,n)}),function(){var e,t,n,r;for(r=[],t=0,n=o.length;n>t;t++)e=o[t],r.push(e());return r}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),t.addClass("up-active"),submit(n).always(function(){return t.removeClass("up-active")})})},resolveValidateTarget=function(e,t){var n;return n=u.option(t.target,e.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,t.origin),e.closest(r).length}))),u.isBlank(n)&&u.error("Could not find default validation target for %o (tried ancestors %o)",e.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(e,t){var n,r,o;return n=$(e),t=u.options(t),t.origin=n,t.target=resolveValidateTarget(n,t),t.failTarget=t.target,t.history=!1,t.headers=u.option(t.headers,{}),t.validate=n.attr("name")||"__none__",t=u.merge(t,up.motion.animateOptions(t,n)),r=n.closest("form"),o=up.submit(r,t)},currentValuesForSwitch=function(e){var t,n,r;return r=void 0,e.is("input[type=checkbox]")?r=e.is(":checked")?[":checked",":present",e.val()]:[":unchecked",":blank"]:e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),r=t.length?[":checked",":present",t.val()]:[":unchecked",":blank"]):(n=e.val(),r=u.isPresent(n)?[":present",n]:[":blank"]),r},currentValuesForSwitch=function(e){var t,n,r,o;return e.is("input[type=checkbox]")?e.is(":checked")?(r=e.val(),n=":checked"):n=":unchecked":e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),t.length?(n=":checked",r=t.val()):n=":unchecked"):r=e.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(t.target,n.attr("up-switch")),u.isPresent(o)||u.error("No switch target given for %o",n.get(0)),r=currentValuesForSwitch(n),$(o).each(function(){var e,t,n,o;return e=$(this),(t=e.attr("up-hide-for"))?(t=t.split(" "),n=0===u.intersect(r,t).length):(o=(o=e.attr("up-show-for"))?o.split(" "):[":present",":checked"],n=u.intersect(r,o).length>0),e.toggle(n)})},up.on("submit","form[up-target]",function(e,t){return e.preventDefault(),submit(t)}),up.on("change","[up-validate]",function(e,t){return validate(t)}),up.on("change","[up-switch]",function(e,t){return switchTargets(t)}),up.compiler("[up-switch]",function(e){return switchTargets(e)}),up.compiler("[up-observe]",function(e){return observe(e)}),up.compiler("[up-autosubmit]",function(e){return autosubmit(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets}}(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($){var attach,autoclose,close,config,contains,coveredUrl,createFrame,currentUrl,discardHistory,ensureInViewport,isOpen,reset,setPosition,u;return u=up.util,currentUrl=void 0,coveredUrl=function(){return $(".up-popup").attr("up-covered-url")},config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right",history:!1}),reset=function(){return close({animation:!1}),config.reset()},setPosition=function(e,t){var n,r,o;return o=u.measure(e,{full:!0}),r=function(){switch(t){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.top+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return u.error("Unknown position option '%s'",t)}}(),n=$(".up-popup"),n.attr("up-position",t),n.css(r),ensureInViewport(n)},ensureInViewport=function(e){var t,n,r,o,i,a,s;if(n=u.measure(e,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((i=parseInt(e.css("left")))?e.css("left",i-r):(a=parseInt(e.css("right")))&&e.css("right",a+r)),o){if(s=parseInt(e.css("top")))return e.css("top",s-o);if(t=parseInt(e.css("bottom")))return e.css("bottom",t+o)}},discardHistory=function(){var e;return e=$(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},createFrame=function(e,t){var n;return n=u.$createElementFromSelector(".up-popup"),t.sticky&&n.attr("up-sticky",""),n.attr("up-covered-url",up.browser.url()),n.attr("up-covered-title",document.title),u.$createPlaceholder(e,n),n.appendTo(document.body),n},isOpen=function(){return $(".up-popup").length>0},attach=function(e,t){var n,r,o,i;return n=$(e),n.length||u.error("Cannot attach popup to non-existing element %o",e),t=u.options(t),i=u.option(t.url,n.attr("href")),o=u.option(t.target,n.attr("up-popup"),"body"),t.position=u.option(t.position,n.attr("up-position"),config.position),t.animation=u.option(t.animation,n.attr("up-animation"),config.openAnimation),t.sticky=u.option(t.sticky,u.castedAttr(n,"up-sticky")),t.history=up.browser.canPushState()?u.option(t.history,u.castedAttr(n,"up-history"),config.history):!1,t.confirm=u.option(t.confirm,n.attr("up-confirm")),r=up.motion.animateOptions(t,n),up.browser.confirm(t.confirm).then(function(){var e,a;return up.bus.nobodyPrevents("up:popup:open",{url:i,message:"Opening popup"})?(a=isOpen(),a&&close({animation:!1}),t.beforeSwap=function(){return createFrame(o,t)},e=up.replace(o,i,u.merge(t,{animation:!1})),e=e.then(function(){return setPosition(n,t.position)}),a||(e=e.then(function(){return up.animate($(".up-popup"),t.animation,r)})),e=e.then(function(){return up.emit("up:popup:opened",{message:"Popup opened"})})):u.unresolvableDeferred()})},close=function(e){var t,n;return t=$(".up-popup"),t.length?up.bus.nobodyPrevents("up:popup:close",{$element:t})?(e=u.options(e,{animation:config.closeAnimation,url:t.attr("up-covered-url"),title:t.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(t,e),n.then(function(){return up.emit("up:popup:closed",{message:"Popup closed"})}),n):u.unresolvableDeferred():u.resolvedDeferred()},autoclose=function(){return $(".up-popup").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=function(e){var t;return t=$(e),t.closest(".up-popup").length>0},up.link.onAction("[up-popup]",function(e){return e.is(".up-current")?close():attach(e)}),up.on("click","body",function(e){var t;return t=$(e.target),t.closest(".up-popup").length||t.closest("[up-popup]").length?void 0:close()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return currentUrl=n}else if(contains(e.origin))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(e,t){return t.closest(".up-popup").length?(close(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attach,close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:contains,open:function(){return up.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")},isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var autoclose,close,config,contains,coveredUrl,createFrame,currentUrl,discardHistory,follow,isOpen,open,reset,shiftElements,templateHtml,u,unshiftElements,unshifters,visit;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(e){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+e.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),currentUrl=void 0,coveredUrl=function(){return $(".up-modal").attr("up-covered-url")},reset=function(){return close({animation:!1}),currentUrl=void 0,config.reset()},templateHtml=function(){var e;return e=config.template,u.isFunction(e)?e(config):e},discardHistory=function(){var e;return e=$(".up-modal"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},createFrame=function(e,t){var n,r,o;return shiftElements(),o=$(templateHtml()),t.sticky&&o.attr("up-sticky",""),o.attr("up-covered-url",up.browser.url()),o.attr("up-covered-title",document.title),r=o.find(".up-modal-dialog"),u.isPresent(t.width)&&r.css("width",t.width),u.isPresent(t.maxWidth)&&r.css("max-width",t.maxWidth),u.isPresent(t.height)&&r.css("height",t.height),n=o.find(".up-modal-content"),u.$createPlaceholder(e,n),o.appendTo(document.body),o},unshifters=[],shiftElements=function(){var e,t,n,r;return n=u.scrollbarWidth(),e=parseInt($("body").css("padding-right")),t=n+e,r=u.temporaryCss($("body"),{"padding-right":t+"px","overflow-y":"hidden"}),unshifters.push(r),up.layout.anchoredRight().each(function(){var e,t,r,o;return e=$(this),t=parseInt(e.css("right")),r=n+t,o=u.temporaryCss(e,{right:r}),unshifters.push(o)})},unshiftElements=function(){var e,t;for(e=[];t=unshifters.pop();)e.push(t());return e},isOpen=function(){return $(".up-modal").length>0},follow=function(e,t){return t=u.options(t),t.$link=$(e),open(t)},visit=function(e,t){return t=u.options(t),t.url=e,open(t)},open=function(e){var t,n,r,o;return e=u.options(e),t=u.option(e.$link,u.nullJQuery()),o=u.option(e.url,t.attr("up-href"),t.attr("href")),r=u.option(e.target,t.attr("up-modal"),"body"),e.width=u.option(e.width,t.attr("up-width"),config.width),e.maxWidth=u.option(e.maxWidth,t.attr("up-max-width"),config.maxWidth),e.height=u.option(e.height,t.attr("up-height"),config.height),e.animation=u.option(e.animation,t.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky")),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(t,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,t.attr("up-confirm")),n=up.motion.animateOptions(e,t),up.browser.confirm(e.confirm).then(function(){var t,i;return up.bus.nobodyPrevents("up:modal:open",{url:o,message:"Opening modal"})?(i=isOpen(),i&&close({animation:!1}),e.beforeSwap=function(){return createFrame(r,e)},t=up.replace(r,o,u.merge(e,{animation:!1})),i||(t=t.then(function(){return up.animate($(".up-modal"),e.animation,n)})),t=t.then(function(){return up.emit("up:modal:opened",{message:"Modal opened"})})):u.unresolvablePromise()})},close=function(e){var t,n;return t=$(".up-modal"),t.length?up.bus.nobodyPrevents("up:modal:close",{$element:t,message:"Closing modal"})?(e=u.options(e,{animation:config.closeAnimation,url:t.attr("up-covered-url"),title:t.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(t,e),n=n.then(function(){return unshiftElements(),up.emit("up:modal:closed",{message:"Modal closed"})})):u.unresolvableDeferred():u.resolvedDeferred()},autoclose=function(){return $(".up-modal").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=function(e){var t;return t=$(e),t.closest(".up-modal").length>0},up.link.onAction("[up-modal]",function(e){return follow(e)}),up.on("click","body",function(e){var t;return t=$(e.target),t.closest(".up-modal-dialog").length||t.closest("[up-modal]").length?void 0:close()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return currentUrl=n}else if(!up.popup.contains(t)&&contains(e.origin))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(e,t){return t.closest(".up-modal").length?(close(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:contains,source:function(){return up.error("up.modal.source no longer exists. Please use up.popup.url instead.")},isOpen:isOpen}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,u,i,a;return a=up.util,r=a.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out"}),u=function(){return r.reset()},i=function(e,t,n){var r,o,u;return o=a.measure(e),u=a.measure(t),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-u.width),top:o.top-u.height};case"bottom":return{left:o.left+.5*(o.width-u.width),top:o.top+o.height};default:return a.error("Unknown position option '%s'",n)}}(),t.attr("up-position",n),t.css(r)},o=function(e){var t;return t=a.$createElementFromSelector(".up-tooltip"),a.isGiven(e.text)?t.text(e.text):t.html(e.html),t.appendTo(document.body),t},t=function(t,u){var s,l,c,p,f,d,m;return null==u&&(u={}),s=e(t),f=a.option(u.html,s.attr("up-tooltip-html")),m=a.option(u.text,s.attr("up-tooltip")),d=a.option(u.position,s.attr("up-position"),r.position),p=a.option(u.animation,a.castedAttr(s,"up-animation"),r.openAnimation),c=up.motion.animateOptions(u,s),n(),l=o({text:m,html:f}),i(s,l,d),up.animate(l,p,c)
1
+ (function(){window.up={}}).call(this),function(){var e=[].slice;up.util=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T,P,E,D,C,A,U,O,F,R,M,j,K,z,L,I,W,q,N,H,_,Q,V,J,B,X,G,Y,Z,et,tt,nt,rt,ot,ut,it,at,st,lt,ct,pt,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,St,xt,$t,Tt,Pt,Et,Dt,Ct,At,Ut,Ot,Ft,Rt,Mt,jt,Kt;return Z=function(t){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?e.call(arguments,0):[],r?n:(r=!0,n=t.apply(null,o))}},H=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},it=function(e,t){var n,r,o;return n=dt(e),r=n.protocol+"//"+n.hostname,H(n.protocol,n.port)||(r+=":"+n.port),o=n.pathname,"/"!==o[0]&&(o="/"+o),(null!=t?t.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),r+=o,(null!=t?t.hash:void 0)===!0&&(r+=n.hash),(null!=t?t.search:void 0)!==!1&&(r+=n.search),r},dt=function(e){var n;return n=null,_(e)?(n=t("<a>").attr({href:e}).get(0),A(n.hostname)&&(n.href=n.href)):n=Ft(e),n},ut=function(e){return e?e.toUpperCase():"GET"},n=function(e){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;for(v=e.split(/[ >]/),o=null,f=c=0,m=v.length;m>c;f=++c){for(a=v[f],i=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",u=[],p=null,d=0,h=i.length;h>d;d++)switch(s=i[d],s[0]){case".":u.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,u.length&&(l+=' class="'+u.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",n=t(l),r&&n.appendTo(r),0===f&&(o=n),r=n}return o},h=function(e,t){var n;return n=document.createElement(e),q(t)&&(n.innerHTML=t),n},r=function(e,t){var r;return null==t&&(t=document.body),r=n(e),r.addClass("up-placeholder"),r.appendTo(t),r},Pt=function(e){var n,r,o,u,i,a,s,l,c;if(n=t(e),l=void 0,up.puts("Creating selector from element %o",n.get(0)),c=ht(n.attr("up-id")))l="[up-id='"+c+"']";else if(u=ht(n.attr("id")))l="#"+u;else if(s=ht(n.attr("name")))l="[name='"+s+"']";else if(r=ht(ot(n)))for(l="",o=0,a=r.length;a>o;o++)i=r[o],l+="."+i;else l=n.prop("tagName").toLowerCase();return l},ot=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),Tt(n,function(e){return q(e)&&!e.match(/^up-/)})},v=function(e){var t,n,r,o,u,i,a,s,l,c,p,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},i=function(e){return"</"+e+">"},t="(?:.|\\n)*?",u=function(e){return"("+e+")"},f=new RegExp(l("head")+t+l("title")+u(t)+i("title")+t+i("body"),"i"),o=new RegExp(l("body")+u(t)+i("body"),"i"),(r=e.match(o))?(s=document.createElement("html"),n=h("body",r[1]),s.appendChild(n),(p=e.match(f))&&(a=h("head"),s.appendChild(a),c=h("title",p[1]),a.appendChild(c)),s):h("div",e)},x=t.extend,Ot=t.trim,b=function(e,t){var n,r,o,u,i;for(i=[],r=n=0,u=e.length;u>n;r=++n)o=e[r],i.push(t(o,r));return i},G=b,Ct=function(e,t){var n,r,o,u;for(u=[],r=n=0,o=e-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)u.push(t(r));return u},L=function(e){return null===e},Q=function(e){return void 0===e},O=function(e){return!Q(e)},z=function(e){return Q(e)||L(e)},M=function(e){return!z(e)},A=function(e){return z(e)||W(e)&&0===Object.keys(e).length||0===e.length},ht=function(e,t){return null==t&&(t=q),t(e)?e:void 0},q=function(e){return!A(e)},R=function(e){return"function"==typeof e},_=function(e){return"string"==typeof e},I=function(e){return"number"==typeof e},j=function(e){return"object"==typeof e&&!!e},W=function(e){return j(e)||"function"==typeof e},F=function(e){return!(!e||1!==e.nodeType)},K=function(e){return e instanceof jQuery},N=function(e){return W(e)&&R(e.then)},U=function(e){return N(e)&&R(e.resolve)},C=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Ut=function(e){return Array.prototype.slice.call(e)},d=function(e){return C(e)?e.slice():x({},e)},Ft=function(e){return K(e)?e.get(0):e},et=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],x.apply(null,[{}].concat(e.call(t)))},ft=function(e,t){var n,r,o,u;if(o=e?d(e):{},t)for(r in t)n=t[r],u=o[r],M(u)?W(n)&&W(u)&&(o[r]=ft(u,n)):o[r]=n;return o},pt=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],y(t,M)},y=function(e,t){var n,r,o,u;for(u=void 0,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){u=n;break}return u},i=function(e,t){var n,r,o,u;for(u=!1,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){u=!0;break}return u},u=function(e,t){var n,r,o,u;for(u=!0,r=0,o=e.length;o>r;r++)if(n=e[r],!t(n)){u=!1;break}return u},c=function(e){return Tt(e,M)},Rt=function(e){var t;return t={},Tt(e,function(e){return t.hasOwnProperty(e)?!1:t[e]=!0})},Tt=function(e,t){var n;return n=[],b(e,function(e){return t(e)?n.push(e):void 0}),n},gt=function(e,t){return Tt(e,function(e){return!t(e)})},D=function(e,t){return Tt(e,function(e){return f(t,e)})},vt=function(){var t,n,r,o;return t=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=function(){var e,o,u;for(u=[],e=0,o=r.length;o>e;e++)n=r[e],u.push(t.attr(n));return u}(),y(o,q)},rt=function(e){return setTimeout(e,0)},B=function(e){return e[e.length-1]},l=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},$t=Z(function(){var e,n,r;return e=t("<div>").css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),e.appendTo(document.body),n=e.get(0),r=n.offsetWidth-n.clientWidth,e.remove(),r}),lt=function(t){var n;return n=void 0,function(){var r;return r=1<=arguments.length?e.call(arguments,0):[],null!=t&&(n=t.apply(null,r)),t=void 0,n}},Dt=function(e,t,n){var r,o;return o=e.css(Object.keys(t)),e.css(t),r=function(){return e.css(o)},n?(n(),r()):lt(r)},E=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),A(n)||"none"===n.transform?(t=function(){return e.css(n)},e.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):t=function(){},t},g=function(e,n,r){var u,i,a,s,l,c;return u=t(e),r=ft(r,{duration:300,delay:0,easing:"ease"}),i=t.Deferred(),s={"transition-property":Object.keys(n).join(", "),"transition-duration":r.duration+"ms","transition-delay":r.delay+"ms","transition-timing-function":r.easing},l=E(u),c=Dt(u,s),u.css(n),i.then(l),i.then(c),u.data(o,i),i.then(function(){return u.removeData(o)}),a=setTimeout(function(){return i.resolve()},r.duration+r.delay),i.then(function(){return clearTimeout(a)}),i},o="up-animation-deferred",T=function(e){return t(e).each(function(){var e;return(e=mt(this,o))?e.resolve():void 0})},Y=function(e,n){var r,o,u,i,a,s;return n=ft(n,{relative:!1,inner:!1,full:!1}),n.relative?n.relative===!0?i=e.position():(r=t(n.relative),a=e.offset(),r.is(document)?i=a:(u=r.offset(),i={left:a.left-u.left,top:a.top-u.top})):i=e.offset(),o={left:i.left,top:i.top},n.inner?(o.width=e.width(),o.height=e.height()):(o.width=e.outerWidth(),o.height=e.outerHeight()),n.full&&(s=l(),o.right=s.width-(o.left+o.width),o.bottom=s.height-(o.top+o.height)),o},m=function(e,t){var n,r,o,u,i;for(u=e.get(0).attributes,i=[],r=0,o=u.length;o>r;r++)n=u[r],i.push(n.specified?t.attr(n.name,n.value):void 0);return i},$=function(e,t){return e.find(t).addBack(t)},k=function(e){return 27===e.keyCode},f=function(e,t){return e.indexOf(t)>=0},s=function(e,t){var n;switch(n=e.attr(t)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},X=function(e){return e.getResponseHeader("X-Up-Location")},At=function(e){return e.getResponseHeader("X-Up-Title")},tt=function(e){return e.getResponseHeader("X-Up-Method")},ct=function(){var t,n,r,o,u,i;for(o=arguments[0],u=2<=arguments.length?e.call(arguments,1):[],t={},n=0,r=u.length;r>n;n++)i=u[n],o.hasOwnProperty(i)&&(t[i]=o[i]);return t},S=function(){var t,n,r,o,u,i;for(o=arguments[0],u=2<=arguments.length?e.call(arguments,1):[],t=d(o),n=0,r=u.length;r>n;n++)i=u[n],delete t[i];return t},V=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},J=function(e){var t;return t=Q(e.button)||0===e.button,t&&V(e)},St=function(){var e;return e=t.Deferred(),e.resolve(),e},xt=function(){return St().promise()},Mt=function(){return t.Deferred()},jt=function(){return Mt().promise()},at=function(){return t()},kt=function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],r=t.when.apply(t,[St()].concat(e.call(n))),r.resolve=Z(function(){return b(n,function(e){return e.resolve()})}),r},Et=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],r.push(z(e.attr(n))?e.attr(n,o):void 0);return r},yt=function(e,t){var n;return n=e.indexOf(t),n>=0?(e.splice(n,1),t):void 0},nt=function(e){var n,r,o,u,a,s,l;for(a={},l=[],r=[],o=0,u=e.length;u>o;o++)s=e[o],_(s)?l.push(s):r.push(s);return a.parsed=r,l.length&&(n=l.join(", "),a.parsed.push(n)),a.select=function(){return a.find(void 0)},a.find=function(e){var n,r,o,u,i,s;for(r=at(),i=a.parsed,o=0,u=i.length;u>o;o++)s=i[o],n=e?e.find(s):t(s),r=r.add(n);return r},a.findWithSelf=function(e){var t;return t=a.find(e),a.doesMatch(e)&&(t=t.add(e)),t},a.doesMatch=function(e){var n;return n=t(e),i(a.parsed,function(e){return n.is(e)})},a.seekUp=function(e){var n,r,o;for(o=t(e),n=o,r=void 0;n.length;){if(a.doesMatch(n)){r=n;break}n=n.parent()}return r||at()},a},a=function(t){var n,r,o,u,i,a,s,l,c,p,f,m;return null==t&&(t={}),f=void 0,r=function(){return f={}},r(),s=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.log?(n[0]="["+t.log+"] "+n[0],up.puts.apply(up,n)):void 0},a=function(){return Object.keys(f)},l=function(){return z(t.size)?void 0:R(t.size)?t.size():I(t.size)?t.size:w("Invalid size config: %o",t.size)},o=function(){return z(t.expiry)?void 0:R(t.expiry)?t.expiry():I(t.expiry)?t.expiry:w("Invalid expiry config: %o",t.expiry)},c=function(e){return t.key?t.key(e):e.toString()},Ot=function(){var e,t,n,r;return r=d(a()),n=l(),n&&r.length>n&&(e=null,t=null,b(r,function(n){var r,o;return r=f[n],o=r.timestamp,!t||t>o?(e=n,t=o):void 0}),e)?delete f[e]:void 0},n=function(e,t){var n;return n=u(e,{silent:!0}),O(n)?p(t,n):void 0},m=function(){return(new Date).valueOf()},p=function(e,t){var n;return n=c(e),f[n]={timestamp:m(),value:t}},yt=function(e){var t;return t=c(e),delete f[t]},i=function(e){var t,n;return t=o(),t?(n=m()-e.timestamp,n<o()):!0},u=function(e,t){var n,r;return null==t&&(t={}),r=c(e),(n=f[r])?i(n)?(t.silent||s("Cache hit for '%s'",e),n.value):(t.silent||s("Discarding stale cache entry for '%s'",e),void yt(e)):void(t.silent||s("Cache miss for '%s'",e))},{alias:n,get:u,set:p,remove:yt,clear:r,keys:a}},p=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){return x(t,e)},t.reset(),Object.preventExtensions(t),t},Kt=function(e){var t,n;return e=Ft(e),t=e.parentNode,n=Ut(e.childNodes),b(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},st=function(e){var t,n;for(t=void 0;(e=e.parent())&&e.length;)if(n=e.css("position"),"absolute"===n||"relative"===n||e.is("body")){t=e;break}return t},P=function(e,n){var r,o,u,i;return r=t(e),o=st(r),u=r.position(),i=o.offset(),r.css({position:"absolute",left:u.left-i.left,top:u.top-i.top+n.scrollTop(),right:"",bottom:""})},bt=function(e){var t,n,r,o,u,i,a;for(i=wt(e),t=[],a=i.split("&"),n=0,r=a.length;r>n;n++)u=a[n],q(u)&&(o=u.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},wt=function(e){var n;return e?(n=t.param(e),n=n.replace(/\+/g,"%20")):""},w=function(){var n,r,o,u,i;throw r=1<=arguments.length?e.call(arguments,0):[],(u=up.log).error.apply(u,r),o=(i=up.browser).sprintf.apply(i,r),n=ht(t(".up-error"))||t('<div class="up-error"></div>').prependTo("body"),n.addClass("up-error"),n.text(o),new Error(o)},mt=function(e,n){var r,o;return r=t(e),o=r.data(n),r.removeData(n),o},{requestDataAsArray:bt,requestDataAsQuery:wt,offsetParent:st,fixedToAbsolute:P,presentAttr:vt,createElement:h,parseUrl:dt,normalizeUrl:it,normalizeMethod:ut,createElementFromHtml:v,$createElementFromSelector:n,$createPlaceholder:r,selectorForElement:Pt,extend:x,copy:d,merge:et,options:ft,option:pt,error:w,each:b,map:G,times:Ct,any:i,all:u,detect:y,select:Tt,reject:gt,intersect:D,compact:c,uniq:Rt,last:B,isNull:L,isDefined:O,isUndefined:Q,isGiven:M,isMissing:z,isPresent:q,isBlank:A,presence:ht,isObject:W,isFunction:R,isString:_,isElement:F,isJQuery:K,isPromise:N,isDeferred:U,isHash:j,isUnmodifiedKeyEvent:V,isUnmodifiedMouseEvent:J,nullJQuery:at,unJQuery:Ft,nextFrame:rt,measure:Y,temporaryCss:Dt,cssAnimate:g,finishCssAnimate:T,forceCompositing:E,escapePressed:k,copyAttributes:m,findWithSelf:$,contains:f,isArray:C,toArray:Ut,castedAttr:s,locationFromXhr:X,titleFromXhr:At,methodFromXhr:tt,clientSize:l,only:ct,except:S,trim:Ot,unresolvableDeferred:Mt,unresolvablePromise:jt,resolvedPromise:xt,resolvedDeferred:St,resolvableWhen:kt,setMissingAttrs:Et,remove:yt,memoize:Z,scrollbarWidth:$t,config:p,cache:a,unwrapElement:Kt,multiSelector:nt,error:w,pluckData:mt}}($),up.error=up.util.error}.call(this),function(){var e=[].slice;up.log=function(){var t,n,r,o,u,i;return o=function(e){return"\u1d1c\u1d18 "+e},t=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["debug",o(n)].concat(e.call(t))):void 0},u=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["log",o(n)].concat(e.call(t))):void 0},i=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["warn",o(n)].concat(e.call(t))):void 0},r=function(){var t,n,r,u;if(r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),!r)return n();(u=up.browser).puts.apply(u,["groupCollapsed",o(r)].concat(e.call(t)));try{return n()}finally{r&&console.groupEnd()}},n=function(){var t,n,r;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?(r=up.browser).puts.apply(r,["error",o(n)].concat(e.call(t))):void 0},{puts:u,debug:t,error:n,warn:i,group:r}}(jQuery),up.puts=up.log.puts}.call(this),function(){var e=[].slice;up.browser=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b;return y=up.util,m=function(e,n){var r,o,u,i,a;return null==n&&(n={}),i=y.option(n.method,"get").toLowerCase(),"get"===i?(a=y.requestDataAsQuery(n.data),a&&(e=e+"?"+a),location.href=e):(r=t("<form method='post' action='"+e+"'></form>"),o=function(e){var n;return n=t('<input type="hidden">'),n.attr(e.name,e.value),n.appendTo(r)},o({name:up.proxy.config.wrapMethodParam,value:i}),(u=up.rails.csrfField())&&o(u),y.each(y.requestDataAsArray(n.data),o),r.hide().appendTo("body"),r.submit())},v=function(){var t,n,r;return r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],y.isDefined(console[r])||(r="log"),u()?console[r].apply(console,t):(n=g.apply(null,t),console[r](n))},n=/\%[odisf]/g,g=function(){var t,r,o,u;return u=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r=0,o=80,u.replace(n,function(){var e,n;return e=t[r],n=typeof e,"string"===n?(e=e.replace(/\s+/g," "),e.length>o&&(e=e.substr(0,o)+"\u2026"),e='"'+e+'"'):e="undefined"===n?"undefined":"number"===n||"function"===n?e.toString():JSON.stringify(e),e.length>o&&(e=e.substr(0,o)+" \u2026",("object"===n||"function"===n)&&(e+=" }")),r+=1,e})},b=function(){return location.href},c=y.memoize(function(){return y.isUndefined(document.addEventListener)}),p=y.memoize(function(){return c()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),i=y.memoize(function(){return y.isDefined(history.pushState)&&"get"===s()}),r=y.memoize(function(){return"transition"in document.documentElement.style}),o=y.memoize(function(){return"oninput"in document.createElement("input")}),u=y.memoize(function(){return!p()}),f=y.memoize(function(){var e,n,r,o;return o=t.fn.jquery,r=o.split("."),e=parseInt(r[0]),n=parseInt(r[1]),e>=2||1===e&&n>=9}),h=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,y.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},a=function(e){return e.preload||y.isBlank(e.confirm)||window.confirm(e.confirm)?y.resolvedPromise():y.unresolvablePromise()},s=y.memoize(function(){return(h("_up_request_method")||"get").toLowerCase()}),d=function(){return!c()&&f()},l=function(){return console.group||(console.group=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["group"].concat(e.call(t)))}),console.groupCollapsed||(console.groupCollapsed=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["groupCollapsed"].concat(e.call(t)))}),console.groupEnd||(console.groupEnd=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["groupEnd"].concat(e.call(t)))})},{url:b,loadPage:m,confirm:a,canPushState:i,canCssTransition:r,canInputEvent:o,canLogSubstitution:u,isSupported:d,installPolyfills:l,puts:v,sprintf:g}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,emit,emitReset,forgetUpDescription,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,restoreSnapshot,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,upListenerToJqueryListener=function(e){return function(t){var n;return n=t.$element||$(this),e.apply(n.get(0),[t,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(e,t){var n,r,o;return n=u.copy(e),o=n.pop(),r=void 0,t?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||u.error("up.off: The event listener %o was never registered through up.on")),n.push(r),n},live=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(e=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(t=$(document)).on.apply(t,e),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],e=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(t=$(document)).off.apply(t,e)},rememberUpDescription=function(e){var t;return t=upDescriptionNumber(e),liveUpDescriptions[t]=e},forgetUpDescription=function(e){var t;return t=upDescriptionNumber(e),delete liveUpDescriptions[t]},upDescriptionNumber=function(e){return u.last(e)._descriptionNumber},emit=function(e,t){var n,r;return null==t&&(t={}),r=$.Event(e,t),(n=t.$element)?delete t.$element:n=$(document),logEmission(e,t),n.trigger(r),r},logEmission=function(e,t){var n,r,o;return t.hasOwnProperty("message")?(n=t.message,delete t.message,u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n?u.isPresent(t)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[e],[t])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[e])):void 0):u.isPresent(t)?up.puts("Emitted event %s (%o)",e,t):up.puts("Emitted event %s",e)},nobodyPrevents=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=emit.apply(null,e),t.isDefaultPrevented()?(up.puts("An observer prevented the event %s",e[0]),!1):!0},onEscape=function(e){return live("keydown","body",function(t){return u.escapePressed(t)?e(t):void 0})},snapshot=function(){var e,t,n,r;for(r=[],t=0,n=liveUpDescriptions.length;n>t;t++)e=liveUpDescriptions[t],r.push(e.isDefault=!0);return r},restoreSnapshot=function(){var e,t,n,r,o;for(t=u.reject(liveUpDescriptions,function(e){return e.isDefault}),o=[],n=0,r=t.length;r>n;n++)e=t[n],o.push(unbind.apply(null,e));return o},emitReset=function(){return up.emit("up:framework:reset",{message:"Resetting framework"})},boot=function(){return up.browser.isSupported()?(up.browser.installPolyfills(),up.emit("up:framework:boot",{message:"Booting framework"})):void 0},live("up:framework:boot",snapshot),live("up:framework:reset",restoreSnapshot),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,onEscape:onEscape,emitReset:emitReset,boot:boot}}(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(){var e=[].slice;up.syntax=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n="up-destroyable",r="up-destroyer",l=[],d=[],s=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],p.apply(null,[l].concat(e.call(t)))},f=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],p.apply(null,[d].concat(e.call(t)))},u=function(){var t,n,r,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),r=v.options(t[0],{priority:0}),{selector:o,callback:n,priority:r.priority,batch:r.batch,keep:r.keep}},p=function(){var t,n,r,o,i;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],up.browser.isSupported()){for(r=u.apply(null,t),n=0;(o=i[n])&&o.priority<=r.priority;)n+=1;return i.splice(n,0,r)}},o=function(e,t,o){var u,i;return up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,o),e.keep&&(i=v.isString(e.keep)?e.keep:"",t.attr("up-keep",i)),u=e.callback.apply(o,[t,c(t)]),v.isFunction(u)?(t.addClass(n),t.data(r,u)):void 0},a=function(e,n){var r;return n=v.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,u,i,a,c,p;for(c=[d,l],p=[],u=0,i=c.length;i>u;u++)a=c[u],p.push(function(){var u,i,l;for(l=[],u=0,i=a.length;i>u;u++)s=a[u],n=v.findWithSelf(e,s.selector),n=n.filter(function(){var e;return e=t(this),v.all(r,function(t){return 0===e.closest(t).length})}),l.push(n.length?up.log.group(s.isDefault?void 0:"Compiling '%s' on %d element(s)",s.selector,n.length,function(){return s.batch?o(s,n,n.get()):n.each(function(){return o(s,t(this),this)})}):void 0);return l}());return p})},i=function(e){return v.findWithSelf(e,"."+n).each(function(){var e,n;return e=t(this),(n=e.data(r))()})},c=function(e){var n,r;return n=t(e),r=n.attr("up-data"),v.isString(r)&&""!==v.trim(r)?JSON.parse(r):{}},h=function(){var e,t,n;for(n=[],e=0,t=l.length;t>e;e++)s=l[e],n.push(s.isDefault=!0);return n},m=function(){return l=v.select(l,function(e){return e.isDefault})},up.on("up:framework:boot",h),up.on("up:framework:reset",m),{compiler:s,macro:f,compile:a,clean:i,data:c}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(e){var t,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,i=void 0,m=function(){return n.reset(),c=void 0,i=void 0},a=function(e){return v.normalizeUrl(e,{hash:!0})},r=function(){return a(up.browser.url())},o=function(e){return a(e)===r()},s=function(e){return i&&(c=i,i=void 0),i=e},d=function(e,t){return u("replace",e,t)},p=function(e,t){return up.puts("Current location is now %s",e),u("push",e,t)},u=function(e,n,u){var i,a;return u=v.options(u,{force:!1}),u.force||!o(n)?up.browser.canPushState()?(i=e+"State",a=t(),window.history[i](a,"",n),s(r())):v.error("This browser doesn't support history.pushState"):void 0},t=function(){return{fromUp:!0}},h=function(e){var t;return(null!=e?e.fromUp:void 0)?(t=r(),up.log.group("Restoring URL %s",t,function(){var e;return e=n.popTargets.join(", "),up.replace(e,t,{history:!1,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",e)},l=function(e){return up.log.group("History state popped to URL %s",r(),function(){var t;return s(r()),up.layout.saveScroll({url:c}),t=e.originalEvent.state,h(t)})},up.browser.canPushState()&&(f=function(){return e(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(e){return v.isPresent(c)?(v.setMissingAttrs(e,{"up-href":c,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(e,t,n){var r,o,i,a,s;return r=$(e),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:t},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(t),u.resolvedDeferred())},finishScrolling=function(e){return $(e).each(function(){var e;return(e=$(this).data(SCROLL_PROMISE_KEY))?e.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var e,t,n,r;return n=function(e,t){var n,r;return n=$(e),r=n.css(t),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %s",n.get(0),t),parseInt(r)+n.height()},t=function(){var e,t,o,u;for(o=$(config.fixedTop.join(", ")),u=[],e=0,t=o.length;t>e;e++)r=o[e],u.push(n(r,"top"));return u}(),e=function(){var e,t,o,u;for(o=$(config.fixedBottom.join(", ")),u=[],e=0,t=o.length;t>e;e++)r=o[e],u.push(n(r,"bottom"));return u}(),{top:Math.max.apply(Math,[0].concat(slice.call(t))),bottom:Math.max.apply(Math,[0].concat(slice.call(e)))}},reveal=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(e),up.puts("Revealing fragment %o",e.get(0)),t=u.options(t),r=t.viewport?$(t.viewport):viewportOf(n),m=u.option(t.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||t.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,t):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(e){var t,n;return t=$(e),n=viewportSelector().seekUp(t),n.length||u.error("Could not find viewport for %o",t),n},viewportsWithin=function(e){var t;return t=$(e),viewportSelector().findWithSelf(t)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var e,t,n,r,o,u,i;for(u={},o=config.viewports,t=0,r=o.length;r>t;t++)i=o[t],e=$(i),e.length&&(n=i,i===document&&(n="document"),u[n]=e.scrollTop());return u},fixedChildren=function(e){var t,n;return null==e&&(e=void 0),e||(e=document.body),n=$(e),t=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(t=t.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(t=t.add(n.find(config.fixedBottom.join(", ")))),t},saveScroll=function(e){var t,n;return null==e&&(e={}),n=u.option(e.url,up.history.url()),t=u.option(e.tops,scrollTops()),up.puts("Saving scroll positions for URL %s (%o)",n,t),lastScrollTops.set(n,t)},restoreScroll=function(e){var t,n,r,o,i;return null==e&&(e={}),i=up.history.url(),r=void 0,e.around?(n=viewportsWithin(e.around),t=viewportOf(e.around),r=t.add(n)):r=viewports(),o=lastScrollTops.get(i),up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var e,t,n,i;for(t in o)i=o[t],n="document"===t?document:t,e=r.filter(n),scroll(e,i,{duration:0});return u.resolvedDeferred()})},revealOrRestoreScroll=function(e,t){var n,r,o,i;return n=$(e),t.restoreScroll?restoreScroll({around:n}):t.reveal?(t.source&&(i=u.parseUrl(t.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function($){var autofocus,destroy,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,findOldFragment,first,hello,isRealElement,oldFragmentNotFound,parseImplantSteps,parseResponse,processResponse,reload,replace,resolveSelector,setSource,source,swapElements,transferKeepableElements,u,updateHistory;return u=up.util,setSource=function(e,t){var n;return n=$(e),u.isPresent(t)&&(t=u.normalizeUrl(t)),n.attr("up-source",t)},source=function(e){var t;return t=$(e).closest("[up-source]"),u.presence(t.attr("up-source"))||up.browser.url()},resolveSelector=function(e,t){var n,r;return u.isString(e)?(r=e,u.contains(r,"&")&&(t?(n=u.selectorForElement(t),r=r.replace(/\&/,n)):u.error("Found origin reference (%s) in selector %s, but options.origin is missing","&",r))):r=u.selectorForElement(e),r},replace=function(e,t,n){var r,o,i,a;return up.puts("Replacing %s from %s (%o)",e,t,n),n=u.options(n),a=resolveSelector(e,n.origin),r=u.option(n.failTarget,"body"),r=resolveSelector(r,n.origin),up.browser.canPushState()||n.history===!1?(i={url:t,method:n.method,data:n.data,target:a,failTarget:r,cache:n.cache,preload:n.preload,headers:n.headers},o=up.ajax(i),o.done(function(e,r,o){return processResponse(!0,a,t,i,o,n)}),o.fail(function(e){return processResponse(!1,r,t,i,e,n)}),o):(n.preload||up.browser.loadPage(t,u.only(n,"method","data")),u.unresolvablePromise())},processResponse=function(e,t,n,r,o,i){var a,s,l,c;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),i.title=u.option(u.titleFromXhr(o),i.title),a="GET"===i.method,(c=u.locationFromXhr(o))?(n=c,e&&(s={url:n,method:u.methodFromXhr(o),target:t},up.proxy.alias(r,s))):a&&(l=u.requestDataAsQuery(i.data))&&(n=n+"?"+l),e?a?(i.history===!1||u.isString(i.history)||(i.history=n),i.source===!1||u.isString(i.source)||(i.source=n)):(u.isString(i.history)||(i.history=!1),u.isString(i.source)||(i.source="keep")):(i.transition=i.failTransition,i.failTransition=void 0,a?(i.history!==!1&&(i.history=n),i.source!==!1&&(i.source=n)):(i.source="keep",i.history=!1)),i.preload?u.resolvedPromise():extract(t,o.responseText,i)},extract=function(e,t,n){return up.log.group("Extracting %s from %d bytes of HTML",e,null!=t?t.length:void 0,function(){var r,o,i,a,s,l,c,p;for(n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0}),c=resolveSelector(e,n.origin),l=parseResponse(t,n),n.title||(n.title=l.title()),n.saveScroll!==!1&&up.layout.saveScroll(),"function"==typeof n.beforeSwap&&n.beforeSwap(),r=[],updateHistory(n),a=parseImplantSteps(c,n),o=0,i=a.length;i>o;o++)p=a[o],up.log.group("Updating %s",p.selector,function(){var e,t,o,u;return t=findOldFragment(p.selector,n),e=null!=(u=l.find(p.selector))?u.first():void 0,t&&e?(o=swapElements(t,e,p.pseudoClass,p.transition,n),r.push(o)):void 0});return"function"==typeof n.afterSwap&&n.afterSwap(),(s=up.motion).when.apply(s,r)})},findOldFragment=function(e,t){return first(".up-popup "+e)||first(".up-modal "+e)||first(e)||oldFragmentNotFound(e,t)},oldFragmentNotFound=function(e,t){var n;return t.requireMatch?(n="Could not find selector %s in current body HTML","#"===n[0]&&(n+=" (avoid using IDs)"),u.error(n,e)):void 0},parseResponse=function(e,t){var n;return n=u.createElementFromHtml(e),{title:function(){var e;return null!=(e=n.querySelector("title"))?e.textContent:void 0},find:function(r){var o;return(o=$.find(r,n)[0])?$(o):t.requireMatch?u.error("Could not find selector %s in response %o",r,e):void 0}}},updateHistory=function(e){return e.history?(e.title&&(document.title=e.title),up.history[e.historyMethod](e.history)):void 0},swapElements=function(e,t,n,r,o){var i,a,s,l;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(e)})),up.motion.finish(e),n?(i=t.contents().wrap('<span class="up-insertion"></span>').parent(),"before"===n?e.prepend(i):e.append(i),hello(i.children(),o),s=up.layout.revealOrRestoreScroll(i,o),s=s.then(function(){return up.animate(i,r,o)
2
+ }),s=s.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(e,t,o))?(emitFragmentKept(a),s=u.resolvedPromise()):(l=function(){return o.keepPlans=transferKeepableElements(e,t,o),t.insertBefore(e),o.source!==!1&&setSource(t,o.source),autofocus(t),hello(t,o),up.morph(e,t,r,o)},s=destroy(e,{animation:l})),s},transferKeepableElements=function(e,t,n){var r,o,i,a,s,l,c,p;if(a=[],n.keep)for(p=e.find("[up-keep]"),i=0,l=p.length;l>i;i++)s=p[i],r=$(s),(c=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),r.replaceWith(o),c.$newElement.replaceWith(r),a.push(c));return a},findKeepPlan=function(e,t,n){var r,o,i,a,s;return n.keep&&(r=e,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?t.find(s):u.findWithSelf(t,s),o=o.first(),o.length&&o.is("[up-keep]")&&(i={$element:r,$newElement:o,newData:up.syntax.data(o)},a=u.merge(i,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",a))))?i:void 0},parseImplantSteps=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m;for(d=t.transition||t.animation||"none",n=/\ *,\ */,r=e.split(n),m=u.isString(m)?d.split(n):[d],l=[],o=i=0,a=r.length;a>i;o=++i)c=r[o],p=c.match(/^(.+?)(?:\:(before|after))?$/),p||u.error('Could not parse selector atom "%s"',c),e=p[1],"html"===e&&(e="body"),s=p[2],f=m[o]||u.last(m),l.push({selector:e,pseudoClass:s,transition:f});return l},hello=function(e,t){var n,r,o,i,a,s;for(n=$(e),t=u.options(t,{keepPlans:[]}),o=[],s=t.keepPlans,r=0,i=s.length;i>r;r++)a=s[r],emitFragmentKept(a),o.push(a.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,t),n},emitFragmentInserted=function(e,t){var n;return n=$(e),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:t.origin})},emitFragmentKept=function(e){var t;return t=u.merge(e,{message:["Kept fragment %o",e.$element.get(0)]}),up.emit("up:fragment:kept",t)},autofocus=function(e){var t,n;return n="[autofocus]:last",t=u.findWithSelf(e,n),t.length&&t.get(0)!==document.activeElement?t.focus():void 0},isRealElement=function(e){var t;return t=".up-ghost, .up-destroying",0===e.closest(t).length},first=function(e){var t,n,r,o,i,a;for(o=void 0,o=u.isString(e)?$(e).get():e,n=void 0,i=0,a=o.length;a>i;i++)if(r=o[i],t=$(r),isRealElement(t)){n=t;break}return n},destroy=function(e,t){var n,r,o,i,a;return n=$(e),n.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")||(i=["Destroying fragment %o",n.get(0)],a=["Destroyed fragment %o",n.get(0)]),up.bus.nobodyPrevents("up:fragment:destroy",{$element:n,message:i})?(t=u.options(t,{animation:!1}),r=up.motion.animateOptions(t),n.addClass("up-destroying"),u.isPresent(t.url)&&up.history.push(t.url),u.isPresent(t.title)&&(document.title=t.title),o=u.presence(t.animation,u.isDeferred)||up.motion.animate(n,t.animation,r),o.then(function(){return up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:a}),n.remove()}),o):$.Deferred()},reload=function(e,t){var n;return t=u.options(t,{cache:!1}),n=t.url||source(e),replace(e,n,t)},up.on("ready",function(){var e;return e=$(document.body),setSource(e,up.browser.url()),hello(e)}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello}}(jQuery),up.replace=up.flow.replace,up.extract=up.flow.extract,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first,up.hello=up.flow.hello}.call(this),function(){up.motion=function(e){var t,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T;return $=up.util,u={},s={},x={},l={},a=$.config({duration:300,delay:0,easing:"ease",enabled:!0}),y=function(){return u=$.copy(s),x=$.copy(l),a.reset()},m=function(){return a.enabled&&up.browser.canCssTransition()},n=function(t,o,u){var a;return a=e(t),f(a),u=r(u),"none"===o||o===!1?v():$.isFunction(o)?i(o(a,u),o):$.isString(o)?n(a,p(o),u):$.isHash(o)?m()?$.cssAnimate(a,o,u):(a.css(o),$.resolvedDeferred()):$.error("Unknown animation type for %o",o)},r=function(e,t){var n;return null==t&&(t=null),e=$.options(e),n={},n.easing=$.option(e.easing,null!=t?t.attr("up-easing"):void 0,a.easing),n.duration=Number($.option(e.duration,null!=t?t.attr("up-duration"):void 0,a.duration)),n.delay=Number($.option(e.delay,null!=t?t.attr("up-delay"):void 0,a.delay)),n},p=function(e){return u[e]||$.error("Unknown animation %o",e)},t="up-ghosting-deferred",T=function(e,n,r,o){var u,i,a,s,l,c,p;return l=void 0,a=void 0,c=void 0,s=void 0,u=up.layout.viewportOf(e),$.temporaryCss(n,{display:"none"},function(){return l=g(e,u),c=u.scrollTop()}),$.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(n,r),a=g(n,u),s=u.scrollTop()}),l.moveTop(s-c),e.hide(),p=$.temporaryCss(n,{opacity:"0"}),i=o(l.$ghost,a.$ghost),e.data(t,i),n.data(t,i),i.then(function(){return e.removeData(t),n.removeData(t),p(),l.$bounds.remove(),a.$bounds.remove()}),i},f=function(t){var n;return n=e(t),$.finishCssAnimate(n),d(n)},d=function(n){return n.each(function(){var n,r;return n=e(this),(r=$.pluckData(n,t))?r.resolve():void 0})},i=function(e,t){return $.isDeferred(e)?e:$.error("Did not return a promise with .then and .resolve methods: %o",t)},h=function(t,o,a,s){var l,p;return"none"===a&&(a=!1),p=e(t),l=e(o),c(p,a),c(l,a),up.log.group(a?"Morphing %o to %o (using %s)":void 0,p.get(0),l.get(0),a,function(){var e,t,o,c;return t=$.only(s,"reveal","restoreScroll","source"),t=$.extend(t,r(s)),m()?(f(p),f(l),a?(e=u[a])?(w(p,l,t),n(l,e,t)):(c=$.presence(a,$.isFunction)||x[a])?T(p,l,t,function(e,n){var r;return r=c(e,n,t),i(r,a)}):$.isString(a)&&a.indexOf("/")>=0?(o=a.split("/"),c=function(e,t,r){return b(n(e,o[0],r),n(t,o[1],r))},h(p,l,c,t)):$.error("Unknown transition %o",a):w(p,l,t)):w(p,l,t)})},c=function(e,t){var n;return t&&0===e.parents("body").length?(n=e.get(0),$.error("Can't morph a <%s> element (%o)",n.tagName,n)):void 0},w=function(e,t,n){return e.hide(),up.layout.revealOrRestoreScroll(t,n)},g=function(t,n){var r,o,u,i,a,s,l,c,p;for(i=$.measure(t,{relative:!0,inner:!0}),u=t.clone(),u.find("script").remove(),u.css({position:"static"===t.css("position")?"static":"relative",top:"",right:"",bottom:"",left:"",width:"100%",height:"100%"}),u.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(i),p=i.top,c=function(e){return 0!==e?(p+=e,r.css({top:p})):void 0},u.appendTo(r),r.insertBefore(t),c(t.offset().top-u.offset().top),o=up.layout.fixedChildren(u),s=0,l=o.length;l>s;s++)a=o[s],$.fixedToAbsolute(a,n);return{$ghost:u,$bounds:r,moveTop:c}},S=function(e,t){return x[e]=t},o=function(e,t){return u[e]=t},k=function(){return s=$.copy(u),l=$.copy(x)},b=$.resolvableWhen,v=$.resolvedDeferred,o("none",v),o("fade-in",function(e,t){return e.css({opacity:0}),n(e,{opacity:1},t)}),o("fade-out",function(e,t){return e.css({opacity:1}),n(e,{opacity:0},t)}),o("move-to-top",function(e,t){var r,o;return r=$.measure(e),o=r.top+r.height,e.css({"margin-top":"0px"}),n(e,{"margin-top":"-"+o+"px"},t)}),o("move-from-top",function(e,t){var r,o;return r=$.measure(e),o=r.top+r.height,e.css({"margin-top":"-"+o+"px"}),n(e,{"margin-top":"0px"},t)}),o("move-to-bottom",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().height-r.top,e.css({"margin-top":"0px"}),n(e,{"margin-top":o+"px"},t)}),o("move-from-bottom",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().height-r.top,e.css({"margin-top":o+"px"}),n(e,{"margin-top":"0px"},t)}),o("move-to-left",function(e,t){var r,o;return r=$.measure(e),o=r.left+r.width,e.css({"margin-left":"0px"}),n(e,{"margin-left":"-"+o+"px"},t)}),o("move-from-left",function(e,t){var r,o;return r=$.measure(e),o=r.left+r.width,e.css({"margin-left":"-"+o+"px"}),n(e,{"margin-left":"0px"},t)}),o("move-to-right",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().width-r.left,e.css({"margin-left":"0px"}),n(e,{"margin-left":o+"px"},t)}),o("move-from-right",function(e,t){var r,o;return r=$.measure(e),o=$.clientSize().width-r.left,e.css({"margin-left":o+"px"}),n(e,{"margin-left":"0px"},t)}),o("roll-down",function(e,t){var r,o;return r=e.height(),o=$.temporaryCss(e,{height:"0px",overflow:"hidden"}),n(e,{height:r+"px"},t).then(o)}),S("none",v),S("move-left",function(e,t,r){return b(n(e,"move-to-left",r),n(t,"move-from-right",r))}),S("move-right",function(e,t,r){return b(n(e,"move-to-right",r),n(t,"move-from-left",r))}),S("move-up",function(e,t,r){return b(n(e,"move-to-top",r),n(t,"move-from-bottom",r))}),S("move-down",function(e,t,r){return b(n(e,"move-to-bottom",r),n(t,"move-from-top",r))}),S("cross-fade",function(e,t,r){return b(n(e,"fade-out",r),n(t,"fade-in",r))}),up.on("up:framework:boot",k),up.on("up:framework:reset",y),{morph:h,animate:n,animateOptions:r,finish:f,transition:S,animation:o,config:a,isEnabled:m,defaults:function(){return $.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:v,when:b,prependCopy:g}}(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 e=[].slice;up.proxy=function(t){var n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,$,T,P,E,D,C,A,U,O,F,R;return R=up.util,n=void 0,$=void 0,U=void 0,k=void 0,O=void 0,P=[],p=R.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],wrapMethodParam:"_method",safeMethods:["GET","OPTIONS","HEAD"]}),i=function(e){return w(e),[e.url,e.method,e.data,e.target].join("|")},u=R.cache({size:function(){return p.cacheSize},expiry:function(){return p.cacheExpiry},key:i}),f=function(e){var t,n,r,o,i,a,s;for(e=w(e),n=[e],"html"!==e.target&&(a=R.merge(e,{target:"html"}),n.push(a),"body"!==e.target&&(i=R.merge(e,{target:"body"}),n.push(i))),r=0,o=n.length;o>r;r++)if(t=n[r],s=u.get(t))return s},A=u.set,E=u.remove,c=u.clear,s=function(){return clearTimeout($),$=null},a=function(){return clearTimeout(U),U=null},D=function(){return n=null,s(),a(),k=0,p.reset(),O=!1,u.clear(),P=[]},D(),o=u.alias,w=function(e){return e._normalized||(e.method=R.normalizeMethod(e.method),e.url&&(e.url=R.normalizeUrl(e.url)),e.target||(e.target="body"),e._normalized=!0),e},r=function(e){var t,n,r,o,u;return t=e.cache===!0,n=e.cache===!1,u=R.only(e,"url","method","data","target","headers","_normalized"),u=w(u),r=!0,m(u)||t?(o=f(u))&&!n?(up.puts("Re-using cached response for %s %s",u.method,u.url),r="pending"===o.state()):(o=y(u),A(u,o),o.fail(function(){return E(u)})):(c(),o=y(u)),r&&!e.preload&&(b(),o.always(g)),console.groupEnd(),o},h=function(){return 0===k},d=function(){return k>0},b=function(){var e,t;return t=h(),k+=1,t?(e=function(){return d()?(up.emit("up:proxy:slow",{message:"Proxy is busy"}),O=!0):void 0},p.slowDelay>0?U=setTimeout(e,p.slowDelay):e()):void 0},g=function(){return k-=1,h()&&O?(up.emit("up:proxy:recover",{message:"Proxy is idle"}),O=!1):void 0},y=function(e){return k<p.maxRequests?v(e):T(e)},T=function(e){var n,r;return up.puts("Queuing request for %s %s",e.method,e.url),n=t.Deferred(),r={deferred:n,request:e},P.push(r),n.promise()},v=function(e){var n;return up.emit("up:proxy:load",R.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=R.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,e.data=R.requestDataAsArray(e.data),R.contains(p.wrapMethods,e.method)&&(e.data.push({name:p.wrapMethodParam,value:e.method}),e.method="POST"),n=t.ajax(e),n.done(function(t,n,r){return C(e,r)}),n.fail(function(t){return C(e,t)}),n},C=function(e,t){var n;return up.emit("up:proxy:received",R.merge(e,{message:["Server responded with %s %s (%d bytes)",t.status,t.statusText,null!=(n=t.responseText)?n.length:void 0]})),S()},S=function(){var t,n;return(t=P.shift())?(n=v(t.request),n.done(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).resolve.apply(r,n)}),n.fail(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).reject.apply(r,n)})):void 0},m=function(e){return w(e),R.contains(p.safeMethods,e.method)},l=function(e){var t,r;return r=parseInt(R.presentAttr(e,"up-delay"))||p.preloadDelay,e.is(n)?void 0:(n=e,s(),t=function(){return x(e),n=null},F(t,r))},F=function(e,t){return $=setTimeout(e,t)},x=function(e,n){var r,o;return r=t(e),n=R.options(n),o=up.link.followMethod(r,n),m({method:o})?up.log.group("Preloading link %o",r,function(){return n.preload=!0,up.follow(r,n)}):(up.puts("Won't preload %o due to unsafe method %s",r,o),R.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(e,t){return up.link.childClicked(e,t)?void 0:l(t)}),up.on("up:framework:reset",D),{preload:x,ajax:r,get:f,alias:o,clear:c,remove:E,isIdle:h,isBusy:d,config:p,defaults:function(){return R.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery),up.ajax=up.proxy.ajax}.call(this),function(){up.link=function($){var allowDefault,childClicked,follow,followMethod,followVariantSelectors,isFollowable,makeFollowable,onAction,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(e,t){var n;return t=u.options(t),n=u.option(t.target,"body"),up.replace(n,e,t)},follow=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(t.target,n.attr("up-target"),"body"),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"),"body"),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.history=u.option(t.history,u.castedAttr(n,"up-history")),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.method=followMethod(n,t),t.origin=u.option(t.origin,n),t.confirm=u.option(t.confirm,n.attr("up-confirm")),t=u.merge(t,up.motion.animateOptions(t,n)),up.browser.confirm(t).then(function(){return up.replace(r,o,t)})},followMethod=function(e,t){var n;return n=$(e),t=u.options(t),u.option(t.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},childClicked=function(e,t){var n,r;return n=$(e.target),r=n.closest("a, [up-href]"),r.length&&t.find(r).length},shouldProcessLinkEvent=function(e,t){return u.isUnmodifiedMouseEvent(e)&&!childClicked(e,t)},followVariantSelectors=[],allowDefault=function(){},onAction=function(e,t){return followVariantSelectors.push(e),up.on("click","a"+e+", [up-href]"+e,function(e,n){return shouldProcessLinkEvent(e,n)?n.is("[up-instant]")?e.preventDefault():(e.preventDefault(),t(n)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,n){return shouldProcessLinkEvent(e,n)?(e.preventDefault(),t(n)):void 0})},isFollowable=function(e){return u.any(followVariantSelectors,function(t){return e.is(t)})},makeFollowable=function(e){var t;return t=$(e),isFollowable(t)?void 0:t.attr("up-follow","")},onAction("[up-target]",function(e){return follow(e)}),onAction("[up-follow]",function(e){return follow(e)}),up.macro("[up-expand]",function(e){var t,n,r,o,i,a,s,l,c,p;if(t=e.find("a, [up-href]"),(c=e.attr("up-expand"))&&(t=t.filter(c)),i=t.get(0)){for(p=/^up-/,s={},s["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],a=n.name,a.match(p)&&(s[a]=n.value);return u.setMissingAttrs(e,s),e.removeAttr("up-expand"),makeFollowable(e)}}),up.macro("[up-dash]",function(e){var t,n;return n=u.castedAttr(e,"up-dash"),t={"up-preload":"true","up-instant":"true"},n===!0?t["up-follow"]="":t["up-target"]=n,u.setMissingAttrs(e,t),e.removeAttr("up-dash")}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,shouldProcessLinkEvent:shouldProcessLinkEvent,childClicked:childClicked,followMethod:followMethod,onAction:onAction}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,currentValuesForSwitch,observe,observeForm,reset,resolveValidateTarget,submit,switchTargets,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},submit=function(e,t){var n,r,o,i,a;return n=$(e).closest("form"),t=u.options(t),i=u.option(t.target,n.attr("up-target"),"body"),a=u.option(t.url,n.attr("action"),up.browser.url()),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),t.history=u.option(t.history,u.castedAttr(n,"up-history"),!0),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.method=u.option(t.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),t.headers=u.option(t.headers,{}),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.origin=u.option(t.origin,n),t.data=n.serializeArray(),t=u.merge(t,up.motion.animateOptions(t,n)),r=n.find("input[type=file]").length,t.validate&&(t.headers||(t.headers={}),t.headers["X-Up-Validate"]=t.validate,r)?u.unresolvablePromise():(n.addClass("up-active"),r||!up.browser.canPushState()&&t.history!==!1?(n.get(0).submit(),u.unresolvablePromise()):(o=up.replace(i,a,t),o.always(function(){return n.removeClass("up-active")}),o))},observe=function(){var $element,args,callback,callbackArg,callbackPromise,callbackTimer,changeEvents,check,clearTimer,delay,knownValue,nextCallback,options,rawCallback,runNextCallback,selectorOrElement;return selectorOrElement=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===args.length&&(callbackArg=args[0]),args.length>1&&(options=u.options(args[0]),callbackArg=args[1]),$element=$(selectorOrElement),options=u.options(options),delay=u.option($element.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),callback=null,u.isGiven(options.change)&&u.error("up.observe now takes the change callback as the last argument"),rawCallback=u.option(u.presentAttr($element,"op-observe"),callbackArg),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||u.error("up.observe: No change callback given"),$element.is("form")?observeForm($element,options,callback):(knownValue=null,callbackTimer=null,callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var e;return nextCallback?(e=nextCallback(),nextCallback=null,e):void 0},check=function(){var e,t,n;return n=$element.val(),t=u.isNull(knownValue),knownValue===n||(knownValue=n,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($element.get(0),[n,$element])},e=function(){return callbackPromise.then(function(){var e;return e=runNextCallback(),callbackPromise=u.isPromise(e)?e:u.resolvedPromise()})},0===delay?e():setTimeout(e,delay))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$element.on(changeEvents,check),check(),function(){return $element.off(changeEvents,check),clearTimer()})},observeForm=function(e,t,n){var r,o;return r=u.multiSelector(config.fields).find(e),o=u.map(r,function(e){return observe(e,n)}),function(){var e,t,n,r;for(r=[],t=0,n=o.length;n>t;t++)e=o[t],r.push(e());return r}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),t.addClass("up-active"),submit(n).always(function(){return t.removeClass("up-active")})})},resolveValidateTarget=function(e,t){var n;return n=u.option(t.target,e.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,t.origin),e.closest(r).length}))),u.isBlank(n)&&u.error("Could not find default validation target for %o (tried ancestors %o)",e.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(e,t){var n,r,o;return n=$(e),t=u.options(t),t.origin=n,t.target=resolveValidateTarget(n,t),t.failTarget=t.target,t.history=!1,t.headers=u.option(t.headers,{}),t.validate=n.attr("name")||"__none__",t=u.merge(t,up.motion.animateOptions(t,n)),r=n.closest("form"),o=up.submit(r,t)},currentValuesForSwitch=function(e){var t,n,r;return r=void 0,e.is("input[type=checkbox]")?r=e.is(":checked")?[":checked",":present",e.val()]:[":unchecked",":blank"]:e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),r=t.length?[":checked",":present",t.val()]:[":unchecked",":blank"]):(n=e.val(),r=u.isPresent(n)?[":present",n]:[":blank"]),r},currentValuesForSwitch=function(e){var t,n,r,o;return e.is("input[type=checkbox]")?e.is(":checked")?(r=e.val(),n=":checked"):n=":unchecked":e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),t.length?(n=":checked",r=t.val()):n=":unchecked"):r=e.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(t.target,n.attr("up-switch")),u.isPresent(o)||u.error("No switch target given for %o",n.get(0)),r=currentValuesForSwitch(n),$(o).each(function(){var e,t,n,o;return e=$(this),(t=e.attr("up-hide-for"))?(t=t.split(" "),n=0===u.intersect(r,t).length):(o=(o=e.attr("up-show-for"))?o.split(" "):[":present",":checked"],n=u.intersect(r,o).length>0),e.toggle(n)})},up.on("submit","form[up-target]",function(e,t){return e.preventDefault(),submit(t)}),up.on("change","[up-validate]",function(e,t){return validate(t)}),up.on("change","[up-switch]",function(e,t){return switchTargets(t)}),up.compiler("[up-switch]",function(e){return switchTargets(e)}),up.compiler("[up-observe]",function(e){return observe(e)}),up.compiler("[up-autosubmit]",function(e){return autosubmit(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets}}(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($){var attach,autoclose,close,config,contains,coveredUrl,createFrame,currentUrl,discardHistory,ensureInViewport,isOpen,reset,setPosition,u;return u=up.util,currentUrl=void 0,coveredUrl=function(){return $(".up-popup").attr("up-covered-url")},config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",position:"bottom-right",history:!1}),reset=function(){return close({animation:!1}),config.reset()},setPosition=function(e,t){var n,r,o;return o=u.measure(e,{full:!0}),r=function(){switch(t){case"bottom-right":return{right:o.right,top:o.top+o.height};case"bottom-left":return{left:o.left,top:o.top+o.height};case"top-right":return{right:o.right,bottom:o.top};case"top-left":return{left:o.left,bottom:o.top};default:return u.error("Unknown position option '%s'",t)}}(),n=$(".up-popup"),n.attr("up-position",t),n.css(r),ensureInViewport(n)},ensureInViewport=function(e){var t,n,r,o,i,a,s;if(n=u.measure(e,{full:!0}),r=null,o=null,n.right<0&&(r=-n.right),n.bottom<0&&(o=-n.bottom),n.left<0&&(r=n.left),n.top<0&&(o=n.top),r&&((i=parseInt(e.css("left")))?e.css("left",i-r):(a=parseInt(e.css("right")))&&e.css("right",a+r)),o){if(s=parseInt(e.css("top")))return e.css("top",s-o);if(t=parseInt(e.css("bottom")))return e.css("bottom",t+o)}},discardHistory=function(){var e;return e=$(".up-popup"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},createFrame=function(e,t){var n;return n=u.$createElementFromSelector(".up-popup"),t.sticky&&n.attr("up-sticky",""),n.attr("up-covered-url",up.browser.url()),n.attr("up-covered-title",document.title),u.$createPlaceholder(e,n),n.appendTo(document.body),n},isOpen=function(){return $(".up-popup").length>0},attach=function(e,t){var n,r,o,i;return n=$(e),n.length||u.error("Cannot attach popup to non-existing element %o",e),t=u.options(t),i=u.option(t.url,n.attr("href")),o=u.option(t.target,n.attr("up-popup"),"body"),t.position=u.option(t.position,n.attr("up-position"),config.position),t.animation=u.option(t.animation,n.attr("up-animation"),config.openAnimation),t.sticky=u.option(t.sticky,u.castedAttr(n,"up-sticky")),t.history=up.browser.canPushState()?u.option(t.history,u.castedAttr(n,"up-history"),config.history):!1,t.confirm=u.option(t.confirm,n.attr("up-confirm")),r=up.motion.animateOptions(t,n),up.browser.confirm(t).then(function(){var e,a;return up.bus.nobodyPrevents("up:popup:open",{url:i,message:"Opening popup"})?(a=isOpen(),a&&close({animation:!1}),t.beforeSwap=function(){return createFrame(o,t)},e=up.replace(o,i,u.merge(t,{animation:!1})),e=e.then(function(){return setPosition(n,t.position)}),a||(e=e.then(function(){return up.animate($(".up-popup"),t.animation,r)})),e=e.then(function(){return up.emit("up:popup:opened",{message:"Popup opened"})})):u.unresolvableDeferred()})},close=function(e){var t,n;return t=$(".up-popup"),t.length?up.bus.nobodyPrevents("up:popup:close",{$element:t})?(e=u.options(e,{animation:config.closeAnimation,url:t.attr("up-covered-url"),title:t.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(t,e),n.then(function(){return up.emit("up:popup:closed",{message:"Popup closed"})}),n):u.unresolvableDeferred():u.resolvedDeferred()},autoclose=function(){return $(".up-popup").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=function(e){var t;return t=$(e),t.closest(".up-popup").length>0},up.link.onAction("[up-popup]",function(e){return e.is(".up-current")?close():attach(e)}),up.on("click","body",function(e){var t;return t=$(e.target),t.closest(".up-popup").length||t.closest("[up-popup]").length?void 0:close()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return currentUrl=n}else if(contains(e.origin))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(e,t){return t.closest(".up-popup").length?(close(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attach,close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.popup.defaults(...) no longer exists. Set values on he up.popup.config property instead.")},contains:contains,open:function(){return up.error("up.popup.open no longer exists. Please use up.popup.attach instead.")},source:function(){return up.error("up.popup.source no longer exists. Please use up.popup.url instead.")},isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var autoclose,close,config,contains,coveredUrl,createFrame,currentUrl,discardHistory,follow,isOpen,open,reset,shiftElements,templateHtml,u,unshiftElements,unshifters,visit;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",closeLabel:"\xd7",template:function(e){return'<div class="up-modal">\n <div class="up-modal-dialog">\n <div class="up-modal-close" up-close>'+e.closeLabel+'</div>\n <div class="up-modal-content"></div>\n </div>\n</div>'}}),currentUrl=void 0,coveredUrl=function(){return $(".up-modal").attr("up-covered-url")},reset=function(){return close({animation:!1}),currentUrl=void 0,config.reset()},templateHtml=function(){var e;return e=config.template,u.isFunction(e)?e(config):e},discardHistory=function(){var e;return e=$(".up-modal"),e.removeAttr("up-covered-url"),e.removeAttr("up-covered-title")},createFrame=function(e,t){var n,r,o;return shiftElements(),o=$(templateHtml()),t.sticky&&o.attr("up-sticky",""),o.attr("up-covered-url",up.browser.url()),o.attr("up-covered-title",document.title),r=o.find(".up-modal-dialog"),u.isPresent(t.width)&&r.css("width",t.width),u.isPresent(t.maxWidth)&&r.css("max-width",t.maxWidth),u.isPresent(t.height)&&r.css("height",t.height),n=o.find(".up-modal-content"),u.$createPlaceholder(e,n),o.appendTo(document.body),o},unshifters=[],shiftElements=function(){var e,t,n,r;return n=u.scrollbarWidth(),e=parseInt($("body").css("padding-right")),t=n+e,r=u.temporaryCss($("body"),{"padding-right":t+"px","overflow-y":"hidden"}),unshifters.push(r),up.layout.anchoredRight().each(function(){var e,t,r,o;return e=$(this),t=parseInt(e.css("right")),r=n+t,o=u.temporaryCss(e,{right:r}),unshifters.push(o)})},unshiftElements=function(){var e,t;for(e=[];t=unshifters.pop();)e.push(t());return e},isOpen=function(){return $(".up-modal").length>0},follow=function(e,t){return t=u.options(t),t.$link=$(e),open(t)},visit=function(e,t){return t=u.options(t),t.url=e,open(t)},open=function(e){var t,n,r,o;return e=u.options(e),t=u.option(e.$link,u.nullJQuery()),o=u.option(e.url,t.attr("up-href"),t.attr("href")),r=u.option(e.target,t.attr("up-modal"),"body"),e.width=u.option(e.width,t.attr("up-width"),config.width),e.maxWidth=u.option(e.maxWidth,t.attr("up-max-width"),config.maxWidth),e.height=u.option(e.height,t.attr("up-height"),config.height),e.animation=u.option(e.animation,t.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky")),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(t,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,t.attr("up-confirm")),n=up.motion.animateOptions(e,t),up.browser.confirm(e).then(function(){var t,i;return up.bus.nobodyPrevents("up:modal:open",{url:o,message:"Opening modal"})?(i=isOpen(),i&&close({animation:!1}),e.beforeSwap=function(){return createFrame(r,e)},t=up.replace(r,o,u.merge(e,{animation:!1})),i||(t=t.then(function(){return up.animate($(".up-modal"),e.animation,n)})),t=t.then(function(){return up.emit("up:modal:opened",{message:"Modal opened"})})):u.unresolvablePromise()})},close=function(e){var t,n;return t=$(".up-modal"),t.length?up.bus.nobodyPrevents("up:modal:close",{$element:t,message:"Closing modal"})?(e=u.options(e,{animation:config.closeAnimation,url:t.attr("up-covered-url"),title:t.attr("up-covered-title")}),currentUrl=void 0,n=up.destroy(t,e),n=n.then(function(){return unshiftElements(),up.emit("up:modal:closed",{message:"Modal closed"})})):u.unresolvableDeferred():u.resolvedDeferred()},autoclose=function(){return $(".up-modal").is("[up-sticky]")?void 0:(discardHistory(),close())},contains=function(e){var t;return t=$(e),t.closest(".up-modal").length>0},up.link.onAction("[up-modal]",function(e){return follow(e)}),up.on("click","body",function(e){var t;return t=$(e.target),t.closest(".up-modal-dialog").length||t.closest("[up-modal]").length?void 0:close()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return currentUrl=n}else if(!up.popup.contains(t)&&contains(e.origin))return autoclose()}),up.bus.onEscape(function(){return close()}),up.on("click","[up-close]",function(e,t){return t.closest(".up-modal").length?(close(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,open:function(){return up.error("up.modal.open no longer exists. Please use either up.modal.follow or up.modal.visit.")},close:close,url:function(){return currentUrl},coveredUrl:coveredUrl,config:config,defaults:function(){return u.error("up.modal.defaults(...) no longer exists. Set values on he up.modal.config property instead.")},contains:contains,source:function(){return up.error("up.modal.source no longer exists. Please use up.popup.url instead.")},isOpen:isOpen}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,u,i,a;return a=up.util,r=a.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out"}),u=function(){return r.reset()},i=function(e,t,n){var r,o,u;return o=a.measure(e),u=a.measure(t),r=function(){switch(n){case"top":return{left:o.left+.5*(o.width-u.width),top:o.top-u.height};case"bottom":return{left:o.left+.5*(o.width-u.width),top:o.top+o.height};default:return a.error("Unknown position option '%s'",n)}}(),t.attr("up-position",n),t.css(r)},o=function(e){var t;return t=a.$createElementFromSelector(".up-tooltip"),a.isGiven(e.text)?t.text(e.text):t.html(e.html),t.appendTo(document.body),t},t=function(t,u){var s,l,c,p,f,d,m;return null==u&&(u={}),s=e(t),f=a.option(u.html,s.attr("up-tooltip-html")),m=a.option(u.text,s.attr("up-tooltip")),d=a.option(u.position,s.attr("up-position"),r.position),p=a.option(u.animation,a.castedAttr(s,"up-animation"),r.openAnimation),c=up.motion.animateOptions(u,s),n(),l=o({text:m,html:f}),i(s,l,d),up.animate(l,p,c)
3
3
  },n=function(t){var n;return n=e(".up-tooltip"),n.length?(t=a.options(t,{animation:r.closeAnimation}),t=a.merge(t,up.motion.animateOptions(t)),up.destroy(n,t)):void 0},up.compiler("[up-tooltip], [up-tooltip-html]",function(e){return e.on("mouseover",function(){return t(e)}),e.on("mouseout",function(){return n()})}),up.on("click","body",function(){return n()}),up.on("up:framework:reset",n),up.bus.onEscape(function(){return n()}),up.on("up:framework:reset",u),{attach:t,close:n,open:function(){return a.error("up.tooltip.open no longer exists. Use up.tooltip.attach instead.")}}}(jQuery)}.call(this),function(){up.navigation=function(e){var t,n,r,o,u,i,a,s,l,c,p,f,d,m,h,v,g;return h=up.util,i=h.config({currentClasses:["up-current"]}),p=function(){return i.reset()},a=function(){var e;return e=i.currentClasses,e=e.concat(["up-current"]),e=h.uniq(e),e.join(" ")},t="up-active",n=["a","[up-href]","[up-alias]"],o=n.join(", "),u=function(){var e,t,r;for(r=[],e=0,t=n.length;t>e;e++)m=n[e],r.push(m+"[up-instant]");return r}().join(", "),r="."+t,c=function(e){return h.isPresent(e)?h.normalizeUrl(e,{search:!1,stripTrailingSlash:!0}):void 0},d=function(e){var t,n,r,o,u,i,a,s,l,p;for(s=[],i=["href","up-href","up-alias"],n=0,o=i.length;o>n;n++)if(t=i[n],l=h.presentAttr(e,t))for(p="up-alias"===t?l.split(" "):[l],r=0,u=p.length;u>r;r++)a=p[r],"#"!==a&&(a=c(a),s.push(a));return s},g=function(e){var t,n,r,o;return e=h.compact(e),r=function(e){return"*"===e.substr(-1)?n(e.slice(0,-1)):t(e)},t=function(t){return h.contains(e,t)},n=function(t){return h.detect(e,function(e){return 0===e.indexOf(t)})},o=function(e){return h.detect(e,r)},{matchesAny:o}},l=function(){var t,n;return t=g([c(up.browser.url()),c(up.modal.url()),c(up.modal.coveredUrl()),c(up.popup.url()),c(up.popup.coveredUrl())]),n=a(),h.each(e(o),function(r){var o,u;return o=e(r),u=d(o),t.matchesAny(u)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},f=function(e){return v(),e=s(e),e.addClass(t)},s=function(e){return h.presence(e.parents(o))||e},v=function(){return e(r).removeClass(t)},up.on("click",o,function(e,t){return h.isUnmodifiedMouseEvent(e)&&!t.is("[up-instant]")?f(t):void 0}),up.on("mousedown",u,function(e,t){return h.isUnmodifiedMouseEvent(e)?f(t):void 0}),up.on("up:fragment:inserted",function(){return v(),l()}),up.on("up:fragment:destroyed",function(e,t){return t.is(".up-modal, .up-popup")?l():void 0}),up.on("up:framework:reset",p),{config:i,defaults:function(){return h.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")}}}(jQuery)}.call(this),function(){up.rails=function(e){var t,n,r,o;return r=up.util,o=function(e){return e.is("[up-follow], [up-target], [up-modal], [up-popup]")},n=function(){return r.isGiven(e.rails)},r.each(["method","confirm"],function(e){var t,u;return t="data-"+e,u="up-"+e,up.compiler("["+t+"]",function(e){var i;return n()&&o(e)?(i={},i[u]=e.attr(t),r.setMissingAttrs(e,i),e.removeAttr(t)):void 0})}),t=function(){return n()?{name:e.rails.csrfParam(),value:e.rails.csrfToken()}:void 0},{csrfField:t,isRails:n}}(jQuery)}.call(this),function(){up.boot()}.call(this);
@@ -196,10 +196,12 @@ up.browser = (($) ->
196
196
  ###*
197
197
  @function up,browser.confirm
198
198
  @return {Promise}
199
+ @param {String} options.confirm
200
+ @param {Boolean} options.preload
199
201
  @internal
200
202
  ###
201
- confirm = (message) ->
202
- if u.isBlank(message) || confirm(message)
203
+ confirm = (options) ->
204
+ if options.preload || u.isBlank(options.confirm) || window.confirm(options.confirm)
203
205
  u.resolvedPromise()
204
206
  else
205
207
  u.unresolvablePromise()
@@ -312,7 +312,7 @@ up.form = (($) ->
312
312
 
313
313
  @function up.autosubmit
314
314
  @param {String|Element|jQuery} selectorOrElement
315
- The form field to observe.
315
+ The field or form to observe.
316
316
  @param {Object} [options]
317
317
  See options for [`up.observe`](/up.observe)
318
318
  @return {Function}
@@ -528,8 +528,8 @@ up.form = (($) ->
528
528
  the submission is loading.
529
529
 
530
530
  You can also [implement a spinner](/up.proxy/#spinners)
531
- by [listening](/up.on) to the [`up:proxy:busy`](/up:proxy:busy)
532
- and [`up:proxy:idle`](/up:proxy:idle) events.
531
+ by [listening](/up.on) to the [`up:proxy:slow`](/up:proxy:slow)
532
+ and [`up:proxy:recover`](/up:proxy:recover) events.
533
533
 
534
534
  @selector form[up-target]
535
535
  @param {String} up-target
@@ -836,7 +836,15 @@ up.form = (($) ->
836
836
  text field value changes:
837
837
 
838
838
  <form method="GET" action="/search" up-autosubmit>
839
- <input type="query">
839
+ <input type="search" name="query">
840
+ </form>
841
+
842
+ The following would submit the form only if the query was changed,
843
+ but not if the checkbox was changed:
844
+
845
+ <form method="GET" action="/search">
846
+ <input type="search" name="query" autosubmit>
847
+ <input type="checkbox"> Include archive
840
848
  </form>
841
849
 
842
850
  @selector [up-autosubmit]
@@ -181,7 +181,7 @@ up.link = (($) ->
181
181
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'))
182
182
  options = u.merge(options, up.motion.animateOptions(options, $link))
183
183
 
184
- up.browser.confirm(options.confirm).then ->
184
+ up.browser.confirm(options).then ->
185
185
  up.replace(target, url, options)
186
186
 
187
187
  ###*
@@ -308,7 +308,7 @@ up.modal = (($) ->
308
308
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'))
309
309
  animateOptions = up.motion.animateOptions(options, $link)
310
310
 
311
- up.browser.confirm(options.confirm).then ->
311
+ up.browser.confirm(options).then ->
312
312
  if up.bus.nobodyPrevents('up:modal:open', url: url, message: 'Opening modal')
313
313
  wasOpen = isOpen()
314
314
  close(animation: false) if wasOpen
@@ -212,7 +212,7 @@ up.popup = (($) ->
212
212
  options.confirm = u.option(options.confirm, $link.attr('up-confirm'))
213
213
  animateOptions = up.motion.animateOptions(options, $link)
214
214
 
215
- up.browser.confirm(options.confirm).then ->
215
+ up.browser.confirm(options).then ->
216
216
  if up.bus.nobodyPrevents('up:popup:open', url: url, message: 'Opening popup')
217
217
  wasOpen = isOpen()
218
218
  close(animation: false) if wasOpen
@@ -18,8 +18,8 @@ the user performs the click.
18
18
  Spinners
19
19
  --------
20
20
 
21
- You can [listen](/up.on) to the [`up:proxy:busy`](/up:proxy:busy)
22
- and [`up:proxy:idle`](/up:proxy:idle) events to implement a spinner
21
+ You can [listen](/up.on) to the [`up:proxy:slow`](/up:proxy:slow)
22
+ and [`up:proxy:recover`](/up:proxy:recover) events to implement a spinner
23
23
  that appears during a long-running request,
24
24
  and disappears once the response has been received:
25
25
 
@@ -32,8 +32,8 @@ Here is the Javascript to make it alive:
32
32
  show = function() { $element.show() };
33
33
  hide = function() { $element.hide() };
34
34
 
35
- showOff = up.on('up:proxy:busy', show);
36
- hideOff = up.on('up:proxy:idle', hide);
35
+ showOff = up.on('up:proxy:slow', show);
36
+ hideOff = up.on('up:proxy:recover', hide);
37
37
 
38
38
  hide();
39
39
 
@@ -45,11 +45,11 @@ Here is the Javascript to make it alive:
45
45
 
46
46
  });
47
47
 
48
- The `up:proxy:busy` event will be emitted after a delay of 300 ms
48
+ The `up:proxy:slow` event will be emitted after a delay of 300 ms
49
49
  to prevent the spinner from flickering on and off.
50
50
  You can change (or remove) this delay by [configuring `up.proxy`](/up.proxy.config) like this:
51
51
 
52
- up.proxy.config.busyDelay = 150;
52
+ up.proxy.config.slowDelay = 150;
53
53
 
54
54
  @class up.proxy
55
55
  ###
@@ -59,9 +59,9 @@ up.proxy = (($) ->
59
59
 
60
60
  $waitingLink = undefined
61
61
  preloadDelayTimer = undefined
62
- busyDelayTimer = undefined
62
+ slowDelayTimer = undefined
63
63
  pendingCount = undefined
64
- busyEventEmitted = undefined
64
+ slowEventEmitted = undefined
65
65
 
66
66
  queuedRequests = []
67
67
 
@@ -76,8 +76,8 @@ up.proxy = (($) ->
76
76
  @param {Number} [config.cacheExpiry=300000]
77
77
  The number of milliseconds until a cache entry expires.
78
78
  Defaults to 5 minutes.
79
- @param {Number} [config.busyDelay=300]
80
- How long the proxy waits until emitting the [`up:proxy:busy` event](/up:proxy:busy).
79
+ @param {Number} [config.slowDelay=300]
80
+ How long the proxy waits until emitting the [`up:proxy:slow` event](/up:proxy:slow).
81
81
  Use this to prevent flickering of spinners.
82
82
  @param {Number} [config.maxRequests=4]
83
83
  The maximum number of concurrent requests to allow before additional
@@ -101,7 +101,7 @@ up.proxy = (($) ->
101
101
  @stable
102
102
  ###
103
103
  config = u.config
104
- busyDelay: 300
104
+ slowDelay: 300
105
105
  preloadDelay: 75
106
106
  cacheSize: 70
107
107
  cacheExpiry: 1000 * 60 * 5
@@ -192,8 +192,8 @@ up.proxy = (($) ->
192
192
  preloadDelayTimer = null
193
193
 
194
194
  cancelBusyDelay = ->
195
- clearTimeout(busyDelayTimer)
196
- busyDelayTimer = null
195
+ clearTimeout(slowDelayTimer)
196
+ slowDelayTimer = null
197
197
 
198
198
  reset = ->
199
199
  $waitingLink = null
@@ -201,7 +201,7 @@ up.proxy = (($) ->
201
201
  cancelBusyDelay()
202
202
  pendingCount = 0
203
203
  config.reset()
204
- busyEventEmitted = false
204
+ slowEventEmitted = false
205
205
  cache.clear()
206
206
  queuedRequests = []
207
207
 
@@ -283,11 +283,11 @@ up.proxy = (($) ->
283
283
  # following case:
284
284
  #
285
285
  # - User starts preloading a request.
286
- # This triggers *no* `up:proxy:busy`.
286
+ # This triggers *no* `up:proxy:slow`.
287
287
  # - User starts loading the request (without preloading).
288
- # This triggers `up:proxy:busy`.
288
+ # This triggers `up:proxy:slow`.
289
289
  # - The request finishes.
290
- # This triggers `up:proxy:idle`.
290
+ # This triggers `up:proxy:recover`.
291
291
  loadStarted()
292
292
  promise.always(loadEnded)
293
293
 
@@ -299,44 +299,38 @@ up.proxy = (($) ->
299
299
  Returns `true` if the proxy is not currently waiting
300
300
  for a request to finish. Returns `false` otherwise.
301
301
 
302
- The proxy will also emit an [`up:proxy:idle` event](/up:proxy:idle) if it
303
- used to busy, but is now idle.
304
-
305
- @function up.proxy.idle
302
+ @function up.proxy.isIdle
306
303
  @return {Boolean}
307
304
  Whether the proxy is idle
308
305
  @experimental
309
306
  ###
310
- idle = ->
307
+ isIdle = ->
311
308
  pendingCount == 0
312
309
 
313
310
  ###*
314
311
  Returns `true` if the proxy is currently waiting
315
312
  for a request to finish. Returns `false` otherwise.
316
313
 
317
- The proxy will also emit an [`up:proxy:busy` event](/up:proxy:busy) if it
318
- used to be idle, but is now busy.
319
-
320
- @function up.proxy.busy
314
+ @function up.proxy.isBusy
321
315
  @return {Boolean}
322
316
  Whether the proxy is busy
323
317
  @experimental
324
318
  ###
325
- busy = ->
319
+ isBusy = ->
326
320
  pendingCount > 0
327
321
 
328
322
  loadStarted = ->
329
- wasIdle = idle()
323
+ wasIdle = isIdle()
330
324
  pendingCount += 1
331
325
  if wasIdle
332
- # Since the emission of up:proxy:busy might be delayed by config.busyDelay,
326
+ # Since the emission of up:proxy:slow might be delayed by config.slowDelay,
333
327
  # we wrap the mission in a function for scheduling below.
334
328
  emission = ->
335
- if busy() # a fast response might have beaten the delay
336
- up.emit('up:proxy:busy', message: 'Proxy is busy')
337
- busyEventEmitted = true
338
- if config.busyDelay > 0
339
- busyDelayTimer = setTimeout(emission, config.busyDelay)
329
+ if isBusy() # a fast response might have beaten the delay
330
+ up.emit('up:proxy:slow', message: 'Proxy is busy')
331
+ slowEventEmitted = true
332
+ if config.slowDelay > 0
333
+ slowDelayTimer = setTimeout(emission, config.slowDelay)
340
334
  else
341
335
  emission()
342
336
 
@@ -345,31 +339,31 @@ up.proxy = (($) ->
345
339
  are taking long to finish.
346
340
 
347
341
  By default Unpoly will wait 300 ms for an AJAX request to finish
348
- before emitting `up:proxy:busy`. You can configure this time like this:
342
+ before emitting `up:proxy:slow`. You can configure this time like this:
349
343
 
350
- up.proxy.config.busyDelay = 150;
344
+ up.proxy.config.slowDelay = 150;
351
345
 
352
- Once all responses have been received, an [`up:proxy:idle`](/up:proxy:idle)
346
+ Once all responses have been received, an [`up:proxy:recover`](/up:proxy:recover)
353
347
  will be emitted.
354
348
 
355
349
  Note that if additional requests are made while Unpoly is already busy
356
- waiting, **no** additional `up:proxy:busy` events will be triggered.
350
+ waiting, **no** additional `up:proxy:slow` events will be triggered.
357
351
 
358
- @event up:proxy:busy
352
+ @event up:proxy:slow
359
353
  @stable
360
354
  ###
361
355
 
362
356
  loadEnded = ->
363
357
  pendingCount -= 1
364
- if idle() && busyEventEmitted
365
- up.emit('up:proxy:idle', message: 'Proxy is idle')
366
- busyEventEmitted = false
358
+ if isIdle() && slowEventEmitted
359
+ up.emit('up:proxy:recover', message: 'Proxy is idle')
360
+ slowEventEmitted = false
367
361
 
368
362
  ###*
369
363
  This event is [emitted]/(up.emit) when [AJAX requests](/up.ajax)
370
- have [taken long to finish](/up:proxy:busy), but have finished now.
364
+ have [taken long to finish](/up:proxy:slow), but have finished now.
371
365
 
372
- @event up:proxy:idle
366
+ @event up:proxy:recover
373
367
  @stable
374
368
  ###
375
369
 
@@ -511,8 +505,8 @@ up.proxy = (($) ->
511
505
  alias: alias
512
506
  clear: clear
513
507
  remove: remove
514
- idle: idle
515
- busy: busy
508
+ isIdle: isIdle
509
+ isBusy: isBusy
516
510
  config: config
517
511
  defaults: -> u.error('up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.')
518
512
 
@@ -4,6 +4,6 @@ module Unpoly
4
4
  # The current version of the unpoly-rails gem.
5
5
  # This version number is also used for releases of the Unpoly
6
6
  # frontend code.
7
- VERSION = '0.21.0'
7
+ VERSION = '0.22.0'
8
8
  end
9
9
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- unpoly-rails (0.20.0)
4
+ unpoly-rails (0.21.0)
5
5
  rails (>= 3)
6
6
 
7
7
  GEM
@@ -210,3 +210,6 @@ DEPENDENCIES
210
210
  uglifier (>= 1.3.0)
211
211
  unpoly-rails!
212
212
  web-console (~> 2.0)
213
+
214
+ BUNDLED WITH
215
+ 1.11.2
@@ -145,20 +145,35 @@ describe 'up.link', ->
145
145
  describe 'with { confirm } option', ->
146
146
 
147
147
  it 'follows the link after the user OKs a confirmation dialog', ->
148
- deferred = $.Deferred()
149
- spyOn(up.browser, 'confirm').and.returnValue(deferred)
150
148
  spyOn(up, 'replace')
149
+ spyOn(window, 'confirm').and.returnValue(true)
151
150
  $link = affix('a[href="/danger"][up-target=".middle"]')
152
151
  up.follow($link, confirm: 'Do you really want to go there?')
153
- expect(up.browser.confirm).toHaveBeenCalledWith('Do you really want to go there?')
154
- expect(up.replace).not.toHaveBeenCalled()
155
- deferred.resolve()
152
+ expect(window.confirm).toHaveBeenCalledWith('Do you really want to go there?')
156
153
  expect(up.replace).toHaveBeenCalled()
157
154
 
155
+ it 'does not follow the link if the user cancels the confirmation dialog', ->
156
+ spyOn(up, 'replace')
157
+ spyOn(window, 'confirm').and.returnValue(false)
158
+ $link = affix('a[href="/danger"][up-target=".middle"]')
159
+ up.follow($link, confirm: 'Do you really want to go there?')
160
+ expect(window.confirm).toHaveBeenCalledWith('Do you really want to go there?')
161
+ expect(up.replace).not.toHaveBeenCalled()
162
+
158
163
  it 'does not show a confirmation dialog if the option is not a present string', ->
159
164
  spyOn(up, 'replace')
165
+ spyOn(window, 'confirm')
160
166
  $link = affix('a[href="/danger"][up-target=".middle"]')
161
167
  up.follow($link, confirm: '')
168
+ expect(window.confirm).not.toHaveBeenCalled()
169
+ expect(up.replace).toHaveBeenCalled()
170
+
171
+ it 'does not show a confirmation dialog when preloading', ->
172
+ spyOn(up, 'replace')
173
+ spyOn(window, 'confirm')
174
+ $link = affix('a[href="/danger"][up-target=".middle"]')
175
+ up.follow($link, confirm: 'Are you sure?', preload: true)
176
+ expect(window.confirm).not.toHaveBeenCalled()
162
177
  expect(up.replace).toHaveBeenCalled()
163
178
 
164
179
  describeFallback 'canPushState', ->
@@ -157,26 +157,26 @@ describe 'up.proxy', ->
157
157
  describe 'events', ->
158
158
 
159
159
  beforeEach ->
160
- up.proxy.config.busyDelay = 0
160
+ up.proxy.config.slowDelay = 0
161
161
  @events = []
162
- u.each ['up:proxy:load', 'up:proxy:received', 'up:proxy:busy', 'up:proxy:idle'], (eventName) =>
162
+ u.each ['up:proxy:load', 'up:proxy:received', 'up:proxy:slow', 'up:proxy:recover'], (eventName) =>
163
163
  up.on eventName, =>
164
164
  @events.push eventName
165
165
 
166
- it 'emits an up:proxy:busy event once the proxy started loading, and up:proxy:idle if it is done loading', ->
166
+ it 'emits an up:proxy:slow event once the proxy started loading, and up:proxy:recover if it is done loading', ->
167
167
 
168
168
  up.ajax(url: '/foo')
169
169
 
170
170
  expect(@events).toEqual([
171
171
  'up:proxy:load',
172
- 'up:proxy:busy'
172
+ 'up:proxy:slow'
173
173
  ])
174
174
 
175
175
  up.ajax(url: '/bar')
176
176
 
177
177
  expect(@events).toEqual([
178
178
  'up:proxy:load',
179
- 'up:proxy:busy',
179
+ 'up:proxy:slow',
180
180
  'up:proxy:load'
181
181
  ])
182
182
 
@@ -187,7 +187,7 @@ describe 'up.proxy', ->
187
187
 
188
188
  expect(@events).toEqual([
189
189
  'up:proxy:load',
190
- 'up:proxy:busy',
190
+ 'up:proxy:slow',
191
191
  'up:proxy:load',
192
192
  'up:proxy:received'
193
193
  ])
@@ -199,14 +199,14 @@ describe 'up.proxy', ->
199
199
 
200
200
  expect(@events).toEqual([
201
201
  'up:proxy:load',
202
- 'up:proxy:busy',
202
+ 'up:proxy:slow',
203
203
  'up:proxy:load',
204
204
  'up:proxy:received',
205
205
  'up:proxy:received',
206
- 'up:proxy:idle'
206
+ 'up:proxy:recover'
207
207
  ])
208
208
 
209
- it 'does not emit an up:proxy:busy event if preloading', ->
209
+ it 'does not emit an up:proxy:slow event if preloading', ->
210
210
 
211
211
  # A request for preloading preloading purposes
212
212
  # doesn't make us busy.
@@ -214,15 +214,15 @@ describe 'up.proxy', ->
214
214
  expect(@events).toEqual([
215
215
  'up:proxy:load'
216
216
  ])
217
- expect(up.proxy.busy()).toBe(false)
217
+ expect(up.proxy.isBusy()).toBe(false)
218
218
 
219
219
  # The same request with preloading does make us busy.
220
220
  up.ajax(url: '/foo')
221
221
  expect(@events).toEqual([
222
222
  'up:proxy:load',
223
- 'up:proxy:busy'
223
+ 'up:proxy:slow'
224
224
  ])
225
- expect(up.proxy.busy()).toBe(true)
225
+ expect(up.proxy.isBusy()).toBe(true)
226
226
 
227
227
  # The response resolves both promises and makes
228
228
  # the proxy idle again.
@@ -232,14 +232,14 @@ describe 'up.proxy', ->
232
232
  responseText: 'foo'
233
233
  expect(@events).toEqual([
234
234
  'up:proxy:load',
235
- 'up:proxy:busy',
235
+ 'up:proxy:slow',
236
236
  'up:proxy:received',
237
- 'up:proxy:idle'
237
+ 'up:proxy:recover'
238
238
  ])
239
- expect(up.proxy.busy()).toBe(false)
239
+ expect(up.proxy.isBusy()).toBe(false)
240
240
 
241
- it 'can delay the up:proxy:busy event to prevent flickering of spinners', ->
242
- up.proxy.config.busyDelay = 100
241
+ it 'can delay the up:proxy:slow event to prevent flickering of spinners', ->
242
+ up.proxy.config.slowDelay = 100
243
243
 
244
244
  up.ajax(url: '/foo')
245
245
  expect(@events).toEqual([
@@ -254,7 +254,7 @@ describe 'up.proxy', ->
254
254
  jasmine.clock().tick(50)
255
255
  expect(@events).toEqual([
256
256
  'up:proxy:load',
257
- 'up:proxy:busy'
257
+ 'up:proxy:slow'
258
258
  ])
259
259
 
260
260
  jasmine.Ajax.requests.at(0).respondWith
@@ -264,13 +264,13 @@ describe 'up.proxy', ->
264
264
 
265
265
  expect(@events).toEqual([
266
266
  'up:proxy:load',
267
- 'up:proxy:busy',
267
+ 'up:proxy:slow',
268
268
  'up:proxy:received',
269
- 'up:proxy:idle'
269
+ 'up:proxy:recover'
270
270
  ])
271
271
 
272
- it 'does not emit up:proxy:idle if a delayed up:proxy:busy was never emitted due to a fast response', ->
273
- up.proxy.config.busyDelay = 100
272
+ it 'does not emit up:proxy:recover if a delayed up:proxy:slow was never emitted due to a fast response', ->
273
+ up.proxy.config.slowDelay = 100
274
274
 
275
275
  up.ajax(url: '/foo')
276
276
  expect(@events).toEqual([
@@ -291,13 +291,13 @@ describe 'up.proxy', ->
291
291
  'up:proxy:received'
292
292
  ])
293
293
 
294
- it 'emits up:proxy:idle if a request returned but failed', ->
294
+ it 'emits up:proxy:recover if a request returned but failed', ->
295
295
 
296
296
  up.ajax(url: '/foo')
297
297
 
298
298
  expect(@events).toEqual([
299
299
  'up:proxy:load',
300
- 'up:proxy:busy'
300
+ 'up:proxy:slow'
301
301
  ])
302
302
 
303
303
  jasmine.Ajax.requests.at(0).respondWith
@@ -307,9 +307,9 @@ describe 'up.proxy', ->
307
307
 
308
308
  expect(@events).toEqual([
309
309
  'up:proxy:load',
310
- 'up:proxy:busy',
310
+ 'up:proxy:slow',
311
311
  'up:proxy:received',
312
- 'up:proxy:idle'
312
+ 'up:proxy:recover'
313
313
  ])
314
314
 
315
315
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unpoly-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails