unpoly-rails 0.50.1 → 0.50.2

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c39dc41cfa12d90419cbc092aaeffaffd1e177c8
4
- data.tar.gz: 83572902fc63e3512f796a87efc88eb6d1b7443c
3
+ metadata.gz: 78767804364685540b9735a6e04459dfd1112e12
4
+ data.tar.gz: cafa4e9b2e6a097369fea1ffa3bec7686c5e4381
5
5
  SHA512:
6
- metadata.gz: 46c5806d803bd2ac6b9546fcc1621e7893512eef7c21801072d8b4d95cc92b7dab86e58d23d18b9298ab724a5e43e57ed1ac3120ea06202e236a9a0196079e1b
7
- data.tar.gz: dbd1706ffa1a453122743965b7e53ad9007dda86e3d3d5250063cbad4b8ea365cd9f487855eb16d20a2432069baf6236ed6788dbffa8b95bf8d08e885ac49802
6
+ metadata.gz: 9f2e7b3c63a20564dbf1a03a18d9a1d7d022d0cb5210c65086c2b65b448c997f1b565f8c4a95bbb089db9b2d6402b1f745d5677605681a2055d0d8e6eeb5809c
7
+ data.tar.gz: d0d253768d9c860585fa792591081f63579af832bcb1a3fe6cacae7ee94d8c50e48eecb18db82e5ca59fb5d676eab7d65700b8747b76ea4dc8bb7032e0b5e100
data/CHANGELOG.md CHANGED
@@ -6,6 +6,27 @@ Changes to this project will be documented in this file.
6
6
  This project mostly adheres to [Semantic Versioning](http://semver.org/).
7
7
 
8
8
 
9
+ 0.50.2
10
+ ------
11
+
12
+ ### Fragment updates
13
+
14
+ - Updating fragments is now much faster when no [`[up-keep]`](/up-keep) elements are involved.
15
+
16
+ ### Scrolling
17
+
18
+ - [`up.reveal()`](/up.reveal) no longer crashes when called with a CSS selector or non-jQuery element.
19
+ - [`up.reveal()`](/up.reveal) now returns a rejected promise when no viewport could be found for the given element.
20
+
21
+ ### Links
22
+
23
+ - [`[up-expand]`](/up-expand) now ignores clicks on [form fields](/up.form.config#config.fields). This is useful e.g. when `up-expand`ing a table row that contains both links and form fields.
24
+
25
+ ### Network
26
+
27
+ - [`a[up-preload]`](/a-up-preload) will no longer preload a link when the user holds the Shift, Ctrl or Meta key while hovering.
28
+
29
+
9
30
  0.50.1
10
31
  ------
11
32
 
data/dist/unpoly.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  (function() {
7
7
  window.up = {
8
- version: "0.50.1",
8
+ version: "0.50.2",
9
9
  renamedModule: function(oldName, newName) {
10
10
  return typeof Object.defineProperty === "function" ? Object.defineProperty(up, oldName, {
11
11
  get: function() {
@@ -2092,7 +2092,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2092
2092
  @internal
2093
2093
  */
2094
2094
  rejectOnError = function(block) {
2095
- var error, error1;
2095
+ var error;
2096
2096
  try {
2097
2097
  return block();
2098
2098
  } catch (error1) {
@@ -2467,6 +2467,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2467
2467
  candidates = [selector, this.options.fallback, up.dom.config.fallbacks];
2468
2468
  candidates = u.flatten(candidates);
2469
2469
  candidates = u.select(candidates, u.isTruthy);
2470
+ candidates = u.uniq(candidates);
2470
2471
  if (this.options.fallback === false || this.options.provideTarget) {
2471
2472
  candidates = [candidates[0]];
2472
2473
  }
@@ -2756,7 +2757,6 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2756
2757
  this.matchesLink = bind(this.matchesLink, this);
2757
2758
  this.preloadLink = bind(this.preloadLink, this);
2758
2759
  this.followLink = bind(this.followLink, this);
2759
- this.shouldProcessLinkEvent = bind(this.shouldProcessLinkEvent, this);
2760
2760
  this.fullSelector = bind(this.fullSelector, this);
2761
2761
  this.onMousedown = bind(this.onMousedown, this);
2762
2762
  this.onClick = bind(this.onClick, this);
@@ -2766,7 +2766,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2766
2766
  }
2767
2767
 
2768
2768
  FollowVariant.prototype.onClick = function(event, $link) {
2769
- if (this.shouldProcessLinkEvent(event, $link)) {
2769
+ if (up.link.shouldProcessEvent(event, $link)) {
2770
2770
  if ($link.is('[up-instant]')) {
2771
2771
  return up.bus.haltEvent(event);
2772
2772
  } else {
@@ -2779,7 +2779,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2779
2779
  };
2780
2780
 
2781
2781
  FollowVariant.prototype.onMousedown = function(event, $link) {
2782
- if (this.shouldProcessLinkEvent(event, $link)) {
2782
+ if (up.link.shouldProcessEvent(event, $link)) {
2783
2783
  up.bus.consumeAction(event);
2784
2784
  return this.followLink($link);
2785
2785
  }
@@ -2816,10 +2816,6 @@ that might save you from loading something like [Lodash](https://lodash.com/).
2816
2816
  })(this));
2817
2817
  };
2818
2818
 
2819
- FollowVariant.prototype.shouldProcessLinkEvent = function(event, $link) {
2820
- return u.isUnmodifiedMouseEvent(event) && !up.link.childClicked(event, $link);
2821
- };
2822
-
2823
2819
  FollowVariant.prototype.followLink = function($link, options) {
2824
2820
  if (options == null) {
2825
2821
  options = {};
@@ -4076,7 +4072,6 @@ Internet Explorer 10 or lower
4076
4072
  @internal
4077
4073
  */
4078
4074
  sessionStorage = u.memoize(function() {
4079
- var error;
4080
4075
  try {
4081
4076
  return window.sessionStorage;
4082
4077
  } catch (error) {
@@ -5339,13 +5334,15 @@ or when a matching fragment is [inserted via AJAX](/up.link) later.
5339
5334
  for (j = 0, len1 = queue.length; j < len1; j++) {
5340
5335
  compiler = queue[j];
5341
5336
  $matches = u.selectInSubtree($fragment, compiler.selector);
5342
- $matches = $matches.filter(function() {
5343
- var $match;
5344
- $match = $(this);
5345
- return u.all($skipSubtrees, function(skipSubtree) {
5346
- return $match.closest(skipSubtree).length === 0;
5337
+ if ($skipSubtrees.length) {
5338
+ $matches = $matches.filter(function() {
5339
+ var $match;
5340
+ $match = $(this);
5341
+ return u.all($skipSubtrees, function(skipSubtree) {
5342
+ return $match.closest(skipSubtree).length === 0;
5343
+ });
5347
5344
  });
5348
- });
5345
+ }
5349
5346
  if ($matches.length) {
5350
5347
  results1.push(up.log.group((!compiler.isSystem ? "Compiling '%s' on %d element(s)" : void 0), compiler.selector, $matches.length, function() {
5351
5348
  if (compiler.batch) {
@@ -6092,54 +6089,57 @@ Unpoly will automatically be aware of sticky Bootstrap components such as
6092
6089
  @stable
6093
6090
  */
6094
6091
  reveal = function(elementOrSelector, options) {
6095
- var $element, $viewport, elementDims, firstElementRow, lastElementRow, newScrollPos, obstruction, offsetShift, originalScrollPos, predictFirstVisibleRow, predictLastVisibleRow, snap, viewportHeight, viewportIsDocument;
6092
+ var $element;
6096
6093
  $element = $(elementOrSelector);
6097
- up.puts('Revealing fragment %o', elementOrSelector.get(0));
6094
+ up.puts('Revealing fragment %o', $element.get(0));
6098
6095
  options = u.options(options);
6099
- $viewport = options.viewport ? $(options.viewport) : viewportOf($element);
6100
- snap = u.option(options.snap, config.snap);
6101
- viewportIsDocument = $viewport.is(document);
6102
- viewportHeight = viewportIsDocument ? u.clientSize().height : $viewport.outerHeight();
6103
- originalScrollPos = $viewport.scrollTop();
6104
- newScrollPos = originalScrollPos;
6105
- offsetShift = void 0;
6106
- obstruction = void 0;
6107
- if (viewportIsDocument) {
6108
- obstruction = measureObstruction();
6109
- offsetShift = 0;
6110
- } else {
6111
- obstruction = {
6112
- top: 0,
6113
- bottom: 0
6096
+ return u.rejectOnError(function() {
6097
+ var $viewport, elementDims, firstElementRow, lastElementRow, newScrollPos, obstruction, offsetShift, originalScrollPos, predictFirstVisibleRow, predictLastVisibleRow, snap, viewportHeight, viewportIsDocument;
6098
+ $viewport = options.viewport ? $(options.viewport) : viewportOf($element);
6099
+ snap = u.option(options.snap, config.snap);
6100
+ viewportIsDocument = $viewport.is(document);
6101
+ viewportHeight = viewportIsDocument ? u.clientSize().height : $viewport.outerHeight();
6102
+ originalScrollPos = $viewport.scrollTop();
6103
+ newScrollPos = originalScrollPos;
6104
+ offsetShift = void 0;
6105
+ obstruction = void 0;
6106
+ if (viewportIsDocument) {
6107
+ obstruction = measureObstruction();
6108
+ offsetShift = 0;
6109
+ } else {
6110
+ obstruction = {
6111
+ top: 0,
6112
+ bottom: 0
6113
+ };
6114
+ offsetShift = originalScrollPos;
6115
+ }
6116
+ predictFirstVisibleRow = function() {
6117
+ return newScrollPos + obstruction.top;
6114
6118
  };
6115
- offsetShift = originalScrollPos;
6116
- }
6117
- predictFirstVisibleRow = function() {
6118
- return newScrollPos + obstruction.top;
6119
- };
6120
- predictLastVisibleRow = function() {
6121
- return newScrollPos + viewportHeight - obstruction.bottom - 1;
6122
- };
6123
- elementDims = u.measure($element, {
6124
- relative: $viewport,
6125
- includeMargin: true
6119
+ predictLastVisibleRow = function() {
6120
+ return newScrollPos + viewportHeight - obstruction.bottom - 1;
6121
+ };
6122
+ elementDims = u.measure($element, {
6123
+ relative: $viewport,
6124
+ includeMargin: true
6125
+ });
6126
+ firstElementRow = elementDims.top + offsetShift;
6127
+ lastElementRow = firstElementRow + Math.min(elementDims.height, config.substance) - 1;
6128
+ if (lastElementRow > predictLastVisibleRow()) {
6129
+ newScrollPos += lastElementRow - predictLastVisibleRow();
6130
+ }
6131
+ if (firstElementRow < predictFirstVisibleRow() || options.top) {
6132
+ newScrollPos = firstElementRow - obstruction.top;
6133
+ }
6134
+ if (newScrollPos < snap && elementDims.top < (0.5 * viewportHeight)) {
6135
+ newScrollPos = 0;
6136
+ }
6137
+ if (newScrollPos !== originalScrollPos) {
6138
+ return scroll($viewport, newScrollPos, options);
6139
+ } else {
6140
+ return Promise.resolve();
6141
+ }
6126
6142
  });
6127
- firstElementRow = elementDims.top + offsetShift;
6128
- lastElementRow = firstElementRow + Math.min(elementDims.height, config.substance) - 1;
6129
- if (lastElementRow > predictLastVisibleRow()) {
6130
- newScrollPos += lastElementRow - predictLastVisibleRow();
6131
- }
6132
- if (firstElementRow < predictFirstVisibleRow() || options.top) {
6133
- newScrollPos = firstElementRow - obstruction.top;
6134
- }
6135
- if (newScrollPos < snap && elementDims.top < (0.5 * viewportHeight)) {
6136
- newScrollPos = 0;
6137
- }
6138
- if (newScrollPos !== originalScrollPos) {
6139
- return scroll($viewport, newScrollPos, options);
6140
- } else {
6141
- return Promise.resolve();
6142
- }
6143
6143
  };
6144
6144
 
6145
6145
  /**
@@ -6797,7 +6797,7 @@ is built from these functions. You can use them to extend Unpoly from your
6797
6797
  @stable
6798
6798
  */
6799
6799
  replace = function(selectorOrElement, url, options) {
6800
- var e, error, failureOptions, fullLoad, improvedFailTarget, improvedTarget, onFailure, onSuccess, promise, request, successOptions;
6800
+ var e, failureOptions, fullLoad, improvedFailTarget, improvedTarget, onFailure, onSuccess, promise, request, successOptions;
6801
6801
  options = u.options(options);
6802
6802
  options.inspectResponse = fullLoad = function() {
6803
6803
  return up.browser.navigate(url, u.only(options, 'method', 'data'));
@@ -8500,7 +8500,7 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
8500
8500
 
8501
8501
  up.request('/search', data: { query: 'sunshine' }).then(function(response) {
8502
8502
  console.log('The response text is %o', response.text);
8503
- }).fail(function() {
8503
+ }).catch(function() {
8504
8504
  console.error('The request failed');
8505
8505
  });
8506
8506
 
@@ -8591,7 +8591,7 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
8591
8591
 
8592
8592
  up.request('/search', data: { query: 'sunshine' }).then(function(text) {
8593
8593
  console.log('The response text is %o', text);
8594
- }).fail(function() {
8594
+ }).catch(function() {
8595
8595
  console.error('The request failed');
8596
8596
  });
8597
8597
 
@@ -8995,9 +8995,9 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
8995
8995
  but will also make the interaction feel less instant.
8996
8996
  @stable
8997
8997
  */
8998
- up.on('mouseover mousedown touchstart', 'a[up-preload], [up-href][up-preload]', function(event, $element) {
8999
- if (!up.link.childClicked(event, $element) && up.link.isSafe($element)) {
9000
- return checkPreload($element);
8998
+ up.on('mouseover mousedown touchstart', 'a[up-preload], [up-href][up-preload]', function(event, $link) {
8999
+ if (up.link.shouldProcessEvent(event, $link) && up.link.isSafe($link)) {
9000
+ return checkPreload($link);
9001
9001
  }
9002
9002
  });
9003
9003
  up.on('up:framework:reset', reset);
@@ -9094,7 +9094,7 @@ new page is loading.
9094
9094
 
9095
9095
  (function() {
9096
9096
  up.link = (function($) {
9097
- var DEFAULT_FOLLOW_VARIANT, addFollowVariant, allowDefault, childClicked, defaultFollow, defaultPreload, follow, followMethod, followVariantForLink, followVariants, isFollowable, isSafe, makeFollowable, u, visit;
9097
+ var DEFAULT_FOLLOW_VARIANT, addFollowVariant, allowDefault, defaultFollow, defaultPreload, follow, followMethod, followVariantForLink, followVariants, isFollowable, isSafe, makeFollowable, shouldProcessEvent, u, visit;
9098
9098
  u = up.util;
9099
9099
 
9100
9100
  /**
@@ -9305,11 +9305,12 @@ new page is loading.
9305
9305
  return $link.attr('up-follow', '');
9306
9306
  }
9307
9307
  };
9308
- childClicked = function(event, $link) {
9309
- var $target, $targetLink;
9308
+ shouldProcessEvent = function(event, $link) {
9309
+ var $target, $targetedChildLink, $targetedInput;
9310
9310
  $target = $(event.target);
9311
- $targetLink = $target.closest('a, [up-href]');
9312
- return $targetLink.length && $link.find($targetLink).length;
9311
+ $targetedChildLink = $target.closest('a, [up-href]').not($link);
9312
+ $targetedInput = up.form.fieldSelector().seekUp($target);
9313
+ return $targetedChildLink.length === 0 && $targetedInput.length === 0 && u.isUnmodifiedMouseEvent(event);
9313
9314
  };
9314
9315
 
9315
9316
  /**
@@ -9614,7 +9615,7 @@ new page is loading.
9614
9615
  makeFollowable: makeFollowable,
9615
9616
  isSafe: isSafe,
9616
9617
  isFollowable: isFollowable,
9617
- childClicked: childClicked,
9618
+ shouldProcessEvent: shouldProcessEvent,
9618
9619
  followMethod: followMethod,
9619
9620
  addFollowVariant: addFollowVariant,
9620
9621
  followVariantForLink: followVariantForLink,
@@ -9643,7 +9644,7 @@ open dialogs with sub-forms, etc. all without losing form state.
9643
9644
  var slice = [].slice;
9644
9645
 
9645
9646
  up.form = (function($) {
9646
- var autosubmit, config, findSwitcherForTarget, observe, observeField, reset, resolveValidateTarget, submit, switchTarget, switchTargets, switcherValues, u, validate;
9647
+ var autosubmit, config, fieldSelector, findSwitcherForTarget, observe, observeField, reset, resolveValidateTarget, submit, switchTarget, switchTargets, switcherValues, u, validate;
9647
9648
  u = up.util;
9648
9649
 
9649
9650
  /**
@@ -9675,6 +9676,14 @@ open dialogs with sub-forms, etc. all without losing form state.
9675
9676
  return config.reset();
9676
9677
  };
9677
9678
 
9679
+ /**
9680
+ @function up.form.fieldSelector
9681
+ @internal
9682
+ */
9683
+ fieldSelector = function() {
9684
+ return u.multiSelector(config.fields);
9685
+ };
9686
+
9678
9687
  /**
9679
9688
  Submits a form via AJAX and updates a page fragment with the response.
9680
9689
 
@@ -9887,7 +9896,7 @@ open dialogs with sub-forms, etc. all without losing form state.
9887
9896
  }
9888
9897
  delay = u.option(u.presentAttr($element, 'up-delay'), options.delay, config.observeDelay);
9889
9898
  delay = parseInt(delay);
9890
- $fields = u.multiSelector(config.fields).selectInSubtree($element);
9899
+ $fields = fieldSelector().selectInSubtree($element);
9891
9900
  destructors = u.map($fields, function(field) {
9892
9901
  return observeField($(field), delay, callback);
9893
9902
  });
@@ -10572,7 +10581,8 @@ open dialogs with sub-forms, etc. all without losing form state.
10572
10581
  observe: observe,
10573
10582
  validate: validate,
10574
10583
  switchTargets: switchTargets,
10575
- autosubmit: autosubmit
10584
+ autosubmit: autosubmit,
10585
+ fieldSelector: fieldSelector
10576
10586
  };
10577
10587
  })(jQuery);
10578
10588
 
data/dist/unpoly.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){window.up={version:"0.50.1",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,P,x,$,F,C,D,O,R,L,U,N,M,H,K,q,_,j,V,I,z,W,Q,B,J,X,G,Z,Y,tt,et,nt,rt,ot,it,ut,st,at,lt,ct,pt,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,St,Tt,Et,At,Pt,xt,$t,Ft,Ct,Dt,Ot,Rt,Lt,Ut,Nt,Mt,Ht,Kt,qt,_t,jt,Vt,It,zt,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de;return At=r.noop,gt=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},st=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},xt=function(t,e){var n,r,o;return r=Mt(t),n=r.protocol+"//"+r.hostname,st(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},z=function(t){var e;return e=Mt(location.href),t=Mt(t),e.protocol!==t.protocol||e.host!==t.host},Mt=function(t){var e;return t=ce(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),V(e.hostname)&&(e.href=e.href),e)},Pt=function(t){return t?t.toUpperCase():"GET"},bt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;d>c;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;m>h;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},S=function(t,e){var n;return n=document.createElement(t),it(e)&&(n.innerHTML=e),n},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},ee=function(t){var e,n,o,i,u,s,a,l,c;if(e=r(t),l=void 0,c=qt(e.attr("up-id")))l="[up-id='"+c+"']";else if(i=qt(e.attr("id")))l="#"+i;else if(a=qt(e.attr("name")))l="[name='"+a+"']";else if(n=qt(Et(e)))for(l="",o=0,s=n.length;s>o;o++)u=n[o],l+="."+u;else l=e.prop("tagName").toLowerCase();return l},Et=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Zt(n,function(t){return it(t)&&!t.match(/^up-/)})},Lt=function(t){return new RegExp("<"+t+"(?: [^>]*)?>","i")},T=function(t){var e,n;return e=Lt("body"),t.match(e)?(n=new DOMParser,n.parseFromString(t,"text/html")):S("div",t)},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;o>n;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,le=r.trim,$=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;i>n;r=++n)o=t[r],u.push(e(o,r));return u},dt=$,se=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(e(r));return i},et=function(t){return null===t},ct=function(t){return void 0===t},W=function(t){return!ct(t)},tt=function(t){return ct(t)||et(t)},Z=function(t){return!tt(t)},V=function(t){return tt(t)||rt(t)&&0===Object.keys(t).length||0===t.length},qt=function(t,e){return null==e&&(e=it),e(t)?t:void 0},it=function(t){return!V(t)},G=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||t instanceof String},nt=function(t){return"number"==typeof t||t instanceof Number},ot=function(t){return!("object"!=typeof t||et(t)||Y(t)||ut(t)||X(t)||j(t))},rt=function(t){var e;return e=typeof t,"object"===e&&!et(t)||"function"===e},B=function(t){return!(!t||1!==t.nodeType)},Y=function(t){return t instanceof jQuery},ut=function(t){return rt(t)&&G(t.then)},j=Array.isArray,X=function(t){return t instanceof FormData},ae=function(t){return Array.prototype.slice.call(t)},w=function(t){return j(t)?t=t.slice():rt(t)&&!G(t)?t=h({},t):up.fail("Cannot copy %o",t),t},ce=function(t){return Y(t)?t.get(0):t},yt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Nt=function(t,e){var n,r,o,i;if(o=t?w(t):{},e)for(r in e)n=e[r],i=o[r],Z(i)?rt(n)&&rt(i)&&(o[r]=Nt(i,n)):o[r]=n;return o},Ut=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],P(e,Z)},P=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;o>r;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;o>r;r++)if(n=t[r],!e(n)){i=!1;break}return i},g=function(t){return Zt(t,Z)},pe=function(t){var e;return e={},Zt(t,function(t){return e.hasOwnProperty(t)?!1:e[t]=!0})},Zt=function(t,e){var n;return n=[],$(t,function(t){return e(t)?n.push(t):void 0}),n},It=function(t,e){return Zt(t,function(t){return!e(t)})},_=function(t,e){return Zt(t,function(t){return b(e,t)})},_t=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),P(o,it)},oe=function(t,e){return setTimeout(e,t)},Tt=function(t){return setTimeout(t,0)},wt=function(t){return Promise.resolve().then(t)},ht=function(t){return t[t.length-1]},v=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Gt=gt(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),x=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Ct=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},ue=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):Ct(i)},M=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),V(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},H=function(t){return t=ce(t),t.offsetHeight},E=function(t,e,n){},mt=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},vt=function(t,e){var n,o,i,u,s,a;return e=Nt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=mt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},k=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},te=function(t,e){return t.find(e).addBack(e)},Yt=function(t,e){var n,r;return r=te(t,e),n=t.parents(e),r.add(n)},C=function(t){return 27===t.keyCode},b=function(t,e){return t.indexOf(e)>=0},m=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Dt=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},O=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=w(o),n=0,r=i.length;r>n;n++)u=i[n],delete e[u];return e},pt=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},ft=function(t){var e;return e=ct(t.button)||0===t.button,e&&pt(t)},fe=function(){return new Promise(At)},$t=function(){return r()},re=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],tt(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},Wt=function(t,e){var n;return n=t.indexOf(e),n>=0?(t.splice(n,1),e):void 0},kt=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;i>o;o++)s=t[o],at(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=$t(),s=u.parsed,o=0,i=s.length;i>o;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||$t()},u},D=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},y=function(t){var e;return e=Rt(t),Object.preventExtensions(e),e},Rt=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,G(n)&&(n=n()),h(e,n)},e.reset(),e},he=function(t){var e,n;return t=ce(t),e=t.parentNode,n=ae(t.childNodes),$(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ft=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},J=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},U=function(t,e){var n,o,i,u;return n=r(t),o=Ft(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Bt=function(t){var e,n,r,o,i,u,s;if(j(t),X(t))return up.fail("Cannot convert FormData into an array");for(u=Jt(t),e=[],s=u.split("&"),n=0,r=s.length;r>n;n++)i=s[n],it(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Jt=function(t,e){var n;if(e=Nt(e,{purpose:"url"}),at(t),X(t))return up.fail("Cannot convert FormData into a query string");if(it(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Xt=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),it(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),j(t)?t.push({name:e,value:n}):X(t)?t.append(e,n):rt(t)?t[e]=n:at(t)&&(o=Jt([{name:e,value:n}],r),t=[t,o].join("&")),t},L=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],j(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),de().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},Kt=function(t,e){var n;return n=t[e],delete t[e],n},Qt=function(t,e,n){return t[n]=Kt(t,e)},Ht=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},R=function(t){var e;return e=ht(t),ot(e)?t.pop():{}},Ot=function(t){var e;return e=r(t).css("opacity"),Z(e)?parseFloat(e):void 0},de=gt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),q=function(t){return t},Q=function(t){return t=ce(t),!jQuery.contains(document.documentElement,t)},jt=function(e){var n,r;return n=St(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=ht(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;return!this.currentTask&&(this.currentTask=this.queue.shift())?(t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))):void 0},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=dt(e,jt),this.poke(),this.promise()},e}(),ie=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},ne=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return dt(e,function(t){return t()})}},Vt=function(t){var e,n;return n=void 0,e=new Promise(function(e,r){return n=oe(t,e)}),e.cancel=function(){return clearTimeout(n)},e},K=function(t){var e,n,r,o;return e=vt(t),r=v(),n=e.left+.5*e.width,o=.5*r.width,o>n?"left":"right"},A=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},N=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;n++)o=t[n],j(o)?e=e.concat(o):e.push(o);return e},lt=function(t){return!!t},c=function(t,e){return t.then(e,e)},St=function(){var t,e;return e=void 0,It=void 0,t=new Promise(function(t,n){return e=t,It=n}),t.resolve=e,t.reject=It,t.promise=function(){return t},t},zt=function(t){var e,n;try{return t()}catch(n){return e=n,Promise.reject(e)}},I=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Bt,requestDataAsQuery:Jt,appendRequestData:f,requestDataFromForm:Xt,offsetParent:Ft,fixedToAbsolute:U,isFixed:J,presentAttr:_t,createElement:S,parseUrl:Mt,normalizeUrl:xt,normalizeMethod:Pt,methodAllowsPayload:bt,createElementFromHtml:T,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:ee,assign:h,assignPolyfill:d,copy:w,merge:yt,options:Nt,option:Ut,fail:L,each:$,map:dt,times:se,any:p,all:l,detect:P,select:Zt,reject:It,intersect:_,compact:g,uniq:pe,last:ht,isNull:et,isDefined:W,isUndefined:ct,isGiven:Z,isMissing:tt,isPresent:it,isBlank:V,presence:qt,isObject:rt,isFunction:G,isString:at,isNumber:nt,isElement:B,isJQuery:Y,isPromise:ut,isOptions:ot,isArray:j,isFormData:X,isUnmodifiedKeyEvent:pt,isUnmodifiedMouseEvent:ft,nullJQuery:$t,unJQuery:ce,setTimer:oe,nextFrame:Tt,measure:vt,temporaryCss:ue,cssAnimate:E,forceCompositing:M,forceRepaint:H,escapePressed:C,copyAttributes:k,selectInSubtree:te,selectInDynasty:Yt,contains:b,toArray:ae,castedAttr:m,clientSize:v,only:Dt,except:O,trim:le,unresolvablePromise:fe,setMissingAttrs:re,remove:Wt,memoize:gt,scrollbarWidth:Gt,documentHasVerticalScrollbar:x,config:y,openConfig:Rt,unwrapElement:he,multiSelector:kt,error:L,pluckData:Ht,pluckKey:Kt,renameKey:Qt,extractOptions:R,isDetached:Q,noop:At,opacity:Ot,whenReady:de,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:ie,sequence:ne,promiseTimer:Vt,previewable:jt,evalOption:D,horizontalScreenHalf:K,detachWith:A,flatten:N,isTruthy:lt,newDeferred:St,always:c,rejectOnError:zt,isBodyDescendant:I,isCrossDomain:z,microtask:wt}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return this.config.cachable?this.config.cachable(t):!0},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;return t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix?(t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)):void 0},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;return o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;return o=t.store[e],i=o.timestamp,!r||r>i?(n=e,r=i):void 0}}(this)),n)?delete this.store[n]:void 0},r.prototype.alias=function(e,n){var r;return r=this.get(e,{silent:!0}),t.isDefined(r)?this.set(n,r):void 0},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;return this.isEnabled()&&this.isCachable(t)?(this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}):void 0},r.prototype.remove=function(t){var e;return this.isCachable(t)?(e=this.normalizeStoreKey(t),delete this.store[e]):void 0},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),e?(n=this.timestamp()-t.timestamp,e>n):!0},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=up.dom.config.fallbackTransition),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps:this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.origin=n.origin,this.selector=up.dom.resolveSelector(t,n.origin),this.transition=n.transition||n.animation||"none",this.response=n.response,this.oldLayer=n.layer,this.steps=this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n,r;return r=t.isString(this.transition)?this.transition.split(e):[this.transition],e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(e,n){var o,i,u,s;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],s=r[n]||t.last(r),{selector:u,pseudoClass:i,transition:s}})},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;return null===this.scheduledValue||this.currentTimer||this.currentCallback?void 0:(this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this)))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;return t=this.readFieldValue(),this.isNewValue(t)?(this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()):void 0},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.shouldProcessLinkEvent=e(this.shouldProcessLinkEvent,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return this.shouldProcessLinkEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){return this.shouldProcessLinkEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onClick.apply(t,e)}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onMousedown.apply(t,e)}}(this))},r.prototype.shouldProcessLinkEvent=function(e,n){return t.isUnmodifiedMouseEvent(e)&&!up.link.childClicked(e,n)},r.prototype.followLink=function(t,e){return null==e&&(e={}),up.feedback.start(t,e,function(n){return function(){return n.followNow(t,e)}}(this))},r.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),!this.data||t.methodAllowsPayload(this.method)||t.isFormData(this.data)?void 0:this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)},a=function(t){return t.getResponseHeader(e.titleHeader);
2
- },u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;i>o;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){return u.escapePressed(e)?t(e):void 0})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){return haltEvent(t),"up:action:consumed"!==t.type?emit("up:action:consumed",{$element:$(t.target),message:!1}):void 0},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,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 t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return m=up.util,r=up.browser,n="up.log.enabled",o=m.config({prefix:"[UP] ",enabled:"true"===r.sessionStorage().getItem(n),collapse:!1}),h=function(){return o.reset()},c=function(t){return""+o.prefix+t},i=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",c(n)].concat(t.call(e))):void 0},f=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",c(n)].concat(t.call(e))):void 0},v=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["warn",c(n)].concat(t.call(e))):void 0},l=function(){var e,n,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,c(i)].concat(t.call(e)));try{return n()}finally{i&&r.puts("groupEnd")}},a=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n?r.puts.apply(r,["error",c(n)].concat(t.call(e))):void 0},p=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",t)},up.on("up:framework:boot",p),up.on("up:framework:reset",h),d=function(t){return r.sessionStorage().setItem(n,t.toString()),o.enabled=t},s=function(){return d(!0)},u=function(){return d(!1)},{puts:f,debug:i,error:a,warn:v,group:l,config:o,enable:s,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){return u()?(c.$toast.remove(),c.$toast=null):void 0},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),d(p,o,r,n)},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;return(e=y(e))?(t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)):void 0},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;i>o;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;i>o;o++)c=s[o],n=S.selectInSubtree(t,c.selector),n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})}),n.length?a.push(up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){return e=v.options(e,{force:!1}),t=s(t),!e.force&&o(t)||!up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t})?void 0:i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return up.browser.canPushState()&&n.enabled?(i=e(),window.history[t](i,"",o),a(r()),!0):!1},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){return v.isPresent(c)?(v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)):void 0}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;e>t;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n,r,o,i,s,a,l,c,p,f,h,d,m,v;return n=$(t),up.puts("Revealing fragment %o",t.get(0)),e=u.options(e),r=e.viewport?$(e.viewport):viewportOf(n),d=u.option(e.snap,config.snap),v=r.is(document),m=v?u.clientSize().height:r.outerHeight(),p=r.scrollTop(),a=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return a+l.top},h=function(){return a+m-l.bottom-1},o=u.measure(n,{relative:r,includeMargin:!0}),i=o.top+c,s=i+Math.min(o.height,config.substance)-1,s>h()&&(a+=s-h()),(i<f()||e.top)&&(a=i-l.top),d>a&&o.top<.5*m&&(a=0),a!==p?scroll(r,a,e):Promise.resolve()},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;n>e;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(r={},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),reveal(n,r)):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){return(t=up.browser.hash(t))?up.first("[id='"+t+"'], a[name='"+t+"']"):void 0},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,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,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,emitFragmentInserted,emitFragmentKept,extract,filterScripts,findKeepPlan,first,firstInLayer,firstInPriority,hello,isRealElement,isSingletonElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,source,swapElements,swapSingletonElement,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:"none",runInlineScripts:!0,runLinkedScripts:!1}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h,d;if(n=u.options(n),n.inspectResponse=s=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||s(),u.unresolvablePromise();d=u.merge(n,{humanizedTarget:"target"}),i=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0}),u.renameKey(i,"failTransition","transition"),u.renameKey(i,"failLayer","layer");try{l=bestPreflightSelector(t,d),a=bestPreflightSelector(n.failTarget,i)}catch(o){return r=o,Promise.reject(r)}return h={url:e,method:n.method,data:n.data,target:l,failTarget:a,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},p=function(t){return processResponse(!0,l,t,d)},c=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,a,t,i),u.always(e,n))},f=up.request(h),n.preload||(f=f.then(p,c)),f},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;i>o;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t;return filterScripts(l.$new,n),t=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,n),c.push(t),n=u.merge(n,{reveal:!1})});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},filterScripts=function(t,e){var n,r,o,i,s,a,l,c,p,f;for(c=u.option(e.runInlineScripts,config.runInlineScripts),p=u.option(e.runLinkedScripts,config.runLinkedScripts),r=u.selectInSubtree(t,"script"),l=[],o=0,a=r.length;a>o;o++)f=r[o],n=$(f),s=u.isPresent(n.attr("src")),i=!s,s&&p||i&&c?l.push(void 0):l.push(n.remove());return l},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;return(n=$.find(t,e)[0])?$(n):void 0}}},updateHistoryAndTitle=function(t){return t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title)?document.title=t.title:void 0},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return isSingletonElement(t)?(swapSingletonElement(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},isSingletonElement=function(t){return t.is("body")},swapSingletonElement=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;l>i;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;return n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i))))?a:void 0},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;i>r;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;return n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement?e.focus():void 0},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;s>r&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;s>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{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,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,P,x,$;return P=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=P.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=P.copy(u),g=P.copy(s),i.reset()},f=function(){return i.enabled},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return x(s,i,u)?P.isFunction(i)?i(s,u):P.isString(i)?n(s,a(i),u):P.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},x=function(t,e,n){return f()&&!h(e)&&n.duration>0&&P.all(t,P.isBodyDescendant)},S=function(t,e){return P.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=P.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,P.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=P.setTimer(n.duration+p,i),o.then(function(){var e;return t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]),e?(P.forceRepaint(t),t.css(u)):void 0}),f=P.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=P.isJQuery(n[0])?n.shift():P.nullJQuery(),o=P.isObject(n[0])?n.shift():{},r={},r.easing=P.option(u.easing,P.presentAttr(e,"up-easing"),o.easing,i.easing),
3
- r.duration=Number(P.option(u.duration,P.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(P.option(u.delay,P.presentAttr(e,"up-delay"),o.delay,i.delay)),r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t)},$=function(t,e,n,r){var o,i,u,s,a;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),P.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),up.layout.revealOrRestoreScroll(e,n).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=P.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=P.options(i),i=P.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=x(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?$(a,s,i,c):up.fail("Unknown transition %o",o):T(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(h(t))return void 0;if(P.isFunction(t))return t;if(P.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(P.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}},T=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=P.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){return 0!==t?(p+=t,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;l>a;a++)s=o[a],P.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},E=function(){return u=P.copy(v),s=P.copy(g)},h=function(t){return!t||"none"===t||P.isOptions(t)&&P.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return r=P.measure(t),o=r.top+r.height,t.css(A(0,0)),n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return r=P.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().height-r.top,t.css(A(0,0)),n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return r=P.measure(t),o=r.left+r.width,t.css(A(0,0)),n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return r=P.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().width-r.left,t.css(A(0,0)),n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=P.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",E),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,T,E,A,P,x,$,F,C,D,O,R,L,U;return L=up.util,n=void 0,T=void 0,D=void 0,w=void 0,O=void 0,A=[],c=L.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return c.cacheSize},expiry:function(){return c.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(D),D=null},$=function(){return n=null,u(),s(),w=0,c.reset(),i.clear(),O=!1,A=[]},$(),b=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=L.extractOptions(e),L.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||l(),!n&&(o=p(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=g(i),C(i,o),o["catch"](function(t){return x(i)})),r.preload||(y(),L.always(o,v)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},b.apply(null,e).then(r,n)})},h=function(){return 0===w},f=function(){return w>0},y=function(){var t;return w+=1,D?void 0:(t=function(){return f()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},D=L.setTimer(c.slowDelay,t))},v=function(){return w-=1,h()&&(s(),O)?(up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1):void 0},g=function(t){return w<c.maxRequests?m(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return m(t)},e=L.previewable(e),A.push(e),e.promise},m=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),L.always(n,F),L.always(n,k),n):(L.microtask(k),Promise.reject(new Error("Event up:proxy:load was prevented")))},P=function(t){var e,n;return n=t.request,n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||P(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},k=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,C=i.set,x=i.remove,l=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),a=function(t){var e,r;return r=parseInt(L.presentAttr(t,"up-delay"))||c.preloadDelay,t.is(n)?void 0:(n=t,u(),e=function(){return S(t),n=null},R(e,r))},R=function(t,e){return T=setTimeout(t,e)},S=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},d=function(t){return L.contains(c.safeMethods,t)},U=function(t,e,n){return L.contains(c.wrapMethods,t)&&(e=L.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.on("mouseover mousedown touchstart","a[up-preload], [up-href][up-preload]",function(t,e){return!up.link.childClicked(t,e)&&up.link.isSafe(e)?a(e):void 0}),up.on("up:framework:reset",$),{preload:S,ajax:r,request:b,get:p,alias:o,clear:l,remove:x,isIdle:h,isBusy:f,isSafeMethod:d,wrapMethod:U,config:c}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,childClicked,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(t){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;return e=$(t),isFollowable(e)?void 0:e.attr("up-follow","")},childClicked=function(t,e){var n,r;return n=$(t.target),r=n.closest("a, [up-href]"),r.length&&e.find(r).length},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,childClicked:childClicked,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,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(t,e){var n,r,o,i;return n=$(t).closest("form"),e=u.options(e),o=u.option(e.target,n.attr("up-target"),"body"),i=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.feedback.start(n),up.browser.canPushState()||e.history===!1?(r=up.replace(o,i,e),u.always(r,function(){return up.feedback.stop(n)}),r):(n.get(0).submit(),u.unresolvablePromise())},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=u.multiSelector(config.fields).selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),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,autosubmit:autosubmit}}(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 align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"),"body"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=up.browser.canPushState()?u.option(e.history,u.castedAttr(n,"up-history"),config.history):!1,e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;return e=$(t.target),e.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;return u.documentHasVerticalScrollbar()?(t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){var e;if(state.closable)return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:(up.bus.consumeAction(t),closeAsap())}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin)&&!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){return state.closable?closeAsap():void 0}),up.on("click",".up-modal [up-close]",function(t,e){return closeAsap(),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return u.isPresent(t.$link)?u.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,c,p,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var t;return null!=(t=p.$tooltip)&&t.remove(),p.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(t={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(e=p.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=f.measure(p.$anchor),p.position){case"top":t.top=e.top-n.height,t.left=e.left+.5*(e.width-n.width);break;case"left":t.top=e.top+.5*(e.height-n.height),t.left=e.left-n.width;break;case"right":t.top=e.top+.5*(e.height-n.height),t.left=e.left+e.width;break;case"bottom":t.top=e.top+e.height,t.left=e.left+.5*(e.width-n.width);break;default:up.fail("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(t);
4
- },a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),p.$tooltip=e},n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,c,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),p.phase="opening",p.$anchor=o,a({text:h,html:l}),p.position=c,e(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),p.phase="closing",up.destroy(p.$tooltip,t).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):Promise.resolve()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(t){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d;return h=up.util,o=h.config({currentClasses:["up-current"]}),l=function(){return o.reset()},i=function(){var t;return t=o.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},n="up-active",r="a, [up-href]",a=function(t){return h.isPresent(t)?h.normalizeUrl(t,{stripTrailingSlash:!0}):void 0},c=function(t){var e,n,r,o,i,u,s,l,c,p;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(e=u[n],c=h.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,i=p.length;i>r;r++)s=p[r],"#"!==s&&(s=a(s),l.push(s));return l},d=function(t){var e,n,r,o;return t=h.map(t,a),t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},s=function(){var t,n;return t=d([up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()]),n=i(),h.each(e(r),function(r){var o,i;return o=e(r),i=c(o),up.link.isSafe(o)&&t.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(t){var n;return n=e(t),n.is(r)&&(n=h.presence(n.parent(r))||n),n},p=function(){var e,r,o,i,s,a;return o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),s=h.options(o[0]),e=u(i),s.preload||e.addClass(n),r?(a=r(),h.isPromise(a)?h.always(a,function(){return f(e)}):up.warn("Expected block to return a promise, but got %o",a),a):void 0},f=function(t){var e;return e=u(t),e.removeClass(n)},up.on("up:fragment:inserted",function(){return s()}),up.on("up:fragment:destroyed",function(t,e){return e.is(".up-modal, .up-popup")?s():void 0}),up.on("up:framework:reset",l),{config:o,start:p,stop:f}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;return e()&&up.link.isFollowable(t)?(i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)):void 0})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
1
+ (function(){window.up={version:"0.50.2",renamedModule:function(t,e){return"function"==typeof Object.defineProperty?Object.defineProperty(up,t,{get:function(){return up.log.warn("up."+t+" has been renamed to up."+e),up[e]}}):void 0}}}).call(this),function(){var t=[].slice,e={}.hasOwnProperty,n=function(t,e){return function(){return t.apply(e,arguments)}};up.util=function(r){var o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,E,T,A,P,x,$,F,C,D,O,R,U,N,L,M,H,K,q,j,_,V,I,z,W,Q,B,J,X,G,Z,Y,tt,et,nt,rt,ot,it,ut,st,at,lt,ct,pt,ft,ht,dt,mt,vt,gt,yt,bt,wt,kt,St,Et,Tt,At,Pt,xt,$t,Ft,Ct,Dt,Ot,Rt,Ut,Nt,Lt,Mt,Ht,Kt,qt,jt,_t,Vt,It,zt,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de;return At=r.noop,gt=function(e){var n,r;return r=void 0,n=!1,function(){var o;return o=1<=arguments.length?t.call(arguments,0):[],n?r:(n=!0,r=e.apply(null,o))}},st=function(t,e){return e=e.toString(),(""===e||"80"===e)&&"http:"===t||"443"===e&&"https:"===t},xt=function(t,e){var n,r,o;return r=Mt(t),n=r.protocol+"//"+r.hostname,st(r.protocol,r.port)||(n+=":"+r.port),o=r.pathname,"/"!==o[0]&&(o="/"+o),(null!=e?e.stripTrailingSlash:void 0)===!0&&(o=o.replace(/\/$/,"")),n+=o,(null!=e?e.hash:void 0)===!0&&(n+=r.hash),(null!=e?e.search:void 0)!==!1&&(n+=r.search),n},z=function(t){var e;return e=Mt(location.href),t=Mt(t),e.protocol!==t.protocol||e.host!==t.host},Mt=function(t){var e;return t=ce(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),V(e.hostname)&&(e.href=e.href),e)},Pt=function(t){return t?t.toUpperCase():"GET"},bt=function(t){return"GET"!==t&&"HEAD"!==t},o=function(t){var e,n,o,i,u,s,a,l,c,p,f,h,d,m,v,g;for(v=t.split(/[ >]/),o=null,f=c=0,d=v.length;c<d;f=++c){for(s=v[f],u=s.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,h=0,m=u.length;h<m;h++)switch(a=u[h],a[0]){case".":i.push(a.substr(1));break;case"#":p=a.substr(1);break;default:g=a}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",e=r(l),n&&e.appendTo(n),0===f&&(o=e),n=e}return o},S=function(t,e){var n;return n=document.createElement(t),it(e)&&(n.innerHTML=e),n},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},ee=function(t){var e,n,o,i,u,s,a,l,c;if(e=r(t),l=void 0,c=qt(e.attr("up-id")))l="[up-id='"+c+"']";else if(i=qt(e.attr("id")))l="#"+i;else if(a=qt(e.attr("name")))l="[name='"+a+"']";else if(n=qt(Tt(e)))for(l="",o=0,s=n.length;o<s;o++)u=n[o],l+="."+u;else l=e.prop("tagName").toLowerCase();return l},Tt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Zt(n,function(t){return it(t)&&!t.match(/^up-/)})},Ut=function(t){return new RegExp("<"+t+"(?: [^>]*)?>","i")},E=function(t){var e,n;return e=Ut("body"),t.match(e)?(n=new DOMParser,n.parseFromString(t,"text/html")):S("div",t)},d=function(){var n,r,o,i,u,s,a;for(s=arguments[0],u=2<=arguments.length?t.call(arguments,1):[],n=0,o=u.length;n<o;n++){i=u[n];for(r in i)e.call(i,r)&&(a=i[r],s[r]=a)}return s},h=Object.assign||d,le=r.trim,$=function(t,e){var n,r,o,i,u;for(u=[],r=n=0,i=t.length;n<i;r=++n)o=t[r],u.push(e(o,r));return u},dt=$,se=function(t,e){var n,r,o,i;for(i=[],r=n=0,o=t-1;0<=o?n<=o:n>=o;r=0<=o?++n:--n)i.push(e(r));return i},et=function(t){return null===t},ct=function(t){return void 0===t},W=function(t){return!ct(t)},tt=function(t){return ct(t)||et(t)},Z=function(t){return!tt(t)},V=function(t){return tt(t)||rt(t)&&0===Object.keys(t).length||0===t.length},qt=function(t,e){return null==e&&(e=it),e(t)?t:void 0},it=function(t){return!V(t)},G=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||t instanceof String},nt=function(t){return"number"==typeof t||t instanceof Number},ot=function(t){return!("object"!=typeof t||et(t)||Y(t)||ut(t)||X(t)||_(t))},rt=function(t){var e;return e=typeof t,"object"===e&&!et(t)||"function"===e},B=function(t){return!(!t||1!==t.nodeType)},Y=function(t){return t instanceof jQuery},ut=function(t){return rt(t)&&G(t.then)},_=Array.isArray,X=function(t){return t instanceof FormData},ae=function(t){return Array.prototype.slice.call(t)},w=function(t){return _(t)?t=t.slice():rt(t)&&!G(t)?t=h({},t):up.fail("Cannot copy %o",t),t},ce=function(t){return Y(t)?t.get(0):t},yt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],h.apply(null,[{}].concat(t.call(e)))},Lt=function(t,e){var n,r,o,i;if(o=t?w(t):{},e)for(r in e)n=e[r],i=o[r],Z(i)?rt(n)&&rt(i)&&(o[r]=Lt(i,n)):o[r]=n;return o},Nt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],P(e,Z)},P=function(t,e){var n,r,o,i;for(i=void 0,r=0,o=t.length;r<o;r++)if(n=t[r],e(n)){i=n;break}return i},p=function(t,e){var n,r,o,i;for(i=!1,r=0,o=t.length;r<o;r++)if(n=t[r],e(n)){i=!0;break}return i},l=function(t,e){var n,r,o,i;for(i=!0,r=0,o=t.length;r<o;r++)if(n=t[r],!e(n)){i=!1;break}return i},g=function(t){return Zt(t,Z)},pe=function(t){var e;return e={},Zt(t,function(t){return!e.hasOwnProperty(t)&&(e[t]=!0)})},Zt=function(t,e){var n;return n=[],$(t,function(t){if(e(t))return n.push(t)}),n},It=function(t,e){return Zt(t,function(t){return!e(t)})},j=function(t,e){return Zt(t,function(t){return b(e,t)})},jt=function(){var e,n,r,o;return e=arguments[0],r=2<=arguments.length?t.call(arguments,1):[],o=function(){var t,o,i;for(i=[],t=0,o=r.length;t<o;t++)n=r[t],i.push(e.attr(n));return i}(),P(o,it)},oe=function(t,e){return setTimeout(e,t)},Et=function(t){return setTimeout(t,0)},wt=function(t){return Promise.resolve().then(t)},ht=function(t){return t[t.length-1]},v=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Gt=gt(function(){var t,e,n;return t=r("<div>"),t.attr("up-viewport",""),t.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),t.appendTo(document.body),e=t.get(0),n=e.offsetWidth-e.clientWidth,t.remove(),n}),x=function(){var t,e,n,o,i,u;return e=document.body,t=r(e),u=document.documentElement,n=t.css("overflow-y"),i="scroll"===n,o="hidden"===n,i||!o&&u.scrollHeight>u.clientHeight},Ct=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},ue=function(t,e,n){var o,i,u;return o=r(t),u=o.css(Object.keys(e)),o.css(e),i=function(){return o.css(u)},n?(n(),i()):Ct(i)},M=function(t){var e,n;return n=t.css(["transform","-webkit-transform"]),V(n)||"none"===n.transform?(e=function(){return t.css(n)},t.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):e=function(){},e},H=function(t){return t=ce(t),t.offsetHeight},T=function(){},mt=function(t){var e,n;return e=r(t),n=e.css(["margin-top","margin-right","margin-bottom","margin-left"]),{top:parseFloat(n["margin-top"]),right:parseFloat(n["margin-right"]),bottom:parseFloat(n["margin-bottom"]),left:parseFloat(n["margin-left"])}},vt=function(t,e){var n,o,i,u,s,a;return e=Lt(e,{relative:!1,inner:!1,includeMargin:!1}),e.relative?e.relative===!0?u=t.position():(n=r(e.relative),s=t.offset(),n.is(document)?u=s:(i=n.offset(),u={left:s.left-i.left,top:s.top-i.top})):u=t.offset(),o={left:u.left,top:u.top},e.inner?(o.width=t.width(),o.height=t.height()):(o.width=t.outerWidth(),o.height=t.outerHeight()),e.includeMargin&&(a=mt(t),o.left-=a.left,o.top-=a.top,o.height+=a.top+a.bottom,o.width+=a.left+a.right),o},k=function(t,e){var n,r,o,i,u;for(i=t.get(0).attributes,u=[],r=0,o=i.length;r<o;r++)n=i[r],n.specified?u.push(e.attr(n.name,n.value)):u.push(void 0);return u},te=function(t,e){return t.find(e).addBack(e)},Yt=function(t,e){var n,r;return r=te(t,e),n=t.parents(e),r.add(n)},C=function(t){return 27===t.keyCode},b=function(t,e){return t.indexOf(e)>=0},m=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Dt=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e={},n=0,r=i.length;n<r;n++)u=i[n],o.hasOwnProperty(u)&&(e[u]=o[u]);return e},O=function(){var e,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?t.call(arguments,1):[],e=w(o),n=0,r=i.length;n<r;n++)u=i[n],delete e[u];return e},pt=function(t){return!(t.metaKey||t.shiftKey||t.ctrlKey)},ft=function(t){var e;return e=ct(t.button)||0===t.button,e&&pt(t)},fe=function(){return new Promise(At)},$t=function(){return r()},re=function(t,e){var n,r,o;r=[];for(n in e)o=e[n],tt(t.attr(n))?r.push(t.attr(n,o)):r.push(void 0);return r},Wt=function(t,e){var n;if(n=t.indexOf(e),n>=0)return t.splice(n,1),e},kt=function(t){var e,n,o,i,u,s,a;for(u={},a=[],n=[],o=0,i=t.length;o<i;o++)s=t[o],at(s)?a.push(s):n.push(s);return u.parsed=n,a.length&&(e=a.join(", "),u.parsed.push(e)),u.select=function(){return u.find(void 0)},u.find=function(t){var e,n,o,i,s,a;for(n=$t(),s=u.parsed,o=0,i=s.length;o<i;o++)a=s[o],e=t?t.find(a):r(a),n=n.add(e);return n},u.selectInSubtree=function(t){var e;return e=u.find(t),u.doesMatch(t)&&(e=e.add(t)),e},u.doesMatch=function(t){var e;return e=r(t),p(u.parsed,function(t){return e.is(t)})},u.seekUp=function(t){var e,n,o;for(o=r(t),e=o,n=void 0;e.length;){if(u.doesMatch(e)){n=e;break}e=e.parent()}return n||$t()},u},D=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},y=function(t){var e;return e=Rt(t),Object.preventExtensions(e),e},Rt=function(t){var e;return null==t&&(t={}),e={},e.reset=function(){var n;return n=t,G(n)&&(n=n()),h(e,n)},e.reset(),e},he=function(t){var e,n;return t=ce(t),e=t.parentNode,n=ae(t.childNodes),$(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ft=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},J=function(t){var e,n;for(e=r(t);;){if(n=e.css("position"),"fixed"===n)return!0;if(e=e.parent(),0===e.length||e.is(document))return!1}},N=function(t,e){var n,o,i,u;return n=r(t),o=Ft(n),i=n.position(),u=o.offset(),n.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+e.scrollTop(),right:"",bottom:""})},Bt=function(t){var e,n,r,o,i,u,s;if(_(t),X(t))return up.fail("Cannot convert FormData into an array");for(u=Jt(t),e=[],s=u.split("&"),n=0,r=s.length;n<r;n++)i=s[n],it(i)&&(o=i.split("="),e.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return e},Jt=function(t,e){var n;if(e=Lt(e,{purpose:"url"}),at(t),X(t))return up.fail("Cannot convert FormData into a query string");if(it(t)){switch(n=r.param(t),e.purpose){case"url":n=n.replace(/\+/g,"%20");break;case"form":n=n.replace(/\%20/g,"+");break;default:up.fail("Unknown purpose %o",e.purpose)}return n}return""},u=function(t){var e,n;return n="input[type=submit], button[type=submit], button:not([type])",e=r(document.activeElement),e.is(n)&&t.has(e)?e:t.find(n).first()},Xt=function(t){var e,n,o,i,s,a;return n=r(t),a=n.find("input[type=file]").length,e=u(n),o=e.attr("name"),i=e.val(),s=a?new FormData(n.get(0)):n.serializeArray(),it(o)&&f(s,o,i),s},f=function(t,e,n,r){var o;return t||(t=[]),_(t)?t.push({name:e,value:n}):X(t)?t.append(e,n):rt(t)?t[e]=n:at(t)&&(o=Jt([{name:e,value:n}],r),t=[t,o].join("&")),t},U=function(){var e,n,r,o,i,u;throw e=1<=arguments.length?t.call(arguments,0):[],_(e[0])?(r=e[0],u=e[1]||{}):(r=e,u={}),(o=up.log).error.apply(o,r),de().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},Kt=function(t,e){var n;return n=t[e],delete t[e],n},Qt=function(t,e,n){return t[n]=Kt(t,e)},Ht=function(t,e){var n,o;return n=r(t),o=n.data(e),n.removeData(e),o},R=function(t){var e;return e=ht(t),ot(e)?t.pop():{}},Ot=function(t){var e;return e=r(t).css("opacity"),Z(e)?parseFloat(e):void 0},de=gt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),q=function(t){return t},Q=function(t){return t=ce(t),!jQuery.contains(document.documentElement,t)},_t=function(e){var n,r;return n=St(),r=function(){var r,o;return r=1<=arguments.length?t.call(arguments,0):[],o=e.apply(null,r),n.resolve(o),o},r.promise=n.promise(),r},s=function(){function e(){this.asap=n(this.asap,this),this.poke=n(this.poke,this),this.allTasks=n(this.allTasks,this),this.promise=n(this.promise,this),this.reset=n(this.reset,this),this.reset()}return e.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},e.prototype.promise=function(){var t;return t=ht(this.allTasks()),(null!=t?t.promise:void 0)||Promise.resolve()},e.prototype.allTasks=function(){var t;return t=[],this.currentTask&&t.push(this.currentTask),t=t.concat(this.queue)},e.prototype.poke=function(){var t;if(!this.currentTask&&(this.currentTask=this.queue.shift()))return t=this.currentTask(),c(t,function(t){return function(){return t.currentTask=void 0,t.poke()}}(this))},e.prototype.asap=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],this.queue=dt(e,_t),this.poke(),this.promise()},e}(),ie=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},ne=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return dt(e,function(t){return t()})}},Vt=function(t){var e,n;return n=void 0,e=new Promise(function(e){return n=oe(t,e)}),e.cancel=function(){return clearTimeout(n)},e},K=function(t){var e,n,r,o;return e=vt(t),r=v(),n=e.left+.5*e.width,o=.5*r.width,n<o?"left":"right"},A=function(t,e){var n;return n=r("<div></div>"),n.insertAfter(t),t.detach(),n.replaceWith(e),t},L=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;n<r;n++)o=t[n],_(o)?e=e.concat(o):e.push(o);return e},lt=function(t){return!!t},c=function(t,e){return t.then(e,e)},St=function(){var t,e;return e=void 0,It=void 0,t=new Promise(function(t,n){return e=t,It=n}),t.resolve=e,t.reject=It,t.promise=function(){return t},t},zt=function(t){var e;try{return t()}catch(t){return e=t,Promise.reject(e)}},I=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Bt,requestDataAsQuery:Jt,appendRequestData:f,requestDataFromForm:Xt,offsetParent:Ft,fixedToAbsolute:N,isFixed:J,presentAttr:jt,createElement:S,parseUrl:Mt,normalizeUrl:xt,normalizeMethod:Pt,methodAllowsPayload:bt,createElementFromHtml:E,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:ee,assign:h,assignPolyfill:d,copy:w,merge:yt,options:Lt,option:Nt,fail:U,each:$,map:dt,times:se,any:p,all:l,detect:P,select:Zt,reject:It,intersect:j,compact:g,uniq:pe,last:ht,isNull:et,isDefined:W,isUndefined:ct,isGiven:Z,isMissing:tt,isPresent:it,isBlank:V,presence:qt,isObject:rt,isFunction:G,isString:at,isNumber:nt,isElement:B,isJQuery:Y,isPromise:ut,isOptions:ot,isArray:_,isFormData:X,isUnmodifiedKeyEvent:pt,isUnmodifiedMouseEvent:ft,nullJQuery:$t,unJQuery:ce,setTimer:oe,nextFrame:Et,measure:vt,temporaryCss:ue,cssAnimate:T,forceCompositing:M,forceRepaint:H,escapePressed:C,copyAttributes:k,selectInSubtree:te,selectInDynasty:Yt,contains:b,toArray:ae,castedAttr:m,clientSize:v,only:Dt,except:O,trim:le,unresolvablePromise:fe,setMissingAttrs:re,remove:Wt,memoize:gt,scrollbarWidth:Gt,documentHasVerticalScrollbar:x,config:y,openConfig:Rt,unwrapElement:he,multiSelector:kt,error:U,pluckData:Ht,pluckKey:Kt,renameKey:Qt,extractOptions:R,isDetached:Q,noop:At,opacity:Ot,whenReady:de,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:ie,sequence:ne,promiseTimer:Vt,previewable:_t,evalOption:D,horizontalScreenHalf:K,detachWith:A,flatten:L,isTruthy:lt,newDeferred:St,always:c,rejectOnError:zt,isBodyDescendant:I,isCrossDomain:z,microtask:wt}}(jQuery),up.fail=up.util.fail}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Cache=function(){function r(t){this.config=null!=t?t:{},this.get=e(this.get,this),this.isFresh=e(this.isFresh,this),this.remove=e(this.remove,this),this.set=e(this.set,this),this.timestamp=e(this.timestamp,this),this.alias=e(this.alias,this),this.makeRoomForAnotherKey=e(this.makeRoomForAnotherKey,this),this.keys=e(this.keys,this),this.log=e(this.log,this),this.clear=e(this.clear,this),this.isCachable=e(this.isCachable,this),this.isEnabled=e(this.isEnabled,this),this.normalizeStoreKey=e(this.normalizeStoreKey,this),this.expiryMillis=e(this.expiryMillis,this),this.maxKeys=e(this.maxKeys,this),this.store={}}return r.prototype.maxKeys=function(){return t.evalOption(this.config.size)},r.prototype.expiryMillis=function(){return t.evalOption(this.config.expiry)},r.prototype.normalizeStoreKey=function(t){return this.config.key?this.config.key(t):this.key.toString()},r.prototype.isEnabled=function(){return 0!==this.maxKeys()&&0!==this.expiryMillis()},r.prototype.isCachable=function(t){return!this.config.cachable||this.config.cachable(t)},r.prototype.clear=function(){return this.store={}},r.prototype.log=function(){var t;if(t=1<=arguments.length?n.call(arguments,0):[],this.config.logPrefix)return t[0]="["+this.config.logPrefix+"] "+t[0],up.puts.apply(up,t)},r.prototype.keys=function(){return Object.keys(this.store)},r.prototype.makeRoomForAnotherKey=function(){var e,n,r,o;if(o=t.copy(this.keys()),e=this.maxKeys(),e&&o.length>=e&&(n=null,r=null,t.each(o,function(t){return function(e){var o,i;if(o=t.store[e],i=o.timestamp,!r||r>i)return n=e,r=i}}(this)),n))return delete this.store[n]},r.prototype.alias=function(e,n){var r;if(r=this.get(e,{silent:!0}),t.isDefined(r))return this.set(n,r)},r.prototype.timestamp=function(){return(new Date).valueOf()},r.prototype.set=function(t,e){var n;if(this.isEnabled()&&this.isCachable(t))return this.makeRoomForAnotherKey(),n=this.normalizeStoreKey(t),this.log("Setting entry %o to %o",n,e),this.store[n]={timestamp:this.timestamp(),value:e}},r.prototype.remove=function(t){var e;if(this.isCachable(t))return e=this.normalizeStoreKey(t),delete this.store[e]},r.prototype.isFresh=function(t){var e,n;return e=this.expiryMillis(),!e||(n=this.timestamp()-t.timestamp,n<e)},r.prototype.get=function(t,e){var n;return null==e&&(e={}),this.isCachable(t)&&(n=this.store[this.normalizeStoreKey(t)])?this.isFresh(n)?(e.silent||this.log("Cache hit for '%s'",t),n.value):(e.silent||this.log("Discarding stale cache entry for '%s'",t),void this.remove(t)):void(e.silent||this.log("Cache miss for '%s'",t))},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractCascade=function(){function n(n,r){this.oldPlanNotFound=e(this.oldPlanNotFound,this),this.matchingPlanNotFound=e(this.matchingPlanNotFound,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=up.dom.config.fallbackTransition),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return this.options.provideTarget?this.plans[0].selector:(t=this.oldPlan())?t.selector:this.oldPlanNotFound()},n.prototype.bestMatchingSteps=function(){var t;return(t=this.matchingPlan())?t.steps:this.matchingPlanNotFound()},n.prototype.matchingPlanNotFound=function(){var t,e;return this.newPlan()?this.oldPlanNotFound():(e=this.oldPlan()?"Could not find "+this.options.humanizedTarget+" in response":"Could not match "+this.options.humanizedTarget+" in current page and response",this.options.inspectResponse&&(t={label:"Open response",callback:this.options.inspectResponse}),up.fail([e+" (tried %o)",this.candidates],{action:t}))},n.prototype.oldPlanNotFound=function(){var t;return t=this.options.layer,"auto"===t&&(t="page, modal or popup"),up.fail("Could not find "+this.options.humanizedTarget+" in current "+t+" (tried %o)",this.candidates)},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.ExtractPlan=function(){function n(t,n){this.parseSteps=e(this.parseSteps,this),this.matchExists=e(this.matchExists,this),this.newExists=e(this.newExists,this),this.oldExists=e(this.oldExists,this),this.findNew=e(this.findNew,this),this.findOld=e(this.findOld,this),this.origin=n.origin,this.selector=up.dom.resolveSelector(t,n.origin),this.transition=n.transition||n.animation||"none",this.response=n.response,this.oldLayer=n.layer,this.steps=this.parseSteps()}return n.prototype.findOld=function(){return t.each(this.steps,function(t){return function(e){return e.$old=up.dom.first(e.selector,{layer:t.oldLayer})}}(this))},n.prototype.findNew=function(){return t.each(this.steps,function(t){return function(e){return e.$new=t.response.first(e.selector)}}(this))},n.prototype.oldExists=function(){return this.findOld(),t.all(this.steps,function(t){return t.$old})},n.prototype.newExists=function(){return this.findNew(),t.all(this.steps,function(t){return t.$new})},n.prototype.matchExists=function(){return this.oldExists()&&this.newExists()},n.prototype.parseSteps=function(){var e,n,r;return r=t.isString(this.transition)?this.transition.split(e):[this.transition],e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(e,n){var o,i,u,s;return o=e.match(/^(.+?)(?:\:(before|after))?$/),o||up.fail('Could not parse selector literal "%s"',e),u=o[1],"html"===u&&(u="body"),i=o[2],s=r[n]||t.last(r),{selector:u,pseudoClass:i,transition:s}})},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.FieldObserver=function(){function n(t,n){this.$field=t,this.check=e(this.check,this),this.readFieldValue=e(this.readFieldValue,this),this.requestCallback=e(this.requestCallback,this),this.isNewValue=e(this.isNewValue,this),this.scheduleTimer=e(this.scheduleTimer,this),this.cancelTimer=e(this.cancelTimer,this),this.stop=e(this.stop,this),this.start=e(this.start,this),this.delay=n.delay,this.callback=n.callback}var r;return r="input change",n.prototype.start=function(){return this.scheduledValue=null,this.processedValue=this.readFieldValue(),this.currentTimer=void 0,this.currentCallback=void 0,this.$field.on(r,this.check)},n.prototype.stop=function(){return this.$field.off(r,this.check),this.cancelTimer()},n.prototype.cancelTimer=function(){return clearTimeout(this.currentTimer),this.currentTimer=void 0},n.prototype.scheduleTimer=function(){return this.currentTimer=t.setTimer(this.delay,function(t){return function(){return t.currentTimer=void 0,t.requestCallback()}}(this))},n.prototype.isNewValue=function(t){return t!==this.processedValue&&(null===this.scheduledValue||this.scheduledValue!==t)},n.prototype.requestCallback=function(){var e;if(null!==this.scheduledValue&&!this.currentTimer&&!this.currentCallback)return this.processedValue=this.scheduledValue,this.scheduledValue=null,this.currentCallback=function(t){return function(){return t.callback.call(t.$field.get(0),t.processedValue,t.$field)}}(this),e=Promise.resolve(this.currentCallback()),t.always(e,function(t){return function(){return t.currentCallback=void 0,t.requestCallback()}}(this))},n.prototype.readFieldValue=function(){return t.submittedValue(this.$field)},n.prototype.check=function(){var t;if(t=this.readFieldValue(),this.isNewValue(t))return this.scheduledValue=t,this.cancelTimer(),this.scheduleTimer()},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.FollowVariant=function(){function t(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return t.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},t.prototype.onMousedown=function(t,e){if(up.link.shouldProcessEvent(t,e))return up.bus.consumeAction(t),this.followLink(e)},t.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},t.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onClick.apply(t,e)}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(t){return function(){var e;return e=1<=arguments.length?n.call(arguments,0):[],t.onMousedown.apply(t,e)}}(this))},t.prototype.followLink=function(t,e){return null==e&&(e={}),up.feedback.start(t,e,function(n){return function(){return n.followNow(t,e)}}(this))},t.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},t.prototype.matchesLink=function(t){return t.is(this.fullSelector())},t}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}};t=up.util,up.MotionTracker=function(){function n(t){this.forwardFinishEvent=e(this.forwardFinishEvent,this),this.unmarkElement=e(this.unmarkElement,this),this.markElement=e(this.markElement,this),this.whenElementFinished=e(this.whenElementFinished,this),this.finishOneElement=e(this.finishOneElement,this),this.finish=e(this.finish,this),this.claim=e(this.claim,this),this.className="up-"+t,this.dataKey="up-"+t+"-finished",this.selector="."+this.className,this.finishEvent="up:"+t+":finish"}return n.prototype.claim=function(t,e){return this.finish(t).then(function(n){return function(){return n.start(t,e)}}(this))},n.prototype.start=function(t,e){var n;return n=e(t),this.markElement(t,n),n.then(function(e){return function(){return e.unmarkElement(t)}}(this)),n},n.prototype.finish=function(e){var n,r;return n=this.expandFinishRequest(e),r=t.map(n,this.finishOneElement),Promise.all(r)},n.prototype.expandFinishRequest=function(e){return e?t.selectInDynasty($(e),this.selector):$(this.selector)},n.prototype.finishOneElement=function(t){var e;return e=$(t),e.trigger(this.finishEvent),this.whenElementFinished(e)},n.prototype.whenElementFinished=function(t){return t.data(this.dataKey)||Promise.resolve()},n.prototype.markElement=function(t,e){return t.addClass(this.className),t.data(this.dataKey,e)},n.prototype.unmarkElement=function(t){return t.removeClass(this.className),t.removeData(this.dataKey)},n.prototype.forwardFinishEvent=function(t,e,n){return this.start(t,function(r){return function(){var o;return o=function(){return e.trigger(r.finishEvent)},t.on(r.finishEvent,o),n.then(function(){return t.off(r.finishEvent,o)})}}(this))},n}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=up.util,up.Record=function(){function r(n){this.copy=e(this.copy,this),this.attributes=e(this.attributes,this),t.assign(this,this.attributes(n))}return r.prototype.fields=function(){throw"Return an array of property names"},r.prototype.attributes=function(e){return null==e&&(e=this),t.only.apply(t,[e].concat(n.call(this.fields())))},r.prototype.copy=function(e){var n;return null==e&&(e={}),n=t.merge(this.attributes(),e),new this.constructor(n)},r}()}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Request=function(r){function o(t){this.cacheKey=e(this.cacheKey,this),this.isCachable=e(this.isCachable,this),this.buildResponse=e(this.buildResponse,this),this.isCrossDomain=e(this.isCrossDomain,this),this.csrfToken=e(this.csrfToken,this),this.navigate=e(this.navigate,this),this.send=e(this.send,this),this.isSafe=e(this.isSafe,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){if(this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),this.data&&!t.methodAllowsPayload(this.method)&&!t.isFormData(this.data))return this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,c,p,f,h;l=new XMLHttpRequest,p=t.copy(e.headers),c=e.data,f=e.method,h=e.url,u=up.proxy.wrapMethod(f,c),f=u[0],c=u[1],t.isFormData(c)?delete p["Content-Type"]:t.isPresent(c)?(c=t.requestDataAsQuery(c,{purpose:"form"}),p["Content-Type"]="application/x-www-form-urlencoded"):c=null,e.target&&(p[up.protocol.config.targetHeader]=e.target),e.failTarget&&(p[up.protocol.config.failTargetHeader]=e.failTarget),e.isCrossDomain()||p["X-Requested-With"]||(p["X-Requested-With"]="XMLHttpRequest"),(o=e.csrfToken())&&(p[up.protocol.config.csrfHeader]=o),l.open(f,h);for(i in p)a=p[i],l.setRequestHeader(i,a);return s=function(){var t;return t=e.buildResponse(l),t.isSuccess()?n(t):r(t)},l.onload=s,l.onerror=s,l.ontimeout=s,e.timeout&&(l.timeout=e.timeout),l.send(c)}}(this))},o.prototype.navigate=function(){var e,n,r,o,i;return e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){if(!this.isSafe()&&!this.isCrossDomain())return up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;if(n=t.getResponseHeader(e.methodHeader))return l.normalizeMethod(n)},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),e=l.config({targetHeader:"X-Up-Target",
2
+ failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canConsole,canCssTransition,canDOMParser,canFormData,canInputEvent,canPromise,canPushState,hash,isIE10OrWorse,isRecentJQuery,isSupported,navigate,polyfilledSessionStorage,popCookie,puts,sessionStorage,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,navigate=function(t,e){var n;return null==e&&(e={}),n=new up.Request(u.merge(e,{url:t})),n.navigate()},submitForm=function(t){return t.submit()},puts=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],console[e].apply(console,t)},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(t){var e,n,r,o,i,s,a,l,c;if(s=200,r="",u.isString(t))l=t.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(t))l="undefined";else if(u.isNumber(t)||u.isFunction(t))l=t.toString();else if(u.isArray(t))l="["+u.map(t,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(t))l="$("+u.map(t,stringifyArg).join(", ")+")",r=")";else if(u.isElement(t)){for(e=$(t),l="<"+t.tagName.toLowerCase(),a=["id","name","class"],o=0,i=a.length;o<i;o++)n=a[o],(c=e.attr(n))&&(l+=" "+n+'="'+c+'"');l+=">",r=">"}else l=JSON.stringify(t);return l.length>s&&(l=l.substr(0,s)+" \u2026",l+=r),l},sprintf=function(){var t,e;return e=arguments[0],t=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,e].concat(slice.call(t)))},sprintfWithFormattedArgs=function(){var t,e,n,r;return e=arguments[0],r=arguments[1],t=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=t[n],r=e(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE10OrWorse=u.memoize(function(){return!window.atob}),canPushState=function(){return u.isDefined(history.pushState)&&"get"===up.protocol.initialRequestMethod()},canCssTransition=function(){return"transition"in document.documentElement.style},canInputEvent=function(){return"oninput"in document.createElement("input")},canPromise=function(){return!!window.Promise},canFormData=function(){return!!window.FormData},canDOMParser=function(){return!!window.DOMParser},canConsole=function(){return window.console&&console.debug&&console.info&&console.warn&&console.error&&console.group&&console.groupCollapsed&&console.groupEnd},isRecentJQuery=function(){var t,e,n,r;return r=$.fn.jquery,n=r.split("."),t=parseInt(n[0]),e=parseInt(n[1]),t>=2||1===t&&e>=9},popCookie=function(t){var e,n;return n=null!=(e=document.cookie.match(new RegExp(t+"=(\\w+)")))?e[1]:void 0,u.isPresent(n)&&(document.cookie=t+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(t){return t.preload||u.isBlank(t.confirm)||window.confirm(t.confirm)?Promise.resolve():Promise.reject(new Error("User canceled action"))},isSupported=function(){return!isIE10OrWorse()&&isRecentJQuery()&&canConsole()&&canDOMParser()&&canFormData()&&canCssTransition()&&canInputEvent()&&canPromise()},sessionStorage=u.memoize(function(){try{return window.sessionStorage}catch(t){return polyfilledSessionStorage()}}),polyfilledSessionStorage=function(){var t;return t={},{getItem:function(e){return t[e]},setItem:function(e,n){return t[e]=n}}},hash=function(t){return t||(t=location.hash),t||(t=""),"#"===t[0]&&(t=t.substr(1)),u.presence(t)},{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,navigate:navigate,submitForm:submitForm,canPushState:canPushState,whenConfirmed:whenConfirmed,isSupported:isSupported,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage,popCookie:popCookie,hash:hash,canPushState:canPushState}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,fixRenamedEvents,forgetUpDescription,haltEvent,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,renamedEvent,renamedEvents,resetBus,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,renamedEvents={},upListenerToJqueryListener=function(t){return function(e){var n;return n=e.$element||$(this),t.apply(n.get(0),[e,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(t,e){var n,r,o;return n=u.copy(t),fixRenamedEvents(n),o=n.pop(),r=void 0,e?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||up.fail("up.off(): The callback %o was never registered through up.on()",o)),n.push(r),n},fixRenamedEvents=function(t){var e;return e=t[0].split(/\s+/),e=u.map(e,function(t){var e;return(e=renamedEvents[t])?(up.log.warn(t+" has been renamed to "+e),e):t}),t[0]=e.join(" ")},live=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(t=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(e=$(document)).on.apply(e,t),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var t,e,n;return n=1<=arguments.length?slice.call(arguments,0):[],t=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(e=$(document)).off.apply(e,t)},rememberUpDescription=function(t){var e;return e=upDescriptionNumber(t),liveUpDescriptions[e]=t},forgetUpDescription=function(t){var e;return e=upDescriptionNumber(t),delete liveUpDescriptions[e]},upDescriptionNumber=function(t){return u.last(t)._descriptionNumber},emit=function(t,e){var n,r;return null==e&&(e={}),r=$.Event(t,e),(n=e.$element)?delete e.$element:n=$(document),logEmission(t,e),n.trigger(r),r},logEmission=function(t,e){var n,r,o;return e.hasOwnProperty("message")?(n=e.message,delete e.message,n!==!1&&(u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n)?u.isPresent(e)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[t],[e])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[t])):void 0):u.isPresent(e)?up.puts("Emitted event %s (%o)",t,e):up.puts("Emitted event %s",t)},nobodyPrevents=function(){var t,e;return t=1<=arguments.length?slice.call(arguments,0):[],e=emit.apply(null,t),!e.isDefaultPrevented()},whenEmitted=function(){var t;return t=1<=arguments.length?slice.call(arguments,0):[],new Promise(function(e,n){return nobodyPrevents.apply(null,t)?e():n(new Error("Event "+t[0]+" was prevented"))})},onEscape=function(t){return live("keydown","body",function(e){if(u.escapePressed(e))return t(e)})},haltEvent=function(t){return t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault()},consumeAction=function(t){if(haltEvent(t),"up:action:consumed"!==t.type)return emit("up:action:consumed",{$element:$(t.target),message:!1})},snapshot=function(){var t,e,n;n=[];for(e in liveUpDescriptions)t=liveUpDescriptions[e],n.push(t.isDefault=!0);return n},resetBus=function(){var t,e,n,r,o,i;e=[];for(o in liveUpDescriptions)t=liveUpDescriptions[o],t.isDefault||e.push(t);for(i=[],n=0,r=e.length;n<r;n++)t=e[n],i.push(unbind.apply(null,t));return i},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"}),up.protocol.reset()},renamedEvent=function(t,e){return renamedEvents[t]=e},boot=function(){return up.browser.isSupported()?(emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):"function"==typeof console.log?console.log("Unpoly doesn't support this browser. Framework was not booted."):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",resetBus),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,haltEvent:haltEvent,consumeAction:consumeAction,renamedEvent:renamedEvent,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 t=[].slice;up.log=function(){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m;return d=up.util,n=up.browser,e="up.log.enabled",r=d.config({prefix:"[UP] ",enabled:"true"===n.sessionStorage().getItem(e),collapse:!1}),f=function(){return r.reset()},l=function(t){return""+r.prefix+t},o=function(){var e,o;if(o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r.enabled&&o)return n.puts.apply(n,["debug",l(o)].concat(t.call(e)))},p=function(){var e,o;if(o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r.enabled&&o)return n.puts.apply(n,["log",l(o)].concat(t.call(e)))},m=function(){var e,r;if(r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r)return n.puts.apply(n,["warn",l(r)].concat(t.call(e)))},a=function(){var e,o,i,u;if(i=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],o=e.pop(),!r.enabled||!i)return o();u=r.collapse?"groupCollapsed":"group",n.puts.apply(n,[u,l(i)].concat(t.call(e)));try{return o()}finally{i&&n.puts("groupEnd")}},s=function(){var e,r;if(r=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],r)return n.puts.apply(n,["error",l(r)].concat(t.call(e)))},c=function(){var t;return t=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",t+=r.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",n.puts("log",t)},up.on("up:framework:boot",c),up.on("up:framework:reset",f),h=function(t){return n.sessionStorage().setItem(e,t.toString()),r.enabled=t},u=function(){return h(!0)},i=function(){return h(!1)},{puts:p,debug:o,error:s,warn:m,group:a,config:r,enable:u,disable:i}}(jQuery),up.puts=up.log.puts}.call(this),function(){var t=[].slice;up.toast=function(e){var n,r,o,i,u,s,a,l,c,p;return p=up.util,o=up.browser,n=function(t){return"<span class='up-toast-variable'>"+p.escapeHtml(t)+"</span>"},c=p.config({$toast:null}),l=function(){return i(),c.reset()},s=function(e){return p.isArray(e)?(e[0]=p.escapeHtml(e[0]),e=o.sprintfWithFormattedArgs.apply(o,[n].concat(t.call(e)))):e=p.escapeHtml(e),e},u=function(){return!!c.$toast},r=function(t,n,r){var o;return o=e('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(t)},a=function(t,n){var o,u,a,l;return null==n&&(n={}),i(),a=e('<div class="up-toast"></div>').prependTo("body"),u=e('<div class="up-toast-message"></div>').appendTo(a),o=e('<div class="up-toast-actions"></div>').appendTo(a),t=s(t),u.html(t),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),c.$toast=a},i=function(){if(u())return c.$toast.remove(),c.$toast=null},up.on("up:framework:reset",l),{open:a,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var t=[].slice;up.syntax=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S;return S=up.util,n="up-destructible",r="up-destructors",o={"[up-back]":-100,"[up-drawer]":-200,"[up-dash]":-200,"[up-expand]":-300,"[data-method]":-400,"[data-confirm]":-400},m=!0,p=[],g=[],c=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),d(p,o,r,n)},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)},h=function(t){var e,n;for(n in o)if(e=o[n],t.indexOf(n)>=0)return e},s=function(t,e,n){return{selector:t,callback:n,isSystem:m,priority:e.priority||0,batch:e.batch,keep:e.keep}},d=function(t,e,n,r){var o,i,u;if(up.browser.isSupported()){for(i=s(e,n,r),o=0;(u=t[o])&&u.priority>=i.priority;)o+=1;return t.splice(o,0,i)}},u=function(t,e,n){var r,o;return up.puts(t.isSystem?void 0:"Compiling '%s' on %o",t.selector,n),t.keep&&(o=S.isString(t.keep)?t.keep:"",e.attr("up-keep",o)),r=t.callback.apply(n,[e,f(e)]),i(e,r)},y=function(t){return S.isFunction(t)?t:S.isArray(t)&&S.all(t,S.isFunction)?S.sequence.apply(S,t):void 0},i=function(t,e){var o;if(e=y(e))return t.addClass(n),o=t.data(r)||function(){return w(t)},o=S.sequence(o,e),t.data(r,o)},w=function(t){return t.removeData(r),t.removeClass(n)},l=function(t,n){var r;return n=S.options(n),r=e(n.skip),up.log.group("Compiling fragment %o",t.get(0),function(){var n,o,i,s,a,l;for(a=[g,p],l=[],o=0,i=a.length;o<i;o++)s=a[o],l.push(function(){var o,i,a;for(a=[],o=0,i=s.length;o<i;o++)c=s[o],n=S.selectInSubtree(t,c.selector),r.length&&(n=n.filter(function(){var t;return t=e(this),S.all(r,function(e){return 0===t.closest(e).length})})),n.length?a.push(up.log.group(c.isSystem?void 0:"Compiling '%s' on %d element(s)",c.selector,n.length,function(){return c.batch?u(c,n,n.get()):n.each(function(){return u(c,e(this),this)})})):a.push(void 0);return a}());return l})},a=function(t){return b(t)()},b=function(t){var o,i;return o=S.selectInSubtree(t,"."+n),i=S.map(o,function(t){return e(t).data(r)}),i=S.compact(i),S.sequence.apply(S,i)},f=function(t){var n,r;return n=e(t),r=n.attr("up-data"),S.isString(r)&&""!==S.trim(r)?JSON.parse(r):{}},k=function(){var t;return t=function(t){return t.isSystem},p=S.select(p,t),g=S.select(g,t)},up.on("up:framework:booted",function(){return m=!1}),up.on("up:framework:reset",k),{compiler:c,macro:v,compile:l,clean:a,prepareClean:b,data:f}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(t){var e,n,r,o,i,u,s,a,l,c,p,f,h,d,m,v;return v=up.util,n=v.config({enabled:!0,popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,d=function(){return n.reset(),c=void 0,u=void 0},s=function(t,e){return e||(e={}),e.hash=!0,v.normalizeUrl(t,e)},r=function(t){return s(up.browser.url(),t)},o=function(t){var e;return e={stripTrailingSlash:!0},s(t,e)===r(e)},a=function(t){return u&&(c=u,u=void 0),u=t},h=function(t){return i("replaceState",t)},p=function(t,e){if(e=v.options(e,{force:!1}),t=s(t),(e.force||!o(t))&&up.bus.nobodyPrevents("up:history:push",{url:t,message:"Adding history entry for "+t}))return i("pushState",t)?up.emit("up:history:pushed",{url:t,message:"Advanced to location "+t}):up.emit("up:history:muted",{url:t,message:"Did not advance to "+t+" (history is unavailable)"})},i=function(t,o){var i;return!(!up.browser.canPushState()||!n.enabled)&&(i=e(),window.history[t](i,"",o),a(r()),!0)},e=function(){return{fromUp:!0}},m=function(t){var e,o,i;return(null!=t?t.fromUp:void 0)?(i=r(),up.emit("up:history:restore",{url:i,message:"Restoring location "+i}),e=n.popTargets.join(", "),o=up.replace(e,i,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll,layer:"page"}),o.then(function(){return i=r(),up.emit("up:history:restored",{url:i,message:"Restored location "+i})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",t)},l=function(t){var e;return a(r()),up.layout.saveScroll({url:c}),e=t.originalEvent.state,m(e)},up.browser.canPushState()&&(f=function(){return t(window).on("popstate",l),h(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.macro("a[up-back], [up-href][up-back]",function(t){if(v.isPresent(c))return v.setMissingAttrs(t,{"up-href":c,"up-restore-scroll":""}),t.removeAttr("up-back"),up.link.makeFollowable(t)}),up.on("up:framework:reset",d),{config:n,push:p,replace:h,url:r,isUrl:o,previousUrl:function(){return c},normalizeUrl:s}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var anchoredRight,config,finishScrolling,firstHashTarget,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealHash,revealOrRestoreScroll,revealSelector,saveScroll,scroll,scrollAbruptlyNow,scrollTopKey,scrollTops,scrollWithAnimateNow,scrollableElementForViewport,scrollingTracker,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=new up.Cache({size:30,key:up.history.normalizeUrl}),scrollingTracker=new up.MotionTracker("scrolling"),reset=function(){return config.reset(),lastScrollTops.clear(),scrollingTracker.finish()},scroll=function(t,e,n){var r;return r=scrollableElementForViewport(t),n=u.options(n),n.duration=u.option(n.duration,config.duration),n.easing=u.option(n.easing,config.easing),finishScrolling(r).then(function(){return up.motion.isEnabled()&&n.duration>0?scrollWithAnimateNow(r,e,n):scrollAbruptlyNow(r,e)})},scrollableElementForViewport=function(t){var e;return e=$(t),e.get(0)===document?$("html, body"):e},scrollWithAnimateNow=function(t,e,n){var r;return r=function(){var r,o;return r=function(){return t.finish()},t.on(scrollingTracker.eventName,r),o=t.animate({scrollTop:e},n).promise(),o.then(function(){return t.off(scrollingTracker.eventName)}),o},scrollingTracker.claim(t,r)},scrollAbruptlyNow=function(t,e){return t.scrollTop(e),Promise.resolve()},finishScrolling=function(t){var e;return e=scrollableElementForViewport(t),scrollingTracker.finish(e)},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var t,e,n,r;return n=function(t,e){var n,r;return n=$(t),r=n.css(e),u.isPresent(r)||up.fail("Fixed element %o must have a CSS attribute %s",n.get(0),e),parseFloat(r)+n.height()},e=function(){var t,e,o,i;for(o=$(config.fixedTop.join(", ")),i=[],t=0,e=o.length;t<e;t++)r=o[t],i.push(n(r,"top"));return i}(),t=function(){var t,e,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],t=0,e=o.length;t<e;t++)r=o[t],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(e))),bottom:Math.max.apply(Math,[0].concat(slice.call(t)))}},reveal=function(t,e){var n;return n=$(t),up.puts("Revealing fragment %o",n.get(0)),e=u.options(e),u.rejectOnError(function(){var t,r,o,i,s,a,l,c,p,f,h,d,m;return t=e.viewport?$(e.viewport):viewportOf(n),h=u.option(e.snap,config.snap),m=t.is(document),d=m?u.clientSize().height:t.outerHeight(),c=t.scrollTop(),s=c,l=void 0,a=void 0,m?(a=measureObstruction(),l=0):(a={top:0,bottom:0},l=c),p=function(){return s+a.top},f=function(){return s+d-a.bottom-1},r=u.measure(n,{relative:t,includeMargin:!0}),o=r.top+l,i=o+Math.min(r.height,config.substance)-1,i>f()&&(s+=i-f()),(o<p()||e.top)&&(s=o-a.top),s<h&&r.top<.5*d&&(s=0),s!==c?scroll(t,s,e):Promise.resolve()})},revealHash=function(){var t,e;return(e=up.browser.hash())&&(t=firstHashTarget(e))?reveal(t):Promise.resolve()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(t,e){var n,r;return null==e&&(e={}),n=$(t),r=viewportSelector().seekUp(n),0===r.length&&e.strict!==!1&&up.fail("Could not find viewport for %o",n),r},viewportsWithin=function(t){var e;return e=$(t),viewportSelector().selectInSubtree(e)},viewports=function(){return viewportSelector().select()},scrollTopKey=function(t){var e;return e=$(t),e.is(document)?"document":u.selectorForElement(e)},scrollTops=function(){var t,e,n,r,o;for(o={},r=config.viewports,e=0,n=r.length;e<n;e++)t=r[e],$(t).each(function(){var t,e,n;return t=$(this),e=scrollTopKey(t),n=t.scrollTop(),o[e]=n});return o},fixedChildren=function(t){var e,n;return null==t&&(t=void 0),t||(t=document.body),n=$(t),e=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(e=e.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(e=e.add(n.find(config.fixedBottom.join(", ")))),e},saveScroll=function(t){var e,n;return null==t&&(t={}),n=u.option(t.url,up.history.url()),e=u.option(t.tops,scrollTops()),lastScrollTops.set(n,e)},restoreScroll=function(t){var e,n,r,o,i;return null==t&&(t={}),i=up.history.url(),r=void 0,t.around?(n=viewportsWithin(t.around),e=viewportOf(t.around),r=e.add(n)):r=viewports(),o=lastScrollTops.get(i)||{},up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var t;return t=u.map(r,function(t){var e,n;return e=scrollTopKey(t),n=o[e]||0,scroll(t,n,{duration:0})}),Promise.all(t)})},revealOrRestoreScroll=function(t,e){var n,r,o;return n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal?(r={},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),reveal(n,r)):Promise.resolve()},revealSelector=function(t,e){return t=up.dom.resolveSelector(t,e),"#"===t[0]&&(t+=", a[name='"+t+"']"),t},firstHashTarget=function(t){if(t=up.browser.hash(t))return up.first("[id='"+t+"'], a[name='"+t+"']")},up.on("up:app:booted",revealHash),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,revealHash:revealHash,firstHashTarget:firstHashTarget,scroll:scroll,config:config,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,up.revealHash=up.layout.revealHash}.call(this),function(){up.dom=function($){var autofocus,bestMatchingSteps,bestPreflightSelector,config,destroy,emitFragmentInserted,emitFragmentKept,extract,filterScripts,findKeepPlan,first,firstInLayer,firstInPriority,hello,isRealElement,isSingletonElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,source,swapElements,swapSingletonElement,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:"none",runInlineScripts:!0,runLinkedScripts:!1}),reset=function(){return config.reset()},setSource=function(t,e){var n;return n=$(t),u.isPresent(e)&&(e=u.normalizeUrl(e)),n.attr("up-source",e)},source=function(t){var e;return e=$(t).closest("[up-source]"),u.presence(e.attr("up-source"))||up.browser.url()},resolveSelector=function(t,e){var n,r;return u.isString(t)?(r=t,u.contains(r,"&")&&(u.isPresent(e)?(n=u.selectorForElement(e),r=r.replace(/\&/,n)):up.fail("Found origin reference (%s) in selector %s, but no origin was given","&",r))):r=u.selectorForElement(t),r},replace=function(t,e,n){var r,o,i,s,a,l,c,p,f,h;if(n=u.options(n),n.inspectResponse=i=function(){return up.browser.navigate(e,u.only(n,"method","data"))},!up.browser.canPushState()&&n.history!==!1)return n.preload||i(),u.unresolvablePromise();h=u.merge(n,{humanizedTarget:"target"}),o=u.merge(n,{humanizedTarget:"failure target",provideTarget:void 0}),u.renameKey(o,"failTransition","transition"),u.renameKey(o,"failLayer","layer");try{a=bestPreflightSelector(t,h),s=bestPreflightSelector(n.failTarget,o)}catch(t){return r=t,Promise.reject(r)}return f={url:e,method:n.method,data:n.data,target:a,failTarget:s,cache:n.cache,preload:n.preload,headers:n.headers,timeout:n.timeout},c=function(t){return processResponse(!0,a,t,h)},l=function(t){var e,n;return n=function(){return Promise.reject(t)},t.isFatalError()?n():(e=processResponse(!1,s,t,o),u.always(e,n))},p=up.request(f),n.preload||(p=p.then(c,l)),p},processResponse=function(t,e,n,r){var o,i,s,a,l;return a=n.request,l=n.url,i=l,o=a.hash,r.reveal===!0&&o&&(r.reveal=o,i+=o),s="GET"===n.method,t?s?(r.history===!1||u.isString(r.history)||(r.history=i),r.source===!1||u.isString(r.source)||(r.source=l)):(u.isString(r.history)||(r.history=!1),u.isString(r.source)||(r.source="keep")):s?(r.history!==!1&&(r.history=i),r.source!==!1&&(r.source=l)):(r.history=!1,r.source="keep"),shouldExtractTitle(r)&&n.title&&(r.title=n.title),extract(e,n.text,r)},shouldExtractTitle=function(t){return!(t.title===!1||u.isString(t.title)||t.history===!1&&t.title!==!0)},extract=function(t,e,n){return up.log.group("Extracting %s from %d bytes of HTML",t,null!=e?e.length:void 0,function(){return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),n.saveScroll!==!1&&up.layout.saveScroll(),u.rejectOnError(function(){var r,o,i,s,a,l,c;for("function"==typeof n.provideTarget&&n.provideTarget(),s=parseResponseDoc(e),r=bestMatchingSteps(t,s,n),shouldExtractTitle(n)&&(a=s.title())&&(n.title=a),updateHistoryAndTitle(n),c=[],o=0,i=r.length;o<i;o++)l=r[o],up.log.group("Updating %s",l.selector,function(){var t;return filterScripts(l.$new,n),t=swapElements(l.$old,l.$new,l.pseudoClass,l.transition,n),c.push(t),n=u.merge(n,{reveal:!1})});return Promise.all(c)})})},bestPreflightSelector=function(t,e){var n;return n=new up.ExtractCascade(t,e),n.bestPreflightSelector()},bestMatchingSteps=function(t,e,n){var r;return n=u.merge(n,{response:e}),r=new up.ExtractCascade(t,n),r.bestMatchingSteps()},filterScripts=function(t,e){var n,r,o,i,s,a,l,c,p,f;for(c=u.option(e.runInlineScripts,config.runInlineScripts),p=u.option(e.runLinkedScripts,config.runLinkedScripts),r=u.selectInSubtree(t,"script"),l=[],o=0,a=r.length;o<a;o++)f=r[o],n=$(f),s=u.isPresent(n.attr("src")),i=!s,s&&p||i&&c?l.push(void 0):l.push(n.remove());return l},parseResponseDoc=function(t){var e;return e=u.createElementFromHtml(t),{title:function(){var t;return null!=(t=e.querySelector("head title"))?t.textContent:void 0},first:function(t){var n;if(n=$.find(t,e)[0])return $(n)}}},updateHistoryAndTitle=function(t){if(t=u.options(t,{historyMethod:"push"}),t.history&&up.history[t.historyMethod](t.history),u.isString(t.title))return document.title=t.title},swapElements=function(t,e,n,r,o){var i,s,a,l,c;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(t)})),up.motion.finish(t),n?(i=e.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?t.prepend(i):t.append(i),hello(i.children(),o),l=up.layout.revealOrRestoreScroll(i,o),l=l.then(function(){return up.animate(i,r,o)}),l=l.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(t,e,o))?(emitFragmentKept(a),l=Promise.resolve()):(o.keepPlans=transferKeepableElements(t,e,o),s=up.syntax.prepareClean(t),c=function(){return isSingletonElement(t)?(swapSingletonElement(t,e),r=!1):e.insertBefore(t),o.source!==!1&&setSource(e,o.source),autofocus(e),hello(e,o),up.morph(t,e,r,o)},l=destroy(t,{clean:s,beforeWipe:c,log:!1})),l},isSingletonElement=function(t){return t.is("body")},swapSingletonElement=function(t,e){return t.replaceWith(e)},transferKeepableElements=function(t,e,n){var r,o,i,s,a,l,c,p;if(s=[],n.keep)for(p=t.find("[up-keep]"),i=0,l=p.length;i<l;i++)a=p[i],r=$(a),(c=findKeepPlan(r,e,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),c.$newElement.replaceWith(r),s.push(c));return s},findKeepPlan=function(t,e,n){var r,o,i,s,a;if(n.keep&&(r=t,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?e.find(s):u.selectInSubtree(e,s),o=o.first(),o.length&&o.is("[up-keep]")&&(a={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(a,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i)))))return a},hello=function(t,e){var n,r,o,i,s,a;for(n=$(t),e=u.options(e,{keepPlans:[]}),o=[],a=e.keepPlans,r=0,i=a.length;r<i;r++)s=a[r],emitFragmentKept(s),o.push(s.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,e),n},emitFragmentInserted=function(t,e){var n;return n=$(t),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:e.origin})},emitFragmentKept=function(t){var e;return e=u.merge(t,{message:["Kept fragment %o",t.$element.get(0)]}),up.emit("up:fragment:kept",e)},autofocus=function(t){var e,n;if(n="[autofocus]:last",e=u.selectInSubtree(t,n),e.length&&e.get(0)!==document.activeElement)return e.focus()},isRealElement=function(t){var e;return e=".up-ghost, .up-destroying",0===t.closest(e).length},first=function(t,e){var n;return e=u.options(e,{layer:"auto"}),n=resolveSelector(t,e.origin),"auto"===e.layer?firstInPriority(n,e.origin):firstInLayer(n,e.layer)},firstInPriority=function(t,e){var n,r,o,i,s,a;for(i=["popup","modal","page"],n=void 0,u.isPresent(e)&&(a=layerOf(e),u.remove(i,a),i.unshift(a)),r=0,s=i.length;r<s&&(o=i[r],!(n=firstInLayer(t,o)));r++);return n},firstInLayer=function(t,e){var n,r,o,i,u,s;for(r=$(t),o=void 0,u=0,s=r.length;u<s;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,e)){o=n;break}return o},layerOf=function(t){var e;return e=$(t),up.popup.contains(e)?"popup":up.modal.contains(e)?"modal":"page"},matchesLayer=function(t,e){return layerOf(t)===e},destroy=function(t,e){var n,r,o,i,s,a;return n=$(t),e=u.options(e,{animation:!1}),shouldLogDestruction(n,e)&&(i=["Destroying fragment %o",n.get(0)],s=["Destroyed fragment %o",n.get(0)]),0===n.length?Promise.resolve():(up.emit("up:fragment:destroy",{$element:n,message:i}),n.addClass("up-destroying"),updateHistoryAndTitle(e),r=function(){var t;return t=up.motion.animateOptions(e),up.motion.animate(n,e.animation,t)},o=e.beforeWipe||Promise.resolve(),a=function(){return e.clean||(e.clean=function(){return up.syntax.clean(n)}),e.clean(),up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:s}),n.remove()},r().then(o).then(a))},shouldLogDestruction=function(t,e){return e.log!==!1&&!t.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")},reload=function(t,e){var n;return e=u.options(e,{cache:!1}),n=e.url||source(t),replace(t,n,e)},up.on("up:app:boot",function(){var t;return t=$(document.body),setSource(t,up.browser.url()),hello(t)}),up.on("up:framework:reset",reset),{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,config:config}}(jQuery),up.replace=up.dom.replace,up.extract=up.dom.extract,up.reload=up.dom.reload,up.destroy=up.dom.destroy,up.first=up.dom.first,up.hello=up.dom.hello,up.renamedModule("flow","dom")}.call(this),function(){var t=[].slice;up.motion=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,E,T,A,P,x,$;return P=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=P.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=P.copy(u),g=P.copy(s),i.reset()},f=function(){return i.enabled},n=function(t,i,u){var s;return s=e(t),u=r(u),p(s,u).then(function(){return x(s,i,u)?P.isFunction(i)?i(s,u):P.isString(i)?n(s,a(i),u):P.isOptions(i)?o(s,i,u):up.fail("Animation must be a function, animation name or object of CSS properties, but it was %o",i):S(s,i)})},x=function(t,e,n){return f()&&!h(e)&&n.duration>0&&P.all(t,P.isBodyDescendant)},S=function(t,e){return P.isOptions(e)&&t.css(e),Promise.resolve()},o=function(t,e,n){var r;return r=function(){var r,o,i,u,s,a,l,c,p,f;return c=Object.keys(e),l={"transition-property":c.join(", "),"transition-duration":n.duration+"ms","transition-delay":n.delay+"ms","transition-timing-function":n.easing},u=t.css(Object.keys(l)),o=P.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;if(e=t.originalEvent.propertyName,P.contains(c,e))return i()},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=P.setTimer(n.duration+p,i),o.then(function(){var e;if(t.off(m.finishEvent,s),t.off("transitionend",a),clearTimeout(r),f(),t.css({transition:"none"}),e=!("none"===u["transition-property"]||"all"===u["transition-property"]&&"0"===u["transition-duration"][0]))return P.forceRepaint(t),t.css(u)}),f=P.forceCompositing(t),t.css(l),t.css(e),o.promise()},m.start(t,r)},r=function(){var e,n,r,o,u;return n=1<=arguments.length?t.call(arguments,0):[],u=n.shift()||{},e=P.isJQuery(n[0])?n.shift():P.nullJQuery(),o=P.isObject(n[0])?n.shift():{},r={},r.easing=P.option(u.easing,P.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(P.option(u.duration,P.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(P.option(u.delay,P.presentAttr(e,"up-delay"),o.delay,i.delay)),r.finishedMotion=u.finishedMotion,r},a=function(t){return v[t]||up.fail("Unknown animation %o",t);
3
+ },$=function(t,e,n,r){var o,i,u,s,a;return n.copy===!1||t.is(".up-ghost")||e.is(".up-ghost")?r(t,e,n):(s=void 0,i=void 0,a=void 0,u=void 0,o=up.layout.viewportOf(t),P.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),up.layout.revealOrRestoreScroll(e,n).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=P.temporaryCss(e,{opacity:"0"}),f=r(s.$ghost,i.$ghost,n),l=s.$ghost.add(i.$ghost),c=t.add(e),m.forwardFinishEvent(c,l,f),f.then(function(){return p(),s.$bounds.remove(),i.$bounds.remove()})}))},c=function(t){return m.finish(t)},d=function(t,n,o,i){var u,s,a,c,f;return i=P.options(i),i=P.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=x(u,c,i),up.log.group(f?"Morphing %o to %o with transition %o":void 0,a.get(0),s.get(0),o,function(){return p(u,i).then(function(){return f?c?$(a,s,i,c):up.fail("Unknown transition %o",o):E(a,s,i)})})},p=function(t,e){return e.finishedMotion?Promise.resolve():(e.finishedMotion=!0,c(t))},l=function(t){var e;if(!h(t)){if(P.isFunction(t))return t;if(P.isArray(t))return h(t[0])&&h(t[1])?void 0:function(e,r,o){return Promise.all([n(e,t[0],o),n(r,t[1],o)])};if(P.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}}},E=function(t,e,n){return t.hide(),up.layout.revealOrRestoreScroll(e,n)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=P.measure(t,{relative:!0,inner:!0}),i=t.clone(),i.find("script").remove(),i.css({position:"static"===t.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=e('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(t){if(0!==t)return p+=t,r.css({top:p})},i.appendTo(r),r.insertBefore(t),c(t.offset().top-i.offset().top),o=up.layout.fixedChildren(i),a=0,l=o.length;a<l;a++)s=o[a],P.fixedToAbsolute(s,n);return{$ghost:i,$bounds:r,moveTop:c}},w=function(t,e){return g[t]=e},b=function(t,e){return v[t]=e},T=function(){return u=P.copy(v),s=P.copy(g)},h=function(t){return!t||"none"===t||P.isOptions(t)&&P.isBlank(t)},b("fade-in",function(t,e){return t.css({opacity:0}),n(t,{opacity:1},e)}),b("fade-out",function(t,e){return t.css({opacity:1}),n(t,{opacity:0},e)}),A=function(t,e){return{transform:"translate("+t+"px, "+e+"px)"}},b("move-to-top",function(t,e){var r,o;return r=P.measure(t),o=r.top+r.height,t.css(A(0,0)),n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return r=P.measure(t),o=r.top+r.height,t.css(A(0,-o)),n(t,A(0,0),e)}),b("move-to-bottom",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().height-r.top,t.css(A(0,0)),n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().height-r.top,t.css(A(0,o)),n(t,A(0,0),e)}),b("move-to-left",function(t,e){var r,o;return r=P.measure(t),o=r.left+r.width,t.css(A(0,0)),n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return r=P.measure(t),o=r.left+r.width,t.css(A(-o,0)),n(t,A(0,0),e)}),b("move-to-right",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().width-r.left,t.css(A(0,0)),n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return r=P.measure(t),o=P.clientSize().width-r.left,t.css(A(o,0)),n(t,A(0,0),e)}),b("roll-down",function(t,e){var r,o,i;return o=t.height(),i=P.temporaryCss(t,{height:"0px",overflow:"hidden"}),r=n(t,{height:o+"px"},e),r.then(i),r}),w("move-left","move-to-left/move-from-right"),w("move-right","move-to-right/move-from-left"),w("move-up","move-to-top/move-from-bottom"),w("move-down","move-to-bottom/move-from-top"),w("cross-fade","fade-out/fade-in"),up.on("up:framework:booted",T),up.on("up:framework:reset",k),{morph:d,animate:n,animateOptions:r,finish:c,transition:w,animation:b,config:i,isEnabled:f,prependCopy:y,isNone:h}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var t=[].slice;up.proxy=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d,m,v,g,y,b,w,k,S,E,T,A,P,x,$,F,C,D,O,R,U,N;return U=up.util,n=void 0,E=void 0,D=void 0,w=void 0,O=void 0,A=[],c=U.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return c.cacheSize},expiry:function(){return c.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),p=function(t){var e,n,r,o,u,s,a;for(t=up.Request.wrap(t),n=[t],"html"!==t.target&&(s=t.copy({target:"html"}),n.push(s),"body"!==t.target&&(u=t.copy({target:"body"}),n.push(u))),r=0,o=n.length;r<o;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(E),E=null},s=function(){return clearTimeout(D),D=null},$=function(){return n=null,u(),s(),w=0,c.reset(),i.clear(),O=!1,A=[]},$(),b=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=U.extractOptions(e),U.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||l(),!n&&(o=p(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=g(i),C(i,o),o["catch"](function(){return x(i)})),r.preload||(y(),U.always(o,v)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},b.apply(null,e).then(r,n)})},h=function(){return 0===w},f=function(){return w>0},y=function(){var t;if(w+=1,!D)return t=function(){if(f())return up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0},D=U.setTimer(c.slowDelay,t)},v=function(){if(w-=1,h()&&(s(),O))return up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1},g=function(t){return w<c.maxRequests?m(t):T(t)},T=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return m(t)},e=U.previewable(e),A.push(e),e.promise},m=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),U.always(n,F),U.always(n,k),n):(U.microtask(k),Promise.reject(new Error("Event up:proxy:load was prevented")))},P=function(t){var e,n;if(n=t.request,n.url!==t.url)return e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||P(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},k=function(){var t;"function"==typeof(t=A.shift())&&t()},o=i.alias,C=i.set,x=i.remove,l=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),a=function(t){var e,r;if(r=parseInt(U.presentAttr(t,"up-delay"))||c.preloadDelay,!t.is(n))return n=t,u(),e=function(){return S(t),n=null},R(e,r)},R=function(t,e){return E=setTimeout(t,e)},S=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},d=function(t){return U.contains(c.safeMethods,t)},N=function(t,e,n){return U.contains(c.wrapMethods,t)&&(e=U.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.on("mouseover mousedown touchstart","a[up-preload], [up-href][up-preload]",function(t,e){if(up.link.shouldProcessEvent(t,e)&&up.link.isSafe(e))return a(e)}),up.on("up:framework:reset",$),{preload:S,ajax:r,request:b,get:p,alias:o,clear:l,remove:x,isIdle:h,isBusy:f,isSafeMethod:d,wrapMethod:N,config:c}}(jQuery),up.ajax=up.proxy.ajax,up.request=up.proxy.request}.call(this),function(){up.link=function($){var DEFAULT_FOLLOW_VARIANT,addFollowVariant,allowDefault,defaultFollow,defaultPreload,follow,followMethod,followVariantForLink,followVariants,isFollowable,isSafe,makeFollowable,shouldProcessEvent,u,visit;return u=up.util,visit=function(t,e){var n;return e=u.options(e),n=u.option(e.target,"body"),up.replace(n,t,e)},follow=function(t,e){var n,r;return n=$(t),r=followVariantForLink(n),r.followLink(n,e)},defaultFollow=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(e.target,n.attr("up-target")),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.history=u.option(e.history,u.castedAttr(n,"up-history")),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.method=followMethod(n,e),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e=u.merge(e,up.motion.animateOptions(e,n)),up.browser.whenConfirmed(e).then(function(){return up.replace(r,o,e)})},defaultPreload=function(t,e){return e=u.options(e),e.preload=!0,defaultFollow(t,e)},followMethod=function(t,e){var n;return n=$(t),e=u.options(e),u.option(e.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},allowDefault=function(){},followVariants=[],addFollowVariant=function(t,e){var n;return n=new up.FollowVariant(t,e),followVariants.push(n),n.registerEvents(),n},isFollowable=function(t){return!!followVariantForLink(t,{"default":!1})},followVariantForLink=function(t,e){var n,r;return e=u.options(e),n=$(t),r=u.detect(followVariants,function(t){return t.matchesLink(n)}),e["default"]!==!1&&(r||(r=DEFAULT_FOLLOW_VARIANT)),r},makeFollowable=function(t){var e;if(e=$(t),!isFollowable(e))return e.attr("up-follow","")},shouldProcessEvent=function(t,e){var n,r,o;return n=$(t.target),r=n.closest("a, [up-href]").not(e),o=up.form.fieldSelector().seekUp(n),0===r.length&&0===o.length&&u.isUnmodifiedMouseEvent(t)},isSafe=function(t,e){var n,r;return n=$(t),r=followMethod(n,e),up.proxy.isSafeMethod(r)},DEFAULT_FOLLOW_VARIANT=addFollowVariant("[up-target], [up-follow]",{follow:function(t,e){return defaultFollow(t,e)},preload:function(t,e){return defaultPreload(t,e)}}),up.macro("[up-dash]",function(t){var e,n;return n=u.castedAttr(t,"up-dash"),t.removeAttr("up-dash"),e={"up-preload":"","up-instant":""},n===!0?makeFollowable(t):e["up-target"]=n,u.setMissingAttrs(t,e)}),up.macro("[up-expand]",function(t){var e,n,r,o,i,s,a,l,c,p;if(e=t.find("a, [up-href]"),(c=t.attr("up-expand"))&&(e=e.filter(c)),i=e.get(0)){for(p=/^up-/,a={},a["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;r<o;r++)n=l[r],s=n.name,s.match(p)&&(a[s]=n.value);return u.setMissingAttrs(t,a),t.removeAttr("up-expand"),makeFollowable(t)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,isSafe:isSafe,isFollowable:isFollowable,shouldProcessEvent:shouldProcessEvent,followMethod:followMethod,addFollowVariant:addFollowVariant,followVariantForLink:followVariantForLink,allowDefault:allowDefault}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,fieldSelector,findSwitcherForTarget,observe,observeField,reset,resolveValidateTarget,submit,switchTarget,switchTargets,switcherValues,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()},fieldSelector=function(){return u.multiSelector(config.fields)},submit=function(t,e){var n,r,o,i;return n=$(t).closest("form"),e=u.options(e),o=u.option(e.target,n.attr("up-target"),"body"),i=u.option(e.url,n.attr("action"),up.browser.url()),e.failTarget=u.option(e.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),e.fallback=u.option(e.fallback,n.attr("up-fallback")),e.history=u.option(e.history,u.castedAttr(n,"up-history"),!0),e.transition=u.option(e.transition,u.castedAttr(n,"up-transition"),"none"),e.failTransition=u.option(e.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),e.method=u.option(e.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),e.headers=u.option(e.headers,{}),e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.cache=u.option(e.cache,u.castedAttr(n,"up-cache")),e.restoreScroll=u.option(e.restoreScroll,u.castedAttr(n,"up-restore-scroll")),e.origin=u.option(e.origin,n),e.layer=u.option(e.layer,n.attr("up-layer"),"auto"),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.data=u.requestDataFromForm(n),e=u.merge(e,up.motion.animateOptions(e,n)),e.validate&&(e.headers||(e.headers={}),e.transition=!1,e.failTransition=!1,e.headers[up.protocol.config.validateHeader]=e.validate),up.feedback.start(n),up.browser.canPushState()||e.history===!1?(r=up.replace(o,i,e),u.always(r,function(){return up.feedback.stop(n)}),r):(n.get(0).submit(),u.unresolvablePromise())},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($element,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option(u.presentAttr($element,"up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),$fields=fieldSelector().selectInSubtree($element),destructors=u.map($fields,function(t){return observeField($(t),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(t,e,n){var r;return r=new up.FieldObserver(t,{delay:e,callback:n}),r.start(),r.stop},autosubmit=function(t,e){return observe(t,e,function(t,e){var n;return n=e.closest("form"),up.feedback.start(e,function(){return submit(n)})})},resolveValidateTarget=function(t,e){var n;return n=u.option(e.target,t.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.dom.resolveSelector(n,e.origin),t.closest(r).length}))),u.isBlank(n)&&up.fail("Could not find default validation target for %o (tried ancestors %o)",t.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(t,e){var n,r,o;return n=$(t),e=u.options(e),e.origin=n,e.target=resolveValidateTarget(n,e),e.failTarget=e.target,e.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!1),e.history=!1,e.headers=u.option(e.headers,{}),e.validate=n.attr("name")||"__none__",e=u.merge(e,up.motion.animateOptions(e,n)),r=n.closest("form"),o=up.submit(r,e)},switcherValues=function(t){var e,n,r,o;return t.is("input[type=checkbox]")?t.is(":checked")?(r=t.val(),n=":checked"):n=":unchecked":t.is("input[type=radio]")?(e=t.closest("form, body").find("input[type='radio'][name='"+t.attr("name")+"']:checked"),e.length?(n=":checked",r=e.val()):n=":unchecked"):r=t.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(t,e){var n,r,o;return n=$(t),e=u.options(e),o=u.option(e.target,n.attr("up-switch")),u.isPresent(o)||up.fail("No switch target given for %o",n.get(0)),r=switcherValues(n),$(o).each(function(){return switchTarget($(this),r)})},switchTarget=function(t,e){var n,r,o,i;return n=$(t),e||(e=switcherValues(findSwitcherForTarget(n))),(r=n.attr("up-hide-for"))?(r=r.split(" "),o=0===u.intersect(e,r).length):(i=(i=n.attr("up-show-for"))?i.split(" "):[":present",":checked"],o=u.intersect(e,i).length>0),n.toggle(o),n.addClass("up-switched")},findSwitcherForTarget=function(t){var e,n;return e=$("[up-switch]"),n=u.detect(e,function(e){var n;return n=$(e).attr("up-switch"),t.is(n)}),n?$(n):u.fail("Could not find [up-switch] field for %o",t.get(0))},up.on("submit","form[up-target]",function(t,e){return up.bus.consumeAction(t),submit(e)}),up.on("change","[up-validate]",function(t,e){return validate(e)}),up.compiler("[up-switch]",function(t){return switchTargets(t)}),up.on("change","[up-switch]",function(t,e){return switchTargets(e)}),up.compiler("[up-show-for]:not(.up-switched), [up-hide-for]:not(.up-switched)",function(t){return switchTarget(t)}),up.compiler("[up-observe]",function(t){return observe(t)}),up.compiler("[up-autosubmit]",function(t){return autosubmit(t)}),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,autosubmit:autosubmit,fieldSelector:fieldSelector}}(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 align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,isOpen,preloadNow,reset,state,toggleAsap,u,unveilFrame;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$popup)&&t.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var t,e,n;switch(t={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(e=state.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=u.measure(state.$anchor),state.position){case"bottom-right":t.top=e.top+e.height,t.left=e.left+e.width-n.width;break;case"bottom-left":t.top=e.top+e.height,t.left=e.left;break;case"top-right":t.top=e.top-n.height,t.left=e.left+e.width-n.width;break;case"top-left":t.top=e.top-n.height,t.left=e.left;break;default:up.fail("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(t)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t){var e;return e=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(t,e),e.hide(),e.appendTo(document.body),state.$popup=e},unveilFrame=function(){return state.$popup.show()},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(t,e){return chain.asap(closeNow,function(){return attachNow(t,e)})},attachNow=function(t,e){var n,r,o,i,s,a,l;return n=$(t),n.length||up.fail("Cannot attach popup to non-existing element %o",t),e=u.options(e),l=u.option(u.pluckKey(e,"url"),n.attr("up-href"),n.attr("href")),i=u.option(u.pluckKey(e,"html")),l||i||up.fail("up.popup.attach() requires either an { url } or { html } option"),a=u.option(u.pluckKey(e,"target"),n.attr("up-popup"),"body"),s=u.option(e.position,n.attr("up-position"),config.position),e.animation=u.option(e.animation,n.attr("up-animation"),config.openAnimation),e.sticky=u.option(e.sticky,u.castedAttr(n,"up-sticky"),config.sticky),e.history=!!up.browser.canPushState()&&u.option(e.history,u.castedAttr(n,"up-history"),config.history),e.confirm=u.option(e.confirm,n.attr("up-confirm")),e.method=up.link.followMethod(n,e),e.layer="popup",e.failTarget=u.option(e.failTarget,n.attr("up-fail-target")),e.failLayer=u.option(e.failLayer,n.attr("up-fail-layer"),"auto"),e.provideTarget=function(){return createHiddenFrame(a)},r=up.motion.animateOptions(e,n,{duration:config.openDuration,easing:config.openEasing}),o=u.merge(e,{animation:!1}),e.preload&&l?up.replace(a,l,e):up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:popup:open",{url:l,message:"Opening popup"}).then(function(){var t;return state.phase="opening",state.$anchor=n,state.position=s,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=e.sticky,t=i?up.extract(a,i,o):up.replace(a,l,o),t=t.then(function(){return align(),unveilFrame(),up.animate(state.$popup,e.animation,r)}),t=t.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e;return isOpen()?(t=u.options(t,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),e=up.motion.animateOptions(t,{duration:config.closeDuration,easing:config.closeEasing}),u.assign(t,e),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,t).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):Promise.resolve()},preloadNow=function(t,e){return e=u.options(e),e.preload=!0,attachNow(t,e)},toggleAsap=function(t,e){return t.is(".up-current")?closeAsap():attachAsap(t,e)},autoclose=function(){if(!state.sticky)return discardHistory(),closeAsap()},contains=function(t){var e;return e=$(t),e.closest(".up-popup").length>0},up.link.addFollowVariant("[up-popup]",{follow:function(t,e){return toggleAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click up:action:consumed",function(t){var e;if(e=$(t.target),!e.closest(".up-popup, [up-popup]").length)return closeAsap()}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click",".up-popup [up-close]",function(t){return closeAsap(),up.bus.consumeAction(t)}),up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createHiddenFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,preloadNow,reset,shiftElements,state,templateHtml,u,unshiftElements,unveilFrame,visitAsap;return u=up.util,config=u.config({maxWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",closable:!0,sticky:!1,flavor:"default",position:null,template:function(t){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+t.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var t;return null!=(t=state.$modal)&&t.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var t;return t=flavorDefault("template"),u.evalOption(t,{closeLabel:flavorDefault("closeLabel")})},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createHiddenFrame=function(t,e){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),u.isPresent(state.position)&&o.attr("up-position",state.position),r=o.find(".up-modal-dialog"),u.isPresent(e.width)&&r.css("width",e.width),u.isPresent(e.maxWidth)&&r.css("max-width",e.maxWidth),u.isPresent(e.height)&&r.css("height",e.height),state.closable||o.find(".up-modal-close").remove(),n=o.find(".up-modal-content"),u.$createPlaceholder(t,n),o.hide(),o.appendTo(document.body),state.$modal=o},unveilFrame=function(){return state.$modal.show()},shiftElements=function(){var t,e,n,r,o;if(u.documentHasVerticalScrollbar())return t=$("body"),r=u.scrollbarWidth(),e=parseFloat(t.css("padding-right")),n=r+e,o=u.temporaryCss(t,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var t,e,n,o;return t=$(this),e=parseFloat(t.css("right")),n=r+e,o=u.temporaryCss(t,{right:n}),state.unshifters.push(o)})},unshiftElements=function(){var t,e;for(t=[];e=state.unshifters.pop();)t.push(e());return t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(t,e){return e=u.options(e),e.$link=$(t),openAsap(e)},preloadNow=function(t,e){return e=u.options(e),e.$link=t,e.preload=!0,openNow(e)},visitAsap=function(t,e){return e=u.options(e),e.url=t,openAsap(e)},extractAsap=function(t,e,n){return n=u.options(n),n.html=e,n.history=u.option(n.history,!1),n.target=t,openAsap(n)},openAsap=function(t){return chain.asap(closeNow,function(){return openNow(t)})},openNow=function(t){var e,n,r,o,i;return t=u.options(t),e=u.option(u.pluckKey(t,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(t,"url"),e.attr("up-href"),e.attr("href")),r=u.option(u.pluckKey(t,"html")),o=u.option(u.pluckKey(t,"target"),e.attr("up-modal"),"body"),t.flavor=u.option(t.flavor,e.attr("up-flavor"),config.flavor),t.position=u.option(t.position,e.attr("up-position"),flavorDefault("position",t.flavor)),t.position=u.evalOption(t.position,{$link:e}),t.width=u.option(t.width,e.attr("up-width"),flavorDefault("width",t.flavor)),t.maxWidth=u.option(t.maxWidth,e.attr("up-max-width"),flavorDefault("maxWidth",t.flavor)),t.height=u.option(t.height,e.attr("up-height"),flavorDefault("height")),t.animation=u.option(t.animation,e.attr("up-animation"),flavorDefault("openAnimation",t.flavor)),t.animation=u.evalOption(t.animation,{position:t.position}),t.backdropAnimation=u.option(t.backdropAnimation,e.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",t.flavor)),t.backdropAnimation=u.evalOption(t.backdropAnimation,{position:t.position}),t.sticky=u.option(t.sticky,u.castedAttr(e,"up-sticky"),flavorDefault("sticky",t.flavor)),t.closable=u.option(t.closable,u.castedAttr(e,"up-closable"),flavorDefault("closable",t.flavor)),t.confirm=u.option(t.confirm,e.attr("up-confirm")),t.method=up.link.followMethod(e,t),t.layer="modal",t.failTarget=u.option(t.failTarget,e.attr("up-fail-target")),t.failLayer=u.option(t.failLayer,e.attr("up-fail-layer"),"auto"),n=up.motion.animateOptions(t,e,{duration:flavorDefault("openDuration",t.flavor),easing:flavorDefault("openEasing",t.flavor)}),t.history=u.option(t.history,u.castedAttr(e,"up-history"),flavorDefault("history",t.flavor)),up.browser.canPushState()||(t.history=!1),t.provideTarget=function(){return createHiddenFrame(o,t)},t.preload?up.replace(o,i,t):up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var e,s;return state.phase="opening",state.flavor=t.flavor,state.sticky=t.sticky,state.closable=t.closable,state.position=t.position,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e=u.merge(t,{animation:!1}),s=r?up.extract(o,r,e):up.replace(o,i,e),s=s.then(function(){return shiftElements(),unveilFrame(),animate(t.animation,t.backdropAnimation,n)}),s=s.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(t){return chain.asap(function(){return closeNow(t)})},closeNow=function(t){var e,n,r,o;return t=u.options(t),isOpen()?(o=u.option(t.animation,flavorDefault("closeAnimation")),o=u.evalOption(o,{position:state.position}),n=u.option(t.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),e=up.motion.animateOptions(t,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(t,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var t;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,t=animate(o,n,e),t=t.then(function(){return up.destroy(state.$modal,r)}),t=t.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,state.closable=null,state.position=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):Promise.resolve()},markAsAnimating=function(t){return null==t&&(t=!0),state.$modal.toggleClass("up-modal-animating",t)},animate=function(t,e,n){var r;return up.motion.isNone(t)?Promise.resolve():(markAsAnimating(),r=Promise.all([up.animate(state.$modal.find(".up-modal-viewport"),t,n),up.animate(state.$modal.find(".up-modal-backdrop"),e,n)]),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){if(!state.sticky)return discardHistory(),closeAsap()},contains=function(t){var e;return e=$(t),e.closest(".up-modal").length>0},flavor=function(t,e){return null==e&&(e={}),up.log.warn("up.modal.flavor() is deprecated. Use the up.modal.flavors property instead."),u.assign(flavorOverrides(t),e)},flavorOverrides=function(t){return flavors[t]||(flavors[t]={})},flavorDefault=function(t,e){var n;return null==e&&(e=state.flavor),e&&(n=flavorOverrides(e)[t]),u.isMissing(n)&&(n=config[t]),n},up.link.addFollowVariant("[up-modal]",{follow:function(t,e){return followAsap(t,e)},preload:function(t,e){return preloadNow(t,e)}}),up.on("click",".up-modal",function(t){var e;if(state.closable)return e=$(t.target),e.closest(".up-modal-dialog").length||e.closest("[up-modal]").length?void 0:(up.bus.consumeAction(t),closeAsap())}),up.on("up:fragment:inserted",function(t,e){var n;if(contains(e)){if(n=e.attr("up-source"))return state.url=n}else if(contains(t.origin)&&!up.popup.contains(e))return autoclose()}),up.bus.onEscape(function(){if(state.closable)return closeAsap()}),up.on("click",".up-modal [up-close]",function(t){return closeAsap(),up.bus.consumeAction(t)}),up.macro("a[up-drawer], [up-href][up-drawer]",function(t){var e;return e=t.attr("up-drawer"),t.attr({"up-modal":e,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(t){switch(t.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(t){switch(t.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(t){return u.isPresent(t.$link)?u.horizontalScreenHalf(t.$link):"left"}},up.on("up:history:restore",closeAsap),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(t){var e,n,r,o,i,u,s,a,l,c,p,f;return f=up.util,s=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var t;return null!=(t=p.$tooltip)&&t.remove(),p.reset(),o.reset(),s.reset()},e=function(){var t,e,n;switch(t={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(e=p.$anchor.get(0).getBoundingClientRect(),t.position="fixed"):e=f.measure(p.$anchor),p.position){case"top":t.top=e.top-n.height,t.left=e.left+.5*(e.width-n.width);break;case"left":t.top=e.top+.5*(e.height-n.height),t.left=e.left-n.width;break;case"right":t.top=e.top+.5*(e.height-n.height),t.left=e.left+e.width;break;case"bottom":t.top=e.top+e.height,t.left=e.left+.5*(e.width-n.width);break;default:up.fail("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(t)},a=function(t){var e;return e=f.$createElementFromSelector(".up-tooltip"),f.isGiven(t.text)?e.text(t.text):e.html(t.html),e.appendTo(document.body),p.$tooltip=e;
4
+ },n=function(t,e){return null==e&&(e={}),o.asap(u,function(){return r(t,e)})},r=function(n,r){var o,i,u,l,c,h;return o=t(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),h=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),s.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),s.openAnimation),i=up.motion.animateOptions(r,o,{duration:s.openDuration,easing:s.openEasing}),p.phase="opening",p.$anchor=o,a({text:h,html:l}),p.position=c,e(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(t){return o.asap(function(){return u(t)})},u=function(t){var e;return l()?(t=f.options(t,{animation:s.closeAnimation}),e=up.motion.animateOptions(t,{duration:s.closeDuration,easing:s.closeEasing}),f.assign(t,e),p.phase="closing",up.destroy(p.$tooltip,t).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):Promise.resolve()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(t){return t.on("mouseenter",function(){return n(t)}),t.on("mouseleave",function(){return i()})}),up.on("click up:action:consumed",function(){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:s,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var t=[].slice;up.feedback=function(e){var n,r,o,i,u,s,a,l,c,p,f,h,d;return h=up.util,o=h.config({currentClasses:["up-current"]}),l=function(){return o.reset()},i=function(){var t;return t=o.currentClasses,t=t.concat(["up-current"]),t=h.uniq(t),t.join(" ")},n="up-active",r="a, [up-href]",a=function(t){if(h.isPresent(t))return h.normalizeUrl(t,{stripTrailingSlash:!0})},c=function(t){var e,n,r,o,i,u,s,l,c,p;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;n<o;n++)if(e=u[n],c=h.presentAttr(t,e))for(p="up-alias"===e?c.split(" "):[c],r=0,i=p.length;r<i;r++)s=p[r],"#"!==s&&(s=a(s),l.push(s));return l},d=function(t){var e,n,r,o;return t=h.map(t,a),t=h.compact(t),r=function(t){return"*"===t.substr(-1)?n(t.slice(0,-1)):e(t)},e=function(e){return h.contains(t,e)},n=function(e){return h.detect(t,function(t){return 0===t.indexOf(e)})},o=function(t){return h.detect(t,r)},{matchesAny:o}},s=function(){var t,n;return t=d([up.browser.url(),up.modal.url(),up.modal.coveredUrl(),up.popup.url(),up.popup.coveredUrl()]),n=i(),h.each(e(r),function(r){var o,i;return o=e(r),i=c(o),up.link.isSafe(o)&&t.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(t){var n;return n=e(t),n.is(r)&&(n=h.presence(n.parent(r))||n),n},p=function(){var e,r,o,i,s,a;if(o=1<=arguments.length?t.call(arguments,0):[],i=o.shift(),r=o.pop(),s=h.options(o[0]),e=u(i),s.preload||e.addClass(n),r)return a=r(),h.isPromise(a)?h.always(a,function(){return f(e)}):up.warn("Expected block to return a promise, but got %o",a),a},f=function(t){var e;return e=u(t),e.removeClass(n)},up.on("up:fragment:inserted",function(){return s()}),up.on("up:fragment:destroyed",function(t,e){if(e.is(".up-modal, .up-popup"))return s()}),up.on("up:framework:reset",l),{config:o,start:p,stop:f}}(jQuery),up.renamedModule("navigation","feedback")}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;if(e()&&up.link.isFollowable(t))return i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
@@ -17,7 +17,9 @@ class up.ExtractCascade
17
17
  candidates = [selector, @options.fallback, up.dom.config.fallbacks]
18
18
  candidates = u.flatten(candidates)
19
19
  # Remove undefined, null and false from the list
20
- candidates = u.select candidates, u.isTruthy
20
+ candidates = u.select(candidates, u.isTruthy)
21
+ candidates = u.uniq(candidates)
22
+
21
23
  if @options.fallback == false || @options.provideTarget
22
24
  # Use the first defined candidate, but not `selector` since that
23
25
  # might be an undefined options.failTarget
@@ -8,7 +8,7 @@ class up.FollowVariant
8
8
  @selectors = selector.split(/\s*,\s*/)
9
9
 
10
10
  onClick: (event, $link) =>
11
- if @shouldProcessLinkEvent(event, $link)
11
+ if up.link.shouldProcessEvent(event, $link)
12
12
  if $link.is('[up-instant]')
13
13
  # If the link was already processed on mousedown, we still need
14
14
  # to prevent this later click event's chain.
@@ -21,7 +21,7 @@ class up.FollowVariant
21
21
  up.link.allowDefault(event)
22
22
 
23
23
  onMousedown: (event, $link) =>
24
- if @shouldProcessLinkEvent(event, $link)
24
+ if up.link.shouldProcessEvent(event, $link)
25
25
  up.bus.consumeAction(event)
26
26
  @followLink($link)
27
27
 
@@ -38,9 +38,6 @@ class up.FollowVariant
38
38
  up.on 'mousedown', @fullSelector('[up-instant]'), (args...) =>
39
39
  @onMousedown(args...)
40
40
 
41
- shouldProcessLinkEvent: (event, $link) =>
42
- u.isUnmodifiedMouseEvent(event) && !up.link.childClicked(event, $link)
43
-
44
41
  followLink: ($link, options = {}) =>
45
42
  up.feedback.start $link, options, =>
46
43
  @followNow($link, options)
@@ -404,7 +404,7 @@ up.dom = (($) ->
404
404
  cascade.bestPreflightSelector()
405
405
 
406
406
  bestMatchingSteps = (selector, response, options) ->
407
- options = u.merge(options, response: response)
407
+ options = u.merge(options, { response })
408
408
  cascade = new up.ExtractCascade(selector, options)
409
409
  cascade.bestMatchingSteps()
410
410
 
@@ -40,6 +40,13 @@ up.form = (($) ->
40
40
  reset = ->
41
41
  config.reset()
42
42
 
43
+ ###*
44
+ @function up.form.fieldSelector
45
+ @internal
46
+ ###
47
+ fieldSelector = ->
48
+ u.multiSelector(config.fields)
49
+
43
50
  ###*
44
51
  Submits a form via AJAX and updates a page fragment with the response.
45
52
 
@@ -251,7 +258,7 @@ up.form = (($) ->
251
258
  delay = u.option(u.presentAttr($element, 'up-delay'), options.delay, config.observeDelay)
252
259
  delay = parseInt(delay)
253
260
 
254
- $fields = u.multiSelector(config.fields).selectInSubtree($element)
261
+ $fields = fieldSelector().selectInSubtree($element)
255
262
 
256
263
  destructors = u.map $fields, (field) ->
257
264
  observeField($(field), delay, callback)
@@ -903,6 +910,7 @@ up.form = (($) ->
903
910
  validate: validate
904
911
  switchTargets: switchTargets
905
912
  autosubmit: autosubmit
913
+ fieldSelector: fieldSelector
906
914
 
907
915
  )(jQuery)
908
916
 
@@ -238,57 +238,59 @@ up.layout = (($) ->
238
238
  ###
239
239
  reveal = (elementOrSelector, options) ->
240
240
  $element = $(elementOrSelector)
241
- up.puts 'Revealing fragment %o', elementOrSelector.get(0)
241
+ up.puts 'Revealing fragment %o', $element.get(0)
242
242
  options = u.options(options)
243
- $viewport = if options.viewport then $(options.viewport) else viewportOf($element)
244
243
 
245
- snap = u.option(options.snap, config.snap)
244
+ u.rejectOnError ->
245
+ $viewport = if options.viewport then $(options.viewport) else viewportOf($element)
246
246
 
247
- viewportIsDocument = $viewport.is(document)
248
- viewportHeight = if viewportIsDocument then u.clientSize().height else $viewport.outerHeight()
249
- originalScrollPos = $viewport.scrollTop()
250
- newScrollPos = originalScrollPos
247
+ snap = u.option(options.snap, config.snap)
251
248
 
252
- offsetShift = undefined
253
- obstruction = undefined
249
+ viewportIsDocument = $viewport.is(document)
250
+ viewportHeight = if viewportIsDocument then u.clientSize().height else $viewport.outerHeight()
251
+ originalScrollPos = $viewport.scrollTop()
252
+ newScrollPos = originalScrollPos
254
253
 
255
- if viewportIsDocument
256
- obstruction = measureObstruction()
257
- # Within the body, $.position will always return the distance
258
- # from the document top and *not* the distance of the viewport
259
- # top. This is what the calculations below expect, so don't shift.
260
- offsetShift = 0
261
- else
262
- obstruction = { top: 0, bottom: 0 }
263
- # When the scrolled element is not <body> but instead a container
264
- # with overflow-y: scroll, $.position returns the distance to the
265
- # viewport's currently visible top edge (instead of the distance to
266
- # the first row of the viewport's entire canvas buffer).
267
- # http://codepen.io/anon/pen/jPojGE
268
- offsetShift = originalScrollPos
269
-
270
- predictFirstVisibleRow = -> newScrollPos + obstruction.top
271
- predictLastVisibleRow = -> newScrollPos + viewportHeight - obstruction.bottom - 1
272
-
273
- elementDims = u.measure($element, relative: $viewport, includeMargin: true)
274
- firstElementRow = elementDims.top + offsetShift
275
- lastElementRow = firstElementRow + Math.min(elementDims.height, config.substance) - 1
276
-
277
- if lastElementRow > predictLastVisibleRow()
278
- # Try to show the full height of the element
279
- newScrollPos += (lastElementRow - predictLastVisibleRow())
280
-
281
- if firstElementRow < predictFirstVisibleRow() || options.top
282
- # If the full element does not fit, scroll to the first row
283
- newScrollPos = firstElementRow - obstruction.top
284
-
285
- if newScrollPos < snap && elementDims.top < (0.5 * viewportHeight)
286
- newScrollPos = 0
287
-
288
- if newScrollPos != originalScrollPos
289
- scroll($viewport, newScrollPos, options)
290
- else
291
- Promise.resolve()
254
+ offsetShift = undefined
255
+ obstruction = undefined
256
+
257
+ if viewportIsDocument
258
+ obstruction = measureObstruction()
259
+ # Within the body, $.position will always return the distance
260
+ # from the document top and *not* the distance of the viewport
261
+ # top. This is what the calculations below expect, so don't shift.
262
+ offsetShift = 0
263
+ else
264
+ obstruction = { top: 0, bottom: 0 }
265
+ # When the scrolled element is not <body> but instead a container
266
+ # with overflow-y: scroll, $.position returns the distance to the
267
+ # viewport's currently visible top edge (instead of the distance to
268
+ # the first row of the viewport's entire canvas buffer).
269
+ # http://codepen.io/anon/pen/jPojGE
270
+ offsetShift = originalScrollPos
271
+
272
+ predictFirstVisibleRow = -> newScrollPos + obstruction.top
273
+ predictLastVisibleRow = -> newScrollPos + viewportHeight - obstruction.bottom - 1
274
+
275
+ elementDims = u.measure($element, relative: $viewport, includeMargin: true)
276
+ firstElementRow = elementDims.top + offsetShift
277
+ lastElementRow = firstElementRow + Math.min(elementDims.height, config.substance) - 1
278
+
279
+ if lastElementRow > predictLastVisibleRow()
280
+ # Try to show the full height of the element
281
+ newScrollPos += (lastElementRow - predictLastVisibleRow())
282
+
283
+ if firstElementRow < predictFirstVisibleRow() || options.top
284
+ # If the full element does not fit, scroll to the first row
285
+ newScrollPos = firstElementRow - obstruction.top
286
+
287
+ if newScrollPos < snap && elementDims.top < (0.5 * viewportHeight)
288
+ newScrollPos = 0
289
+
290
+ if newScrollPos != originalScrollPos
291
+ scroll($viewport, newScrollPos, options)
292
+ else
293
+ Promise.resolve()
292
294
 
293
295
  ###*
294
296
  [Reveals](/up.reveal) an element matching the `#hash` in the current URL.