unpoly-rails 0.53.1 → 0.53.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 +4 -4
- data/CHANGELOG.md +17 -1
- data/dist/unpoly.js +65 -19
- data/dist/unpoly.min.js +4 -4
- data/lib/assets/javascripts/unpoly/classes/follow_variant.coffee +2 -2
- data/lib/assets/javascripts/unpoly/dom.coffee +2 -0
- data/lib/assets/javascripts/unpoly/form.coffee +2 -2
- data/lib/assets/javascripts/unpoly/layout.coffee +2 -1
- data/lib/assets/javascripts/unpoly/modal.coffee +3 -0
- data/lib/assets/javascripts/unpoly/motion.coffee +10 -2
- data/lib/assets/javascripts/unpoly/proxy.coffee +17 -8
- data/lib/assets/javascripts/unpoly/util.coffee +23 -0
- data/lib/unpoly/rails/version.rb +1 -1
- data/package.json +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/app/controllers/form_test/basics_controller.rb +1 -1
- data/spec_app/app/views/reveal_test/long1.erb +6 -1
- data/spec_app/app/views/reveal_test/long2.erb +6 -1
- data/spec_app/spec/javascripts/helpers/to_have_unhandled_rejections.coffee +36 -0
- data/spec_app/spec/javascripts/helpers/trigger.js.coffee +30 -0
- data/spec_app/spec/javascripts/up/dom_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +78 -7
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +17 -0
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +98 -4
- data/spec_app/spec/javascripts/up/radio_spec.js.coffee +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb7c81f335e3b64eb62ab120e8995e7c7fabc09e8e54ee9358dac4e8df4ebe7e
|
4
|
+
data.tar.gz: 4ed93900676097e4811bdb0b47f2f03213ea3a8df6a6ff5740963927fe0b22d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ed1050858aa982f068e9ac060617d19857b67dbf4bb2d1b0f1459cb8746510efedef1031254a5c755e1645cd7a8e97c8f99389ab135013b5ea8622394a8683
|
7
|
+
data.tar.gz: 09729d9dbf530b8bee0f26680c620a127f0824b09b26dda2e6c866c9592a93918ce4d014c8c267d6335786610cac70e315badc752bb2c0f6ec7435e54508d564
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,22 @@ 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.53.2
|
10
|
+
------
|
11
|
+
|
12
|
+
### General
|
13
|
+
|
14
|
+
- Failed requests in event handlers of CSS selectors like `form[up-target]` no longer print `Uncaught (in promise) to the error console. You still need to catch and handle rejected promises in your own code when it calls Unpoly functions.
|
15
|
+
|
16
|
+
### Animated transitions
|
17
|
+
|
18
|
+
- Fix a bug where a page transition would flicker if [revealing](/up.reveal) was animated globally by setting `up.layout.config.duration`.
|
19
|
+
|
20
|
+
### Preloading
|
21
|
+
|
22
|
+
- Fix a bug where [preloading](/a-up-target) would not always be aborted when stopping to hover before [`up.proxy.config.preloadDelay`](/up.proxy.config#up.proxy.config.preloadDelay).
|
23
|
+
|
24
|
+
|
9
25
|
0.53.1
|
10
26
|
------
|
11
27
|
|
@@ -23,7 +39,7 @@ This project mostly adheres to [Semantic Versioning](http://semver.org/).
|
|
23
39
|
- Fix a bug where the animation `move-from-top` would finish instantly after animating with `move-to-top`.
|
24
40
|
- Fix a bug where the animation `move-from-right` would finish instantly after animating with `move-to-right`.
|
25
41
|
- Fix a bug where the animation `move-from-bottom` would finish instantly after animating with `move-to-bottom`.
|
26
|
-
- Fix a bug where the animation `move-from-left`
|
42
|
+
- Fix a bug where the animation `move-from-left` would finish instantly after animating with `move-to-left`.
|
27
43
|
|
28
44
|
|
29
45
|
0.53.0
|
data/dist/unpoly.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
(function() {
|
7
7
|
window.up = {
|
8
|
-
version: "0.53.
|
8
|
+
version: "0.53.2",
|
9
9
|
renamedModule: function(oldName, newName) {
|
10
10
|
return typeof Object.defineProperty === "function" ? Object.defineProperty(up, oldName, {
|
11
11
|
get: function() {
|
@@ -41,7 +41,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
41
41
|
@function up.util.noop
|
42
42
|
@experimental
|
43
43
|
*/
|
44
|
-
var $createElementFromSelector, $createPlaceholder, $submittingButton, DivertibleChain, ESCAPE_HTML_ENTITY_MAP, all, always, any, appendRequestData, assign, assignPolyfill, attributeSelector, castedAttr, clientSize, compact, config, contains, copy, copyAttributes, createElementFromHtml, cssAnimate, detachWith, detect, documentHasVerticalScrollbar, each, escapeHtml, escapePressed, evalOption, except, extractOptions, fail, fixedToAbsolute, flatten, forceCompositing, forceRepaint, horizontalScreenHalf, identity, intersect, isArray, isBlank, isBodyDescendant, isCrossDomain, isDefined, isDetached, isElement, isFixed, isFormData, isFunction, isGiven, isJQuery, isMissing, isNull, isNumber, isObject, isOptions, isPresent, isPromise, isStandardPort, isString, isTruthy, isUndefined, isUnmodifiedKeyEvent, isUnmodifiedMouseEvent, last, map, margins, measure, memoize, merge, mergeRequestData, methodAllowsPayload, microtask, multiSelector, newDeferred, nextFrame, nonUpClasses, noop, normalizeMethod, normalizeUrl, nullJQuery, offsetParent, once, only, opacity, openConfig, option, options, parseUrl, pluckData, pluckKey, presence, presentAttr, previewable, promiseTimer, reject, rejectOnError, remove, renameKey, requestDataAsArray, requestDataAsQuery, requestDataFromForm, scrollbarWidth, select, selectInDynasty, selectInSubtree, selectorForElement, sequence, setMissingAttrs, setTimer, submittedValue, temporaryCss, times, toArray, trim, unJQuery, uniq, unresolvablePromise, unwrapElement, whenReady;
|
44
|
+
var $createElementFromSelector, $createPlaceholder, $submittingButton, DivertibleChain, ESCAPE_HTML_ENTITY_MAP, all, always, any, appendRequestData, assign, assignPolyfill, attributeSelector, castedAttr, clientSize, compact, config, contains, copy, copyAttributes, createElementFromHtml, cssAnimate, detachWith, detect, documentHasVerticalScrollbar, each, escapeHtml, escapePressed, evalOption, except, extractOptions, fail, fixedToAbsolute, flatten, forceCompositing, forceRepaint, horizontalScreenHalf, identity, intersect, isArray, isBlank, isBodyDescendant, isCrossDomain, isDefined, isDetached, isElement, isFixed, isFormData, isFunction, isGiven, isJQuery, isMissing, isNull, isNumber, isObject, isOptions, isPresent, isPromise, isStandardPort, isString, isTruthy, isUndefined, isUnmodifiedKeyEvent, isUnmodifiedMouseEvent, last, map, margins, measure, memoize, merge, mergeRequestData, methodAllowsPayload, microtask, multiSelector, muteRejection, newDeferred, nextFrame, nonUpClasses, noop, normalizeMethod, normalizeUrl, nullJQuery, offsetParent, once, only, opacity, openConfig, option, options, parseUrl, pluckData, pluckKey, presence, presentAttr, previewable, promiseTimer, reject, rejectOnError, remove, renameKey, requestDataAsArray, requestDataAsQuery, requestDataFromForm, scrollbarWidth, select, selectInDynasty, selectInSubtree, selectorForElement, sequence, setMissingAttrs, setTimer, submittedValue, temporaryCss, times, toArray, trim, unJQuery, uniq, unresolvablePromise, unwrapElement, whenReady;
|
45
45
|
noop = $.noop;
|
46
46
|
|
47
47
|
/**
|
@@ -2072,6 +2072,29 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2072
2072
|
return promise.then(callback, callback);
|
2073
2073
|
};
|
2074
2074
|
|
2075
|
+
/**
|
2076
|
+
* Registers an empty rejection handler with the given promise.
|
2077
|
+
* This prevents browsers from printing "Uncaught (in promise)" to the error
|
2078
|
+
* console when the promise is rejection.
|
2079
|
+
*
|
2080
|
+
* This is helpful for event handlers where it is clear that no rejection
|
2081
|
+
* handler will be registered:
|
2082
|
+
*
|
2083
|
+
* up.on('submit', 'form[up-target]', (event, $form) => {
|
2084
|
+
* promise = up.submit($form)
|
2085
|
+
* up.util.muteRejection(promise)
|
2086
|
+
* })
|
2087
|
+
*
|
2088
|
+
* Does nothing if passed a missing value.
|
2089
|
+
*
|
2090
|
+
* @function up.util.muteRejection
|
2091
|
+
* @param {Promise|undefined|null} promise
|
2092
|
+
* @return {Promise}
|
2093
|
+
*/
|
2094
|
+
muteRejection = function(promise) {
|
2095
|
+
return promise != null ? promise["catch"](noop) : void 0;
|
2096
|
+
};
|
2097
|
+
|
2075
2098
|
/**
|
2076
2099
|
@function up.util.newDeferred
|
2077
2100
|
@internal
|
@@ -2100,7 +2123,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2100
2123
|
@internal
|
2101
2124
|
*/
|
2102
2125
|
rejectOnError = function(block) {
|
2103
|
-
var error
|
2126
|
+
var error;
|
2104
2127
|
try {
|
2105
2128
|
return block();
|
2106
2129
|
} catch (error1) {
|
@@ -2228,6 +2251,7 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2228
2251
|
isTruthy: isTruthy,
|
2229
2252
|
newDeferred: newDeferred,
|
2230
2253
|
always: always,
|
2254
|
+
muteRejection: muteRejection,
|
2231
2255
|
rejectOnError: rejectOnError,
|
2232
2256
|
isBodyDescendant: isBodyDescendant,
|
2233
2257
|
isCrossDomain: isCrossDomain,
|
@@ -2833,14 +2857,14 @@ that might save you from loading something like [Lodash](https://lodash.com/).
|
|
2833
2857
|
return function() {
|
2834
2858
|
var args;
|
2835
2859
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
2836
|
-
return _this.onClick.apply(_this, args);
|
2860
|
+
return u.muteRejection(_this.onClick.apply(_this, args));
|
2837
2861
|
};
|
2838
2862
|
})(this));
|
2839
2863
|
return up.on('mousedown', this.fullSelector('[up-instant]'), (function(_this) {
|
2840
2864
|
return function() {
|
2841
2865
|
var args;
|
2842
2866
|
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
|
2843
|
-
return _this.onMousedown.apply(_this, args);
|
2867
|
+
return u.muteRejection(_this.onMousedown.apply(_this, args));
|
2844
2868
|
};
|
2845
2869
|
})(this));
|
2846
2870
|
};
|
@@ -3818,7 +3842,6 @@ Internet Explorer 10 or lower
|
|
3818
3842
|
@internal
|
3819
3843
|
*/
|
3820
3844
|
sessionStorage = u.memoize(function() {
|
3821
|
-
var error;
|
3822
3845
|
try {
|
3823
3846
|
return window.sessionStorage;
|
3824
3847
|
} catch (error) {
|
@@ -6418,6 +6441,7 @@ Unpoly will automatically be aware of sticky Bootstrap components such as
|
|
6418
6441
|
*/
|
6419
6442
|
revealOrRestoreScroll = function(selectorOrElement, options) {
|
6420
6443
|
var $element, revealOptions, selector;
|
6444
|
+
options = u.options(options);
|
6421
6445
|
$element = $(selectorOrElement);
|
6422
6446
|
if (options.restoreScroll) {
|
6423
6447
|
return restoreScroll({
|
@@ -6425,7 +6449,9 @@ Unpoly will automatically be aware of sticky Bootstrap components such as
|
|
6425
6449
|
});
|
6426
6450
|
}
|
6427
6451
|
if (options.reveal) {
|
6428
|
-
revealOptions = {
|
6452
|
+
revealOptions = {
|
6453
|
+
duration: options.duration
|
6454
|
+
};
|
6429
6455
|
if (u.isString(options.reveal)) {
|
6430
6456
|
selector = revealSelector(options.reveal);
|
6431
6457
|
$element = up.first(selector) || $element;
|
@@ -6860,7 +6886,7 @@ is built from these functions. You can use them to extend Unpoly from your
|
|
6860
6886
|
@stable
|
6861
6887
|
*/
|
6862
6888
|
replace = function(selectorOrElement, url, options) {
|
6863
|
-
var e,
|
6889
|
+
var e, failureOptions, fullLoad, improvedFailTarget, improvedTarget, onFailure, onSuccess, promise, request, successOptions;
|
6864
6890
|
options = u.options(options);
|
6865
6891
|
options.inspectResponse = fullLoad = function() {
|
6866
6892
|
return up.browser.navigate(url, u.only(options, 'method', 'data'));
|
@@ -7966,7 +7992,7 @@ You can define custom animations using [`up.transition()`](/up.transition) and
|
|
7966
7992
|
@internal
|
7967
7993
|
*/
|
7968
7994
|
withGhosts = function($old, $new, options, transitionFn) {
|
7969
|
-
var $viewport, newCopy, newScrollTop, oldCopy, oldScrollTop;
|
7995
|
+
var $viewport, newCopy, newScrollTop, oldCopy, oldScrollTop, scrollOptions;
|
7970
7996
|
if (options.copy === false || $old.is('.up-ghost') || $new.is('.up-ghost')) {
|
7971
7997
|
return transitionFn($old, $new, options);
|
7972
7998
|
}
|
@@ -7982,7 +8008,10 @@ You can define custom animations using [`up.transition()`](/up.transition) and
|
|
7982
8008
|
return oldScrollTop = $viewport.scrollTop();
|
7983
8009
|
});
|
7984
8010
|
$old.hide();
|
7985
|
-
|
8011
|
+
scrollOptions = u.merge(options, {
|
8012
|
+
duration: 0
|
8013
|
+
});
|
8014
|
+
return up.layout.revealOrRestoreScroll($new, scrollOptions).then(function() {
|
7986
8015
|
var $bothGhosts, $bothOriginals, restoreNewOpacity, transitionDone;
|
7987
8016
|
newCopy = prependCopy($new, $viewport);
|
7988
8017
|
newScrollTop = $viewport.scrollTop();
|
@@ -8148,8 +8177,12 @@ You can define custom animations using [`up.transition()`](/up.transition) and
|
|
8148
8177
|
@internal
|
8149
8178
|
*/
|
8150
8179
|
skipMorph = function($old, $new, options) {
|
8180
|
+
var scrollOptions;
|
8151
8181
|
$old.hide();
|
8152
|
-
|
8182
|
+
scrollOptions = u.merge(options, {
|
8183
|
+
duration: 0
|
8184
|
+
});
|
8185
|
+
return up.layout.revealOrRestoreScroll($new, scrollOptions);
|
8153
8186
|
};
|
8154
8187
|
|
8155
8188
|
/**
|
@@ -8462,7 +8495,7 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
|
|
8462
8495
|
var slice = [].slice;
|
8463
8496
|
|
8464
8497
|
up.proxy = (function($) {
|
8465
|
-
var $waitingLink, ajax, alias, cache, cancelPreloadDelay, cancelSlowDelay,
|
8498
|
+
var $waitingLink, ajax, alias, cache, cancelPreloadDelay, cancelSlowDelay, clear, config, get, isBusy, isIdle, isSafeMethod, load, loadEnded, loadOrQueue, loadStarted, makeRequest, pendingCount, pokeQueue, preload, preloadAfterDelay, preloadDelayTimer, queue, queuedLoaders, registerAliasForRedirect, remove, reset, responseReceived, set, slowDelayTimer, slowEventEmitted, startPreloadDelay, stopPreload, u, wrapMethod;
|
8466
8499
|
u = up.util;
|
8467
8500
|
$waitingLink = void 0;
|
8468
8501
|
preloadDelayTimer = void 0;
|
@@ -9006,14 +9039,14 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
|
|
9006
9039
|
*/
|
9007
9040
|
clear = cache.clear;
|
9008
9041
|
up.bus.renamedEvent('up:proxy:received', 'up:proxy:loaded');
|
9009
|
-
|
9042
|
+
preloadAfterDelay = function($link) {
|
9010
9043
|
var curriedPreload, delay;
|
9011
9044
|
delay = parseInt(u.presentAttr($link, 'up-delay')) || config.preloadDelay;
|
9012
9045
|
if (!$link.is($waitingLink)) {
|
9013
9046
|
$waitingLink = $link;
|
9014
9047
|
cancelPreloadDelay();
|
9015
9048
|
curriedPreload = function() {
|
9016
|
-
preload($link);
|
9049
|
+
u.muteRejection(preload($link));
|
9017
9050
|
return $waitingLink = null;
|
9018
9051
|
};
|
9019
9052
|
return startPreloadDelay(curriedPreload, delay);
|
@@ -9022,6 +9055,12 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
|
|
9022
9055
|
startPreloadDelay = function(block, delay) {
|
9023
9056
|
return preloadDelayTimer = setTimeout(block, delay);
|
9024
9057
|
};
|
9058
|
+
stopPreload = function($link) {
|
9059
|
+
if ($link.is($waitingLink)) {
|
9060
|
+
$waitingLink = void 0;
|
9061
|
+
return cancelPreloadDelay();
|
9062
|
+
}
|
9063
|
+
};
|
9025
9064
|
|
9026
9065
|
/**
|
9027
9066
|
Preloads the given link.
|
@@ -9083,9 +9122,16 @@ Other Unpoly modules contain even more tricks to outsmart network latency:
|
|
9083
9122
|
but will also make the interaction feel less instant.
|
9084
9123
|
@stable
|
9085
9124
|
*/
|
9086
|
-
up.
|
9087
|
-
if (up.link.
|
9088
|
-
|
9125
|
+
up.compiler('a[up-preload], [up-href][up-preload]', function($link) {
|
9126
|
+
if (up.link.isSafe($link)) {
|
9127
|
+
$link.on('mouseenter touchstart', function(event) {
|
9128
|
+
if (up.link.shouldProcessEvent(event, $link)) {
|
9129
|
+
return preloadAfterDelay($link);
|
9130
|
+
}
|
9131
|
+
});
|
9132
|
+
return $link.on('mouseleave', function() {
|
9133
|
+
return stopPreload($link);
|
9134
|
+
});
|
9089
9135
|
}
|
9090
9136
|
});
|
9091
9137
|
up.on('up:framework:reset', reset);
|
@@ -10366,7 +10412,7 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
10366
10412
|
*/
|
10367
10413
|
up.on('submit', 'form[up-target]', function(event, $form) {
|
10368
10414
|
up.bus.consumeAction(event);
|
10369
|
-
return submit($form);
|
10415
|
+
return u.muteRejection(submit($form));
|
10370
10416
|
});
|
10371
10417
|
|
10372
10418
|
/**
|
@@ -10515,7 +10561,7 @@ open dialogs with sub-forms, etc. all without losing form state.
|
|
10515
10561
|
@stable
|
10516
10562
|
*/
|
10517
10563
|
up.on('change', '[up-validate]', function(event, $field) {
|
10518
|
-
return validate($field);
|
10564
|
+
return u.muteRejection(validate($field));
|
10519
10565
|
});
|
10520
10566
|
|
10521
10567
|
/**
|
data/dist/unpoly.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(){window.up={version:"0.53.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,x,P,$,F,D,C,O,R,U,N,M,L,H,K,q,j,_,V,z,I,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,xt,Pt,$t,Ft,Dt,Ct,Ot,Rt,Ut,Nt,Mt,Lt,Ht,Kt,qt,jt,_t,Vt,zt,It,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de;return xt=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},$t=function(t,e){var n,r,o;return r=Lt(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},I=function(t){var e;return e=Lt(location.href),t=Lt(t),e.protocol!==t.protocol||e.host!==t.host},Lt=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"},wt=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},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,p,f;if(e=r(t),c=void 0,p=e.prop("tagName").toLowerCase(),f=qt(e.attr("up-id")))c=m("up-id",f);else if(u=qt(e.attr("id")))c=u.match(/^[a-z0-9\-_]+$/i)?"#"+u:m("id",u);else if(l=qt(e.attr("name")))c=p+m("name",l);else if(o=qt(At(e)))for(c="",i=0,a=o.length;a>i;i++)s=o[i],c+="."+s;else c=(n=qt(e.attr("aria-label")))?m("aria-label",n):p;return c},m=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},At=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Zt(n,function(t){return it(t)&&!t.match(/^up-/)})},T=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},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)||_(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)},k=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)))},Mt=function(t,e){var n,r,o,i;if(o=t?k(t):{},e)for(r in e)n=e[r],i=o[r],Z(i)?rt(n)&&rt(i)&&(o[r]=Mt(i,n)):o[r]=n;return o},Nt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],x(e,Z)},x=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},y=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},zt=function(t,e){return Zt(t,function(t){return!e(t)})},j=function(t,e){return Zt(t,function(t){return w(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;o>t;t++)n=r[t],i.push(e.attr(n));return i}(),x(o,it)},oe=function(t,e){return setTimeout(e,t)},Et=function(t){return setTimeout(t,0)},kt=function(t){return Promise.resolve().then(t)},ht=function(t){return t[t.length-1]},g=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}),P=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)},L=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=Mt(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},S=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)},D=function(t){return 27===t.keyCode},w=function(t,e){return t.indexOf(e)>=0},v=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Ot=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=k(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(xt)},Ft=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},St=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=Ft(),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||Ft()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},b=function(t){var e;return e=Ut(t),Object.preventExtensions(e),e},Ut=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)},Dt=function(t){var e,n;for(e=void 0;(t=t.parent())&&t.length;)if(n=t.css("position"),"absolute"===n||"relative"===n||t.is("body")){e=t;break}return e},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=Dt(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;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=Mt(e,{purpose:"url"}),at(t))return t.replace(/^\?/,"");if(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},bt=function(t,e){return $(Bt(e),function(e){return t=f(t,e.name,e.value)}),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={"&":"&","<":"<",">":">",'"':"""},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():{}},Rt=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=Tt(),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,_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,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=g(),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},M=function(t){var e,n,r,o;for(e=[],n=0,r=t.length;r>n;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)},Tt=function(){var t,e;return e=void 0,zt=void 0,t=new Promise(function(t,n){return e=t,zt=n}),t.resolve=e,t.reject=zt,t.promise=function(){return t},t},It=function(t){var e,n;try{return t()}catch(n){return e=n,Promise.reject(e)}},z=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Bt,requestDataAsQuery:Jt,appendRequestData:f,mergeRequestData:bt,requestDataFromForm:Xt,offsetParent:Dt,fixedToAbsolute:N,isFixed:J,presentAttr:jt,parseUrl:Lt,normalizeUrl:$t,normalizeMethod:Pt,methodAllowsPayload:wt,createElementFromHtml:T,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:ee,assign:h,assignPolyfill:d,copy:k,merge:yt,options:Mt,option:Nt,fail:U,each:$,map:dt,times:se,any:p,all:l,detect:x,select:Zt,reject:zt,intersect:j,compact:y,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:Ft,unJQuery:ce,setTimer:oe,nextFrame:Et,measure:vt,temporaryCss:ue,cssAnimate:E,forceCompositing:L,forceRepaint:H,escapePressed:D,copyAttributes:S,selectInSubtree:te,selectInDynasty:Yt,contains:w,toArray:ae,castedAttr:v,clientSize:g,only:Ot,except:O,trim:le,unresolvablePromise:fe,setMissingAttrs:re,remove:Wt,memoize:gt,scrollbarWidth:Gt,documentHasVerticalScrollbar:P,config:b,openConfig:Ut,unwrapElement:he,multiSelector:St,error:U,pluckData:Ht,pluckKey:Kt,renameKey:Qt,extractOptions:R,isDetached:Q,noop:xt,opacity:Rt,whenReady:de,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:ie,sequence:ne,promiseTimer:Vt,previewable:_t,evalOption:C,horizontalScreenHalf:K,detachWith:A,flatten:M,isTruthy:lt,newDeferred:Tt,always:c,rejectOnError:It,isBodyDescendant:z,isCrossDomain:I,microtask:kt}}(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.hungrySteps=e(this.hungrySteps,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return 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.concat(this.hungrySteps()):this.matchingPlanNotFound()},n.prototype.hungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(a=[],this.options.hungry)for(e=up.radio.hungrySelector().select(),i=0,u=e.length;u>i;i++)o=e[i],n=$(o),s=t.selectorForElement(n),(r=this.options.response.first(s))&&(l=t.option(up.radio.config.hungryTransition,this.options.transition),a.push({$old:n,$new:r,transition:l}));return a},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,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;return e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(t){return function(e,n){var r,o,i;return r=e.match(/^(.+?)(?:\:(before|after))?$/),r||up.fail('Could not parse selector literal "%s"',e),i=r[1],"html"===i&&(i="body"),o=r[2],{selector:i,pseudoClass:o,transition:t.transition}}}(this))},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 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){return up.link.shouldProcessEvent(t,e)?(up.bus.consumeAction(t),this.followLink(e)):void 0},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.bus.whenEmitted("up:link:follow",{$element:t}).then(function(n){return function(){return up.feedback.start(t,e,function(){return n.followNow(t,e)})}}(this))},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.transferSearchToData=e(this.transferSearchToData,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToData():this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;return this.data&&!t.isFormData(this.data)?(e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0):void 0},o.prototype.transferSearchToData=function(){var e,n;return n=t.parseUrl(this.url),e=n.search,e?(this.data=t.mergeRequestData(this.data,e),this.url=t.normalizeUrl(n,{search:!1})):void 0},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,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 this.transferSearchToData(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){return this.isSafe()||this.isCrossDomain()?void 0:up.protocol.csrfToken()},o.prototype.isCrossDomain=function(){return t.isCrossDomain(this.url)},o.prototype.buildResponse=function(t){var e,n,r;return n={method:this.method,url:this.url,text:t.responseText,status:t.status,request:this,xhr:t},(r=up.protocol.locationFromXhr(t))&&(n.url=r,n.method=null!=(e=up.protocol.methodFromXhr(t))?e:"GET"),n.title=up.protocol.titleFromXhr(t),new up.Response(n)},o.prototype.isCachable=function(){return this.isSafe()&&!t.isFormData(this.data)},o.prototype.cacheKey=function(){return[this.url,this.method,t.requestDataAsQuery(this.data),this.target].join("|")},o.wrap=function(t){return t instanceof this?t:new this(t)},o}(up.Record)}.call(this),function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,
|
2
|
-
t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){var 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(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;return(n=t.getResponseHeader(e.methodHeader))?l.normalizeMethod(n):void 0},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(e){var n,r,o,i,u,s,a,l,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):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),d(p,o,r,n)):void 0},v=function(){var e,n,r,o;return o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported()?(n=e.pop(),r=S.options(e[0]),m&&(r.priority=h(o)||up.fail("Unregistered priority for system macro %o",o)),d(g,o,r,n)):void 0},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),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){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;return n=$(t).first(),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),h>s&&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;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),n.length)?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,detectScriptFixes,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,shouldSwapElementsDirectly,source,swapElements,swapElementsDirectly,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:null}),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,restoreScroll:!1,hungry:!1}),u.renameKey(i,"failTransition","transition"),u.renameKey(i,"failLayer","layer"),u.renameKey(i,"failReveal","reveal");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 fixScripts(l.$new),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()},fixScripts=function(t){var e,n,r,o,i;for(n=[],detectScriptFixes(t.get(0),n),i=[],r=0,o=n.length;o>r;r++)e=n[r],i.push(e());return i},detectScriptFixes=function(t,e){var n,r,o,i,u,s;if("NOSCRIPT"===t.tagName)return r=document.createElement("noscript"),r.textContent=t.innerHTML,e.push(function(){return t.parentNode.replaceChild(r,t)});if("SCRIPT"===t.tagName)return e.push(function(){return t.parentNode.removeChild(t)});for(u=t.children,s=[],o=0,i=u.length;i>o;o++)n=u[o],s.push(detectScriptFixes(n,e));return s},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 shouldSwapElementsDirectly(t,e,r,o)?(swapElementsDirectly(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},shouldSwapElementsDirectly=function(t,e,n,r){var o;return o=t.add(e),t.is("body")||!up.motion.willAnimate(o,n,r)},swapElementsDirectly=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,x,P,$;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.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 P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.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);
|
3
|
-
})},P=function(t,e,n){return n=r(n),f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.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=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;return e=t.originalEvent.propertyName,x.contains(c,e)?i():void 0},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.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?(x.forceRepaint(t),t.css(u)):void 0}),f=x.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=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.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),x.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=x.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=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(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(x.isFunction(t))return t;if(x.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(x.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=x.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],x.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=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.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 t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.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 t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.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 t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.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 t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.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=x.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,willAnimate:P,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,x,P,$,F,D,C,O,R,U,N;return U=up.util,n=void 0,T=void 0,C=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;o>r;r++)if(e=n[r],a=i.get(e))return a},u=function(){return clearTimeout(T),T=null},s=function(){return clearTimeout(C),C=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),D(i,o),o["catch"](function(t){return P(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;return w+=1,C?void 0:(t=function(){return f()?(up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0):void 0},C=U.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=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")))},x=function(t){var e,n;return n=t.request,t.url&&n.url!==t.url?(e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)):void 0},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},k=function(){var t;return void("function"==typeof(t=A.shift())&&t())},o=i.alias,D=i.set,P=i.remove,l=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),a=function(t){var e,r;return r=parseInt(U.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 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){return up.link.shouldProcessEvent(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:P,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.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-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","")},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;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,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;return n=$(t).closest("form"),e=u.options(e),r=u.option(e.target,n.attr("up-target"),"body"),o=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.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),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.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.bus.whenEmitted("up:form:submit",{$element:n}).then(function(){var t;return up.feedback.start(n),up.browser.canPushState()||e.history===!1?(t=up.replace(r,o,e),u.always(t,function(){return up.feedback.stop(n)}),t):(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):!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"
|
4
|
-
})}),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},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(
|
1
|
+
(function(){window.up={version:"0.53.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,T,E,A,x,P,$,F,D,C,O,R,U,N,M,L,H,K,q,j,_,V,z,I,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,xt,Pt,$t,Ft,Dt,Ct,Ot,Rt,Ut,Nt,Mt,Lt,Ht,Kt,qt,jt,_t,Vt,zt,It,Wt,Qt,Bt,Jt,Xt,Gt,Zt,Yt,te,ee,ne,re,oe,ie,ue,se,ae,le,ce,pe,fe,he,de,me;return Pt=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},Ft=function(t,e){var n,r,o;return r=Ht(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},I=function(t){var e;return e=Ht(location.href),t=Ht(t),e.protocol!==t.protocol||e.host!==t.host},Ht=function(t){var e;return t=pe(t),t.pathname?t:(e=r("<a>").attr({href:t}).get(0),V(e.hostname)&&(e.href=e.href),e)},$t=function(t){return t?t.toUpperCase():"GET"},wt=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},i=function(t,e){var n;return null==e&&(e=document.body),n=o(t),n.addClass("up-placeholder"),n.appendTo(e),n},ne=function(t){var e,n,o,i,u,s,a,l,c,p,f;if(e=r(t),c=void 0,p=e.prop("tagName").toLowerCase(),f=jt(e.attr("up-id")))c=m("up-id",f);else if(u=jt(e.attr("id")))c=u.match(/^[a-z0-9\-_]+$/i)?"#"+u:m("id",u);else if(l=jt(e.attr("name")))c=p+m("name",l);else if(o=jt(xt(e)))for(c="",i=0,a=o.length;i<a;i++)s=o[i],c+="."+s;else c=(n=jt(e.attr("aria-label")))?m("aria-label",n):p;return c},m=function(t,e){return e=e.replace(/"/g,'\\"'),"["+t+'="'+e+'"]'},xt=function(t){var e,n;return e=t.attr("class")||"",n=e.split(" "),Yt(n,function(t){return it(t)&&!t.match(/^up-/)})},T=function(t){var e;return e=new DOMParser,e.parseFromString(t,"text/html")},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,ce=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=$,ae=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},jt=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},le=function(t){return Array.prototype.slice.call(t)},k=function(t){return _(t)?t=t.slice():rt(t)&&!G(t)?t=h({},t):up.fail("Cannot copy %o",t),t},pe=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?k(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},Mt=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],x(e,Z)},x=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},y=function(t){return Yt(t,Z)},fe=function(t){var e;return e={},Yt(t,function(t){return!e.hasOwnProperty(t)&&(e[t]=!0)})},Yt=function(t,e){var n;return n=[],$(t,function(t){if(e(t))return n.push(t)}),n},It=function(t,e){return Yt(t,function(t){return!e(t)})},j=function(t,e){return Yt(t,function(t){return w(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;t<o;t++)n=r[t],i.push(e.attr(n));return i}(),x(o,it)},ie=function(t,e){return setTimeout(e,t)},At=function(t){return setTimeout(t,0)},kt=function(t){return Promise.resolve().then(t)},ht=function(t){return t[t.length-1]},g=function(){var t;return t=document.documentElement,{width:t.clientWidth,height:t.clientHeight}},Zt=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}),P=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},Ot=function(e){var n;return n=void 0,function(){var r;return r=1<=arguments.length?t.call(arguments,0):[],null!=e&&(n=e.apply(null,r)),e=void 0,n}},se=function(t,e,n){var 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()):Ot(i)},L=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=pe(t),t.offsetHeight},E=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},S=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},ee=function(t,e){return t.find(e).addBack(e)},te=function(t,e){var n,r;return r=ee(t,e),n=t.parents(e),r.add(n)},D=function(t){return 27===t.keyCode},w=function(t,e){return t.indexOf(e)>=0},v=function(t,e){var n;switch(n=t.attr(e)){case"false":return!1;case"true":case"":case e:return!0;default:return n}},Rt=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=k(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)},he=function(){return new Promise(Pt)},Dt=function(){return r()},oe=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},Qt=function(t,e){var n;if(n=t.indexOf(e),n>=0)return t.splice(n,1),e},St=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=Dt(),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||Dt()},u},C=function(){var e,n;return n=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],G(n)?n.apply(null,e):n},b=function(t){var e;return e=Nt(t),Object.preventExtensions(e),e},Nt=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},de=function(t){var e,n;return t=pe(t),e=t.parentNode,n=le(t.childNodes),$(n,function(n){return e.insertBefore(n,t)}),e.removeChild(t)},Ct=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=Ct(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:""})},Jt=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=Xt(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},Xt=function(t,e){var n;if(e=Lt(e,{purpose:"url"}),at(t))return t.replace(/^\?/,"");if(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()},Gt=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=Xt([{name:e,value:n}],r),t=[t,o].join("&")),t},bt=function(t,e){return $(Jt(e),function(e){return t=f(t,e.name,e.value)}),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),me().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&","<":"<",">":">",'"':"""},F=function(t){return t.replace(/[&<>"]/g,function(t){return a[t]})},qt=function(t,e){var n;return n=t[e],delete t[e],n},Bt=function(t,e,n){return t[n]=qt(t,e)},Kt=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():{}},Ut=function(t){var e;return e=r(t).css("opacity"),Z(e)?parseFloat(e):void 0},me=gt(function(){return r.isReady?Promise.resolve():new Promise(function(t){return r(t)})}),q=function(t){return t},Q=function(t){return t=pe(t),!jQuery.contains(document.documentElement,t)},Vt=function(e){var n,r;return n=Et(),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,Vt),this.poke(),this.promise()},e}(),ue=function(t){var e;return e=r(t),e.is("[type=checkbox], [type=radio]")&&!e.is(":checked")?void 0:e.val()},re=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],function(){return dt(e,function(t){return t()})}},zt=function(t){var e,n;return n=void 0,e=new Promise(function(e){return n=ie(t,e)}),e.cancel=function(){return clearTimeout(n)},e},K=function(t){var e,n,r,o;return e=vt(t),r=g(),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},M=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)},Tt=function(t){return null!=t?t["catch"](Pt):void 0},Et=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},Wt=function(t){var e;try{return t()}catch(t){return e=t,Promise.reject(e)}},z=function(t){return r(t).parents("body").length>0},{requestDataAsArray:Jt,requestDataAsQuery:Xt,appendRequestData:f,mergeRequestData:bt,requestDataFromForm:Gt,offsetParent:Ct,fixedToAbsolute:N,isFixed:J,presentAttr:_t,parseUrl:Ht,normalizeUrl:Ft,normalizeMethod:$t,methodAllowsPayload:wt,createElementFromHtml:T,$createElementFromSelector:o,$createPlaceholder:i,selectorForElement:ne,assign:h,assignPolyfill:d,copy:k,merge:yt,options:Lt,option:Mt,fail:U,each:$,map:dt,times:ae,any:p,all:l,detect:x,select:Yt,reject:It,intersect:j,compact:y,uniq:fe,last:ht,isNull:et,isDefined:W,isUndefined:ct,isGiven:Z,isMissing:tt,isPresent:it,isBlank:V,presence:jt,isObject:rt,isFunction:G,isString:at,isNumber:nt,isElement:B,isJQuery:Y,isPromise:ut,isOptions:ot,isArray:_,isFormData:X,isUnmodifiedKeyEvent:pt,isUnmodifiedMouseEvent:ft,nullJQuery:Dt,unJQuery:pe,setTimer:ie,nextFrame:At,measure:vt,temporaryCss:se,cssAnimate:E,forceCompositing:L,forceRepaint:H,escapePressed:D,copyAttributes:S,selectInSubtree:ee,selectInDynasty:te,contains:w,toArray:le,castedAttr:v,clientSize:g,only:Rt,except:O,trim:ce,unresolvablePromise:he,setMissingAttrs:oe,remove:Qt,memoize:gt,scrollbarWidth:Zt,documentHasVerticalScrollbar:P,config:b,openConfig:Nt,unwrapElement:de,multiSelector:St,error:U,pluckData:Kt,pluckKey:qt,renameKey:Bt,extractOptions:R,isDetached:Q,noop:Pt,opacity:Ut,whenReady:me,identity:q,escapeHtml:F,DivertibleChain:s,submittedValue:ue,sequence:re,promiseTimer:zt,previewable:Vt,evalOption:C,horizontalScreenHalf:K,detachWith:A,flatten:M,isTruthy:lt,newDeferred:Et,always:c,muteRejection:Tt,rejectOnError:Wt,isBodyDescendant:z,isCrossDomain:I,microtask:kt}}(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.hungrySteps=e(this.hungrySteps,this),this.bestMatchingSteps=e(this.bestMatchingSteps,this),this.bestPreflightSelector=e(this.bestPreflightSelector,this),this.detectPlan=e(this.detectPlan,this),this.matchingPlan=e(this.matchingPlan,this),this.newPlan=e(this.newPlan,this),this.oldPlan=e(this.oldPlan,this),this.options=t.options(r,{humanizedTarget:"selector",layer:"auto"}),this.options.transition=t.option(this.options.transition,this.options.animation),this.options.hungry=t.option(this.options.hungry,!0),this.candidates=this.buildCandidates(n),this.plans=t.map(this.candidates,function(e){return function(n,r){var o;return o=t.copy(e.options),r>0&&(o.transition=t.option(up.dom.config.fallbackTransition,e.options.transition)),new up.ExtractPlan(n,o)}}(this))}return n.prototype.buildCandidates=function(e){var n;return n=[e,this.options.fallback,up.dom.config.fallbacks],n=t.flatten(n),n=t.select(n,t.isTruthy),n=t.uniq(n),(this.options.fallback===!1||this.options.provideTarget)&&(n=[n[0]]),n},n.prototype.oldPlan=function(){return this.detectPlan("oldExists")},n.prototype.newPlan=function(){return this.detectPlan("newExists")},n.prototype.matchingPlan=function(){return this.detectPlan("matchExists")},n.prototype.detectPlan=function(e){return t.detect(this.plans,function(t){return t[e]()})},n.prototype.bestPreflightSelector=function(){var t;return 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.concat(this.hungrySteps()):this.matchingPlanNotFound()},n.prototype.hungrySteps=function(){var e,n,r,o,i,u,s,a,l;if(a=[],this.options.hungry)for(e=up.radio.hungrySelector().select(),i=0,u=e.length;i<u;i++)o=e[i],n=$(o),s=t.selectorForElement(n),(r=this.options.response.first(s))&&(l=t.option(up.radio.config.hungryTransition,this.options.transition),a.push({$old:n,$new:r,transition:l}));return a},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,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;return e=/\ *,\ */,n=this.selector.split(e),t.map(n,function(t){return function(e){var n,r,o;return n=e.match(/^(.+?)(?:\:(before|after))?$/),n||up.fail('Could not parse selector literal "%s"',e),o=n[1],"html"===o&&(o="body"),r=n[2],{selector:o,pseudoClass:r,transition:t.transition}}}(this))},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 r(t,n){this.matchesLink=e(this.matchesLink,this),this.preloadLink=e(this.preloadLink,this),this.followLink=e(this.followLink,this),this.fullSelector=e(this.fullSelector,this),this.onMousedown=e(this.onMousedown,this),this.onClick=e(this.onClick,this),this.followNow=n.follow,this.preloadNow=n.preload,this.selectors=t.split(/\s*,\s*/)}return r.prototype.onClick=function(t,e){return up.link.shouldProcessEvent(t,e)?e.is("[up-instant]")?up.bus.haltEvent(t):(up.bus.consumeAction(t),this.followLink(e)):up.link.allowDefault(t)},r.prototype.onMousedown=function(t,e){if(up.link.shouldProcessEvent(t,e))return up.bus.consumeAction(t),this.followLink(e)},r.prototype.fullSelector=function(t){var e;return null==t&&(t=""),e=[],this.selectors.forEach(function(n){return["a","[up-href]"].forEach(function(r){return e.push(""+r+n+t)})}),e.join(", ")},r.prototype.registerEvents=function(){return up.on("click",this.fullSelector(),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onClick.apply(e,r))}}(this)),up.on("mousedown",this.fullSelector("[up-instant]"),function(e){return function(){var r;return r=1<=arguments.length?n.call(arguments,0):[],t.muteRejection(e.onMousedown.apply(e,r))}}(this))},r.prototype.followLink=function(t,e){return null==e&&(e={}),up.bus.whenEmitted("up:link:follow",{$element:t}).then(function(n){return function(){return up.feedback.start(t,e,function(){return n.followNow(t,e)})}}(this))},r.prototype.preloadLink=function(t,e){return null==e&&(e={}),this.preloadNow(t,e)},r.prototype.matchesLink=function(t){return t.is(this.fullSelector())},r}()}.call(this),function(){var t,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.transferSearchToData=e(this.transferSearchToData,this),this.transferDataToUrl=e(this.transferDataToUrl,this),this.extractHashFromUrl=e(this.extractHashFromUrl,this),this.normalize=e(this.normalize,this),o.__super__.constructor.call(this,t),this.normalize()}return n(o,r),o.prototype.fields=function(){return["method","url","data","target","failTarget","headers","timeout"]},o.prototype.normalize=function(){return this.method=t.normalizeMethod(this.method),this.headers||(this.headers={}),this.extractHashFromUrl(),t.methodAllowsPayload(this.method)?this.transferSearchToData():this.transferDataToUrl()},o.prototype.extractHashFromUrl=function(){var e;return e=t.parseUrl(this.url),this.hash=e.hash,this.url=t.normalizeUrl(e,{hash:!1})},o.prototype.transferDataToUrl=function(){var e,n;if(this.data&&!t.isFormData(this.data))return e=t.requestDataAsQuery(this.data),n=t.contains(this.url,"?")?"&":"?",this.url+=n+e,this.data=void 0},o.prototype.transferSearchToData=function(){var e,n;if(n=t.parseUrl(this.url),e=n.search)return this.data=t.mergeRequestData(this.data,e),this.url=t.normalizeUrl(n,{search:!1})},o.prototype.isSafe=function(){return up.proxy.isSafeMethod(this.method)},o.prototype.send=function(){return new Promise(function(e){return function(n,r){var o,i,u,s,a,l,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 this.transferSearchToData(),e=$('<form class="up-page-loader"></form>'),n=function(t){return $('<input type="hidden">').attr(t).appendTo(e)},"GET"===this.method?i="GET":(n({name:up.protocol.config.methodParam,value:this.method}),i="POST"),e.attr({method:i,action:this.url}),(r=up.protocol.csrfParam())&&(o=this.csrfToken())&&n({name:r,value:o}),t.each(t.requestDataAsArray(this.data),n),e.hide().appendTo("body"),up.browser.submitForm(e)},o.prototype.csrfToken=function(){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,
|
2
|
+
t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t=up.util,up.Response=function(r){function o(t){this.isFatalError=e(this.isFatalError,this),this.isError=e(this.isError,this),this.isSuccess=e(this.isSuccess,this),o.__super__.constructor.call(this,t)}return n(o,r),o.prototype.fields=function(){return["method","url","text","status","request","xhr","title"]},o.prototype.isSuccess=function(){return this.status&&this.status>=200&&this.status<=299},o.prototype.isError=function(){return!this.isSuccess()},o.prototype.isFatalError=function(){return this.isError()&&t.isBlank(this.text)},o}(up.Record)}.call(this),function(){var 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(){up.protocol=function(t){var e,n,r,o,i,u,s,a,l;return l=up.util,i=function(t){return t.getResponseHeader(e.locationHeader)||t.responseURL},a=function(t){return t.getResponseHeader(e.titleHeader)},u=function(t){var n;if(n=t.getResponseHeader(e.methodHeader))return l.normalizeMethod(n)},o=l.memoize(function(){var t;return t=up.browser.popCookie(e.methodCookie),(t||"get").toLowerCase()}),up.bus.on("up:framework:booted",o),e=l.config({targetHeader:"X-Up-Target",failTargetHeader:"X-Up-Fail-Target",locationHeader:"X-Up-Location",validateHeader:"X-Up-Validate",titleHeader:"X-Up-Title",methodHeader:"X-Up-Method",methodCookie:"_up_method",methodParam:"_method",csrfParam:function(){return t('meta[name="csrf-param"]').attr("content")},csrfToken:function(){return t('meta[name="csrf-token"]').attr("content")},csrfHeader:"X-CSRF-Token"}),n=function(){return l.evalOption(e.csrfParam)},r=function(){return l.evalOption(e.csrfToken)},s=function(){return e.reset()},{config:e,reset:s,locationFromXhr:i,titleFromXhr:a,methodFromXhr:u,csrfParam:n,csrfToken:r,initialRequestMethod:o}}(jQuery)}.call(this),function(){var t=[].slice;up.log=function(){var e,n,r,o,i,u,s,a,l,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;if(o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported())return n=e.pop(),r=S.options(e[0]),d(p,o,r,n)},v=function(){var e,n,r,o;if(o=arguments[0],e=2<=arguments.length?t.call(arguments,1):[],up.browser.isSupported())return 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).first(),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 e=u.options(e),n=$(t),e.restoreScroll?restoreScroll({around:n}):e.reveal&&(r={duration:e.duration},u.isString(e.reveal)&&(o=revealSelector(e.reveal),n=up.first(o)||n,r.top=!0),n.length)?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,detectScriptFixes,emitFragmentInserted,emitFragmentKept,extract,findKeepPlan,first,firstInLayer,firstInPriority,fixScripts,hello,isRealElement,layerOf,matchesLayer,parseResponseDoc,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,shouldLogDestruction,shouldSwapElementsDirectly,source,swapElements,swapElementsDirectly,transferKeepableElements,u,updateHistoryAndTitle;return u=up.util,config=u.config({fallbacks:["body"],fallbackTransition:null}),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,restoreScroll:!1,hungry:!1}),u.renameKey(o,"failTransition","transition"),u.renameKey(o,"failLayer","layer"),u.renameKey(o,"failReveal","reveal");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 fixScripts(l.$new),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()},fixScripts=function(t){var e,n,r,o,i;for(n=[],detectScriptFixes(t.get(0),n),i=[],r=0,o=n.length;r<o;r++)e=n[r],i.push(e());return i},detectScriptFixes=function(t,e){var n,r,o,i,u,s;if("NOSCRIPT"===t.tagName)return r=document.createElement("noscript"),r.textContent=t.innerHTML,e.push(function(){return t.parentNode.replaceChild(r,t)});if("SCRIPT"===t.tagName)return e.push(function(){return t.parentNode.removeChild(t)});for(u=t.children,s=[],o=0,i=u.length;o<i;o++)n=u[o],s.push(detectScriptFixes(n,e));return s},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 shouldSwapElementsDirectly(t,e,r,o)?(swapElementsDirectly(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},shouldSwapElementsDirectly=function(t,e,n,r){var o;return o=t.add(e),t.is("body")||!up.motion.willAnimate(o,n,r)},swapElementsDirectly=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,T,E,A,x,P,$;return x=up.util,v={},u={},g={},s={},m=new up.MotionTracker("motion"),i=x.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return c(),v=x.copy(u),g=x.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 P(s,i,u)?x.isFunction(i)?i(s,u):x.isString(i)?n(s,a(i),u):x.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);
|
3
|
+
})},P=function(t,e,n){return n=r(n),f()&&!h(e)&&n.duration>0&&x.all(t,x.isBodyDescendant)},S=function(t,e){return x.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=x.newDeferred(),i=function(){return o.resolve()},a=function(t){var e;if(e=t.originalEvent.propertyName,x.contains(c,e))return i()},s=i,t.on(m.finishEvent,s),t.on("transitionend",a),p=5,r=x.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 x.forceRepaint(t),t.css(u)}),f=x.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=x.isJQuery(n[0])?n.shift():x.nullJQuery(),o=x.isObject(n[0])?n.shift():{},r={},r.easing=x.option(u.easing,x.presentAttr(e,"up-easing"),o.easing,i.easing),r.duration=Number(x.option(u.duration,x.presentAttr(e,"up-duration"),o.duration,i.duration)),r.delay=Number(x.option(u.delay,x.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,l;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),x.temporaryCss(e,{display:"none"},function(){return s=y(t,o),a=o.scrollTop()}),t.hide(),l=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,l).then(function(){var l,c,p,f;return i=y(e,o),u=o.scrollTop(),s.moveTop(u-a),p=x.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=x.options(i),i=x.assign(i,r(i)),a=e(t),s=e(n),u=a.add(s),c=l(o),f=P(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)){if(x.isFunction(t))return t;if(x.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(x.isString(t)){if(t.indexOf("/")>=0)return l(t.split("/"));if(e=g[t])return l(e)}}},T=function(t,e,n){var r;return t.hide(),r=x.merge(n,{duration:0}),up.layout.revealOrRestoreScroll(e,r)},y=function(t,n){var r,o,i,u,s,a,l,c,p;for(u=x.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],x.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=x.copy(v),s=x.copy(g)},h=function(t){return!t||"none"===t||x.isOptions(t)&&x.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 t.css(A(0,0)),r=x.measure(t),o=r.top+r.height,n(t,A(0,-o),e)}),b("move-from-top",function(t,e){var r,o;return t.css(A(0,0)),r=x.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 t.css(A(0,0)),r=x.measure(t),o=x.clientSize().height-r.top,n(t,A(0,o),e)}),b("move-from-bottom",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.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 t.css(A(0,0)),r=x.measure(t),o=r.left+r.width,n(t,A(-o,0),e)}),b("move-from-left",function(t,e){var r,o;return t.css(A(0,0)),r=x.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 t.css(A(0,0)),r=x.measure(t),o=x.clientSize().width-r.left,n(t,A(o,0),e)}),b("move-from-right",function(t,e){var r,o;return t.css(A(0,0)),r=x.measure(t),o=x.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=x.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,willAnimate:P,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,x,P,$,F,D,C,O,R,U,N,M;return N=up.util,n=void 0,T=void 0,C=void 0,b=void 0,O=void 0,A=[],l=N.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],safeMethods:["GET","OPTIONS","HEAD"]}),i=new up.Cache({size:function(){return l.cacheSize},expiry:function(){return l.cacheExpiry},key:function(t){return up.Request.wrap(t).cacheKey()},cachable:function(t){return up.Request.wrap(t).isCachable()}}),c=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(T),T=null},s=function(){return clearTimeout(C),C=null},$=function(){return n=null,u(),s(),b=0,l.reset(),i.clear(),O=!1,A=[]},$(),y=function(){var e,n,r,o,i;return e=1<=arguments.length?t.call(arguments,0):[],r=N.extractOptions(e),N.isGiven(e[0])&&(r.url=e[0]),n=r.cache===!1,i=up.Request.wrap(r),i.isSafe()||a(),!n&&(o=c(i))?up.puts("Re-using cached response for %s %s",i.method,i.url):(o=v(i),D(i,o),o["catch"](function(){return P(i)})),r.preload||(g(),N.always(o,m)),o},r=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.log.warn("up.ajax() has been deprecated. Use up.request() instead."),new Promise(function(t,n){var r;return r=function(e){return t(e.text)},y.apply(null,e).then(r,n)})},f=function(){return 0===b},p=function(){return b>0},g=function(){var t;if(b+=1,!C)return t=function(){if(p())return up.emit("up:proxy:slow",{message:"Proxy is slow to respond"}),O=!0},C=N.setTimer(l.slowDelay,t)},m=function(){if(b-=1,f()&&(s(),O))return up.emit("up:proxy:recover",{message:"Proxy has recovered from slow response"}),O=!1},v=function(t){return b<l.maxRequests?d(t):E(t)},E=function(t){var e;return up.puts("Queuing request for %s %s",t.method,t.url),e=function(){return d(t)},e=N.previewable(e),A.push(e),e.promise},d=function(t){var e,n;return e={request:t,message:["Loading %s %s",t.method,t.url]},up.bus.nobodyPrevents("up:proxy:load",e)?(n=t.send(),N.always(n,F),N.always(n,w),n):(N.microtask(w),Promise.reject(new Error("Event up:proxy:load was prevented")))},x=function(t){var e,n;if(n=t.request,t.url&&n.url!==t.url)return e=n.copy({method:t.method,url:t.url}),up.proxy.alias(n,e)},F=function(t){return t.isFatalError()?up.emit("up:proxy:fatal",{message:"Fatal error during request",request:t.request,response:t}):(t.isError()||x(t),up.emit("up:proxy:loaded",{message:["Server responded with HTTP %d (%d bytes)",t.status,t.text.length],request:t.request,response:t}))},w=function(){var t;"function"==typeof(t=A.shift())&&t()},o=i.alias,D=i.set,P=i.remove,a=i.clear,up.bus.renamedEvent("up:proxy:received","up:proxy:loaded"),S=function(t){var e,r;if(r=parseInt(N.presentAttr(t,"up-delay"))||l.preloadDelay,!t.is(n))return n=t,u(),e=function(){return N.muteRejection(k(t)),n=null},R(e,r)},R=function(t,e){return T=setTimeout(t,e)},U=function(t){if(t.is(n))return n=void 0,u()},k=function(t){var n;return n=e(t),up.link.isSafe(n)?up.log.group("Preloading link %o",n.get(0),function(){var t;return t=up.link.followVariantForLink(n),t.preloadLink(n)}):Promise.reject(new Error("Won't preload unsafe link"))},h=function(t){return N.contains(l.safeMethods,t)},M=function(t,e,n){return N.contains(l.wrapMethods,t)&&(e=N.appendRequestData(e,up.protocol.config.methodParam,t,n),t="POST"),[t,e]},up.compiler("a[up-preload], [up-href][up-preload]",function(t){if(up.link.isSafe(t))return t.on("mouseenter touchstart",function(e){if(up.link.shouldProcessEvent(e,t))return S(t)}),t.on("mouseleave",function(){return U(t)})}),up.on("up:framework:reset",$),{preload:k,ajax:r,request:y,get:c,alias:o,clear:a,remove:P,isIdle:f,isBusy:p,isSafeMethod:h,wrapMethod:M,config:l}}(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.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-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;return n=$(t).closest("form"),e=u.options(e),r=u.option(e.target,n.attr("up-target"),"body"),o=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.reveal=u.option(e.reveal,u.castedAttr(n,"up-reveal"),!0),e.failReveal=u.option(e.failReveal,u.castedAttr(n,"up-fail-reveal"),!0),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.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.bus.whenEmitted("up:form:submit",{$element:n}).then(function(){var t;return up.feedback.start(n),up.browser.canPushState()||e.history===!1?(t=up.replace(r,o,e),u.always(t,function(){return up.feedback.stop(n)}),t):(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),u.muteRejection(submit(e))}),up.on("change","[up-validate]",function(t,e){return u.muteRejection(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){
|
4
|
+
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},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.radio=function(){var t,e,n,r;return r=up.util,t=r.config({hungry:["[up-hungry]",'meta[name="csrf-param"]','meta[name="csrf-token"]'],hungryTransition:null}),n=function(){return t.reset()},e=function(){return r.multiSelector(t.hungry)},up.on("up:framework:reset",n),{config:t,hungrySelector:e}}(jQuery)}.call(this),function(){up.rails=function(t){var e,n;return n=up.util,e=function(){return!!t.rails},n.each(["method","confirm"],function(t){var r,o;return r="data-"+t,o="up-"+t,up.macro("["+r+"]",function(t){var i;if(e()&&up.link.isFollowable(t))return i={},i[o]=t.attr(r),n.setMissingAttrs(t,i),t.removeAttr(r)})})}(jQuery)}.call(this),function(){up.boot()}.call(this);
|
@@ -34,9 +34,9 @@ class up.FollowVariant
|
|
34
34
|
|
35
35
|
registerEvents: ->
|
36
36
|
up.on 'click', @fullSelector(), (args...) =>
|
37
|
-
@onClick(args...)
|
37
|
+
u.muteRejection @onClick(args...)
|
38
38
|
up.on 'mousedown', @fullSelector('[up-instant]'), (args...) =>
|
39
|
-
@onMousedown(args...)
|
39
|
+
u.muteRejection @onMousedown(args...)
|
40
40
|
|
41
41
|
followLink: ($link, options = {}) =>
|
42
42
|
up.bus.whenEmitted('up:link:follow', $element: $link).then =>
|
@@ -489,6 +489,8 @@ up.dom = (($) ->
|
|
489
489
|
hello($wrapper.children(), options)
|
490
490
|
|
491
491
|
# Reveal element that was being prepended/appended.
|
492
|
+
# Since we will animate (not morph) it's OK to allow animation of scrolling
|
493
|
+
# if the user has configured up.layout.config.duration.
|
492
494
|
promise = up.layout.revealOrRestoreScroll($wrapper, options)
|
493
495
|
|
494
496
|
# Since we're adding content instead of replacing, we'll only
|
@@ -581,7 +581,7 @@ up.form = (($) ->
|
|
581
581
|
###
|
582
582
|
up.on 'submit', 'form[up-target]', (event, $form) ->
|
583
583
|
up.bus.consumeAction(event)
|
584
|
-
submit($form)
|
584
|
+
u.muteRejection submit($form)
|
585
585
|
|
586
586
|
###*
|
587
587
|
When a form field with this attribute is changed, the form is validated on the server
|
@@ -729,7 +729,7 @@ up.form = (($) ->
|
|
729
729
|
@stable
|
730
730
|
###
|
731
731
|
up.on 'change', '[up-validate]', (event, $field) ->
|
732
|
-
validate($field)
|
732
|
+
u.muteRejection validate($field)
|
733
733
|
|
734
734
|
###*
|
735
735
|
Show or hide elements when a `<select>` or `<input>` has a given value.
|
@@ -462,13 +462,14 @@ up.layout = (($) ->
|
|
462
462
|
@internal
|
463
463
|
###
|
464
464
|
revealOrRestoreScroll = (selectorOrElement, options) ->
|
465
|
+
options = u.options(options)
|
465
466
|
$element = $(selectorOrElement)
|
466
467
|
|
467
468
|
if options.restoreScroll
|
468
469
|
return restoreScroll(around: $element)
|
469
470
|
|
470
471
|
if options.reveal
|
471
|
-
revealOptions = {}
|
472
|
+
revealOptions = { duration: options.duration }
|
472
473
|
if u.isString(options.reveal)
|
473
474
|
selector = revealSelector(options.reveal)
|
474
475
|
$element = up.first(selector) || $element
|
@@ -706,6 +706,9 @@ up.modal = (($) ->
|
|
706
706
|
preload: ($link, options) -> preloadNow($link, options)
|
707
707
|
|
708
708
|
# Close the modal when someone clicks outside the dialog (but not on a modal opener).
|
709
|
+
# We register the event on .up-modal, which covers the *entire* viewport, not just
|
710
|
+
# the dialog area.
|
711
|
+
#
|
709
712
|
# Note that we cannot listen to clicks on .up-modal-backdrop, which is a sister element
|
710
713
|
# of .up-modal-viewport. Since the user will effectively click on the viewport, not
|
711
714
|
# the backdrop, backdrop will not receive a bubbling event.
|
@@ -345,7 +345,10 @@ up.motion = (($) ->
|
|
345
345
|
# It's not our job to remove $old from the DOM.
|
346
346
|
$old.hide()
|
347
347
|
|
348
|
-
|
348
|
+
# Don't animate the scrolling.
|
349
|
+
# We just want to scroll $new into position before we start the enter animation.
|
350
|
+
scrollOptions = u.merge(options, { duration: 0})
|
351
|
+
up.layout.revealOrRestoreScroll($new, scrollOptions).then ->
|
349
352
|
newCopy = prependCopy($new, $viewport)
|
350
353
|
newScrollTop = $viewport.scrollTop()
|
351
354
|
|
@@ -523,9 +526,14 @@ up.motion = (($) ->
|
|
523
526
|
skipMorph = ($old, $new, options) ->
|
524
527
|
# Simply hide the old element, which would be the side effect of withGhosts(...) below.
|
525
528
|
$old.hide()
|
529
|
+
|
530
|
+
# Don't animate the scrolling.
|
531
|
+
# We just want to scroll $new into position before we start the enter animation.
|
532
|
+
scrollOptions = u.merge(options, { duration: 0})
|
533
|
+
|
526
534
|
# Since we cannot rely on withGhosts to control the scroll position
|
527
535
|
# in this branch, we need to do it ourselves.
|
528
|
-
up.layout.revealOrRestoreScroll($new,
|
536
|
+
up.layout.revealOrRestoreScroll($new, scrollOptions)
|
529
537
|
|
530
538
|
###*
|
531
539
|
@internal
|
@@ -565,19 +565,24 @@ up.proxy = (($) ->
|
|
565
565
|
|
566
566
|
up.bus.renamedEvent('up:proxy:received', 'up:proxy:loaded')
|
567
567
|
|
568
|
-
|
568
|
+
preloadAfterDelay = ($link) ->
|
569
569
|
delay = parseInt(u.presentAttr($link, 'up-delay')) || config.preloadDelay
|
570
570
|
unless $link.is($waitingLink)
|
571
571
|
$waitingLink = $link
|
572
572
|
cancelPreloadDelay()
|
573
573
|
curriedPreload = ->
|
574
|
-
preload($link)
|
574
|
+
u.muteRejection preload($link)
|
575
575
|
$waitingLink = null
|
576
576
|
startPreloadDelay(curriedPreload, delay)
|
577
|
-
|
577
|
+
|
578
578
|
startPreloadDelay = (block, delay) ->
|
579
579
|
preloadDelayTimer = setTimeout(block, delay)
|
580
580
|
|
581
|
+
stopPreload = ($link) ->
|
582
|
+
if $link.is($waitingLink)
|
583
|
+
$waitingLink = undefined
|
584
|
+
cancelPreloadDelay()
|
585
|
+
|
581
586
|
###*
|
582
587
|
Preloads the given link.
|
583
588
|
|
@@ -631,11 +636,15 @@ up.proxy = (($) ->
|
|
631
636
|
but will also make the interaction feel less instant.
|
632
637
|
@stable
|
633
638
|
###
|
634
|
-
up.
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
+
up.compiler 'a[up-preload], [up-href][up-preload]', ($link) ->
|
640
|
+
if up.link.isSafe($link)
|
641
|
+
$link.on 'mouseenter touchstart', (event) ->
|
642
|
+
# Don't do anything if we are hovering over the child of a link.
|
643
|
+
# The actual link will receive the event and bubble in a second.
|
644
|
+
if up.link.shouldProcessEvent(event, $link)
|
645
|
+
preloadAfterDelay($link)
|
646
|
+
$link.on 'mouseleave', ->
|
647
|
+
stopPreload($link)
|
639
648
|
|
640
649
|
up.on 'up:framework:reset', reset
|
641
650
|
|
@@ -1713,6 +1713,28 @@ up.util = (($) ->
|
|
1713
1713
|
always = (promise, callback) ->
|
1714
1714
|
promise.then(callback, callback)
|
1715
1715
|
|
1716
|
+
###*
|
1717
|
+
# Registers an empty rejection handler with the given promise.
|
1718
|
+
# This prevents browsers from printing "Uncaught (in promise)" to the error
|
1719
|
+
# console when the promise is rejection.
|
1720
|
+
#
|
1721
|
+
# This is helpful for event handlers where it is clear that no rejection
|
1722
|
+
# handler will be registered:
|
1723
|
+
#
|
1724
|
+
# up.on('submit', 'form[up-target]', (event, $form) => {
|
1725
|
+
# promise = up.submit($form)
|
1726
|
+
# up.util.muteRejection(promise)
|
1727
|
+
# })
|
1728
|
+
#
|
1729
|
+
# Does nothing if passed a missing value.
|
1730
|
+
#
|
1731
|
+
# @function up.util.muteRejection
|
1732
|
+
# @param {Promise|undefined|null} promise
|
1733
|
+
# @return {Promise}
|
1734
|
+
###
|
1735
|
+
muteRejection = (promise) ->
|
1736
|
+
promise?.catch(noop)
|
1737
|
+
|
1716
1738
|
###*
|
1717
1739
|
@function up.util.newDeferred
|
1718
1740
|
@internal
|
@@ -1859,6 +1881,7 @@ up.util = (($) ->
|
|
1859
1881
|
isTruthy: isTruthy
|
1860
1882
|
newDeferred: newDeferred
|
1861
1883
|
always: always
|
1884
|
+
muteRejection: muteRejection
|
1862
1885
|
rejectOnError: rejectOnError
|
1863
1886
|
isBodyDescendant: isBodyDescendant
|
1864
1887
|
isCrossDomain: isCrossDomain
|