]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Update JavaScript libraries used by the internal Web dashboard 16738/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jan 2026 14:07:45 +0000 (15:07 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 19 Jan 2026 14:07:45 +0000 (15:07 +0100)
This updates:
- `jQuery` from 1.12.0 to 3.7.1
- `rickshaw` from 1.5.1 to 1.7.0
- `moment` from 2.11.1 to 2.30.1

`d3` is not updated because recent versions are not supported by rickshaw.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/html/js/jquery.min.js
pdns/dnsdistdist/html/js/moment.min.js
pdns/dnsdistdist/html/js/rickshaw.min.js
pdns/dnsdistdist/src_js/SOURCES
pdns/dnsdistdist/src_js/jquery.js
pdns/dnsdistdist/src_js/moment.js
pdns/dnsdistdist/src_js/rickshaw.js

index 6c60672fc59b15d0d586550f221acef27b009bc7..7f37b5d99122b4928505d1e0ac5ca7279edd56ed 100644 (file)
@@ -1,5 +1,2 @@
-/*! jQuery v1.12.0 | (c) jQuery Foundation | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
-return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
-marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),c.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){
-n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
+/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce});
index c04a26c950aec0c5e48c312b2ac3b13e01dec7eb..8b80f200c045816a0f826d854e80fefda46ac28d 100644 (file)
@@ -1,2 +1,2 @@
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function f(){return H.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Pt(e,t,n,s,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){if(null==e._isValid){var t=m(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function I(e){var t=l(NaN);return null!=e?E(m(t),e):m(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=f.momentProperties=[],z=!1;function $(e,t){var n,s,i,r=Z.length;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=m(t)),o(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)o(i=t[s=Z[n]])||(e[s]=i);return e}function q(e){$(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,f.updateOffset(this),z=!1)}function h(e){return e instanceof q||null!=e&&null!=e._isAMomentObject}function B(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function d(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=d(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={};function t(e,t){var n=e.toLowerCase();oe[n]=oe[n+"s"]=oe[t]=e}function _(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=_(n))&&(s[t]=e[n]);return s}var le={};function n(e,t){le[e]=t}function he(e){return e%4==0&&e%100!=0||e%400==0}function y(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function g(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?y(e):t}function de(t,n){return function(e){return null!=e?(fe(this,t,e),f.updateOffset(this,n),this):ce(this,t)}}function ce(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function fe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&he(e.year())&&1===e.month()&&29===e.date()?(n=g(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),We(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var i=/\d/,w=/\d\d/,me=/\d{3}/,_e=/\d{4}/,ye=/[+-]?\d{6}/,p=/\d\d?/,ge=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,pe=/\d{1,3}/,ke=/\d{1,4}/,ve=/[+-]?\d{1,6}/,Me=/\d+/,De=/[+-]?\d+/,Se=/Z|[+-]\d\d:?\d\d/gi,Ye=/Z|[+-]\d\d(?::?\d\d)?/gi,k=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function v(e,n,s){be[e]=d(n)?n:function(e,t){return e&&s?s:n}}function Oe(e,t){return c(be,e)?be[e](t._strict,t._locale):new RegExp(M(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function M(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var be={},xe={};function D(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),u(n)&&(i=function(e,t){t[n]=g(e)}),s=e.length,t=0;t<s;t++)xe[e[t]]=i}function Te(e,i){D(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var S,Y=0,O=1,b=2,x=3,T=4,N=5,Ne=6,Pe=7,Re=8;function We(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%(n=12)+n)%n;return e+=(t-n)/12,1==n?he(e)?29:28:31-n%7%2}S=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),t("month","M"),n("month",8),v("M",p),v("MM",p,w),v("MMM",function(e,t){return t.monthsShortRegex(e)}),v("MMMM",function(e,t){return t.monthsRegex(e)}),D(["M","MM"],function(e,t){t[O]=g(e)-1}),D(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[O]=s:m(n).invalidMonth=e});var Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ue="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),He=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fe=k,Le=k;function Ve(e,t){var n;if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=g(t);else if(!u(t=e.localeData().monthsParse(t)))return;n=Math.min(e.date(),We(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n)}}function Ge(e){return null!=e?(Ve(this,e),f.updateOffset(this,!0),this):ce(this,"Month")}function Ee(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=l([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=M(n[r]),s[r]=M(s[r]);for(r=0;r<24;r++)i[r]=M(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Ae(e){return he(e)?366:365}s("Y",0,0,function(){var e=this.year();return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),t("year","y"),n("year",1),v("Y",De),v("YY",p,w),v("YYYY",ke,_e),v("YYYYY",ve,ye),v("YYYYYY",ve,ye),D(["YYYYY","YYYYYY"],Y),D("YYYY",function(e,t){t[Y]=2===e.length?f.parseTwoDigitYear(e):g(e)}),D("YY",function(e,t){t[Y]=f.parseTwoDigitYear(e)}),D("Y",function(e,t){t[Y]=parseInt(e,10)}),f.parseTwoDigitYear=function(e){return g(e)+(68<g(e)?1900:2e3)};var Ie=de("FullYear",!0);function je(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function Ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ze(e,t,n){n=7+t-n;return n-(7+Ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+ze(e,s,i),n=t<=0?Ae(r=e-1)+t:t>Ae(e)?(r=e+1,t-Ae(e)):(r=e,t);return{year:r,dayOfYear:n}}function qe(e,t,n){var s,i,r=ze(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+P(i=e.year()-1,t,n):r>P(e.year(),t,n)?(s=r-P(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function P(e,t,n){var s=ze(e,t,n),t=ze(e+1,t,n);return(Ae(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),t("week","w"),t("isoWeek","W"),n("week",5),n("isoWeek",5),v("w",p),v("ww",p,w),v("W",p),v("WW",p,w),Te(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=g(e)});function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),t("day","d"),t("weekday","e"),t("isoWeekday","E"),n("day",11),n("weekday",11),n("isoWeekday",11),v("d",p),v("e",p),v("E",p),v("dd",function(e,t){return t.weekdaysMinRegex(e)}),v("ddd",function(e,t){return t.weekdaysShortRegex(e)}),v("dddd",function(e,t){return t.weekdaysRegex(e)}),Te(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:m(n).invalidWeekday=e}),Te(["d","e","E"],function(e,t,n,s){t[s]=g(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=k,et=k,tt=k;function nt(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=M(this.weekdaysMin(s,"")),n=M(this.weekdaysShort(s,"")),s=M(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function st(){return this.hours()%12||12}function it(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,st),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),it("a",!0),it("A",!1),t("hour","h"),n("hour",13),v("a",rt),v("A",rt),v("H",p),v("h",p),v("k",p),v("HH",p,w),v("hh",p,w),v("kk",p,w),v("hmm",ge),v("hmmss",we),v("Hmm",ge),v("Hmmss",we),D(["H","HH"],x),D(["k","kk"],function(e,t,n){e=g(e);t[x]=24===e?0:e}),D(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),D(["h","hh"],function(e,t,n){t[x]=g(e),m(n).bigHour=!0}),D("hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s)),m(n).bigHour=!0}),D("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i)),m(n).bigHour=!0}),D("Hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s))}),D("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i))});k=de("Hours",!0);var at,ot={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:Ue,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Xe,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},R={},ut={};function lt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=lt(e[r]).split("-")).length,n=(n=lt(e[r+1]))?n.split("-"):null;0<t;){if(s=dt(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return at}function dt(t){var e;if(void 0===R[t]&&"undefined"!=typeof module&&module&&module.exports&&null!=t.match("^[^/\\\\]*$"))try{e=at._abbr,require("./locale/"+t),ct(e)}catch(e){R[t]=null}return R[t]}function ct(e,t){return e&&((t=o(t)?mt(e):ft(e,t))?at=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),at._abbr}function ft(e,t){if(null===t)return delete R[e],null;var n,s=ot;if(t.abbr=e,null!=R[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=R[e]._config;else if(null!=t.parentLocale)if(null!=R[t.parentLocale])s=R[t.parentLocale]._config;else{if(null==(n=dt(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;s=n._config}return R[e]=new K(X(s,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),ct(e),R[e]}function mt(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return at;if(!a(e)){if(t=dt(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===m(e).overflow&&(t=t[O]<0||11<t[O]?O:t[b]<1||t[b]>We(t[Y],t[O])?b:t[x]<0||24<t[x]||24===t[x]&&(0!==t[T]||0!==t[N]||0!==t[Ne])?x:t[T]<0||59<t[T]?T:t[N]<0||59<t[N]?N:t[Ne]<0||999<t[Ne]?Ne:-1,m(e)._overflowDayOfYear&&(t<Y||b<t)&&(t=b),m(e)._overflowWeeks&&-1===t&&(t=Pe),m(e)._overflowWeekday&&-1===t&&(t=Re),m(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],vt=/^\/?Date\((-?\d+)/i,Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function St(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(m(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Tt(e)}else e._isValid=!1}}else e._isValid=!1}function Yt(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Ue.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s,i,r=Mt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));r?(t=Yt(r[4],r[3],r[2],r[5],r[6],r[7]),n=r[1],s=t,i=e,n&&Qe.indexOf(n)!==new Date(s[0],s[1],s[2]).getDay()?(m(i).weekdayMismatch=!0,i._isValid=!1):(e._a=t,e._tzm=(n=r[8],s=r[9],i=r[10],n?Dt[n]:s?0:60*(((n=parseInt(i,10))-(s=n%100))/100)+s),e._d=Ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function xt(e){var t,n,s,i,r,a,o,u,l,h,d,c=[];if(!e._d){for(s=e,i=new Date(f.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[b]&&null==e._a[O]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[Y],qe(W(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(h=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,d=qe(W(),u,l),r=bt(i.gg,s._a[Y],d.year),a=bt(i.w,d.week),null!=i.d?((o=i.d)<0||6<o)&&(h=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(h=!0)):o=u),a<1||a>P(r,u,l)?m(s)._overflowWeeks=!0:null!=h?m(s)._overflowWeekday=!0:(d=$e(r,a,o,u,l),s._a[Y]=d.year,s._dayOfYear=d.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[Y],n[Y]),(e._dayOfYear>Ae(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),h=Ze(i,0,e._dayOfYear),e._a[O]=h.getUTCMonth(),e._a[b]=h.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[x]&&0===e._a[T]&&0===e._a[N]&&0===e._a[Ne]&&(e._nextDay=!0,e._a[x]=0),e._d=(e._useUTC?Ze:je).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[x]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(m(e).weekdayMismatch=!0)}}function Tt(e){if(e._f===f.ISO_8601)St(e);else if(e._f===f.RFC_2822)Ot(e);else{e._a=[],m(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],h=l.length,d=0;d<h;d++)n=l[d],(t=(a.match(Oe(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&m(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?m(e).empty=!1:m(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(xe,s)&&xe[s](i,r._a,r,s)):e._strict&&!t&&m(e).unusedTokens.push(n);m(e).charsLeftOver=o-u,0<a.length&&m(e).unusedInput.push(a),e._a[x]<=12&&!0===m(e).bigHour&&0<e._a[x]&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[x]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[x],e._meridiem),null!==(o=m(e).era)&&(e._a[Y]=e._locale.erasConvertYear(o,e._a[Y])),xt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||mt(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),h(i))return new q(_t(i));if(V(i))e._d=i;else if(a(r))!function(e){var t,n,s,i,r,a,o=!1,u=e._f.length;if(0===u)return m(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<u;i++)r=0,a=!1,t=$({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Tt(t),A(t)&&(a=!0),r=(r+=m(t).charsLeftOver)+10*m(t).unusedTokens.length,m(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));E(e,n||t)}(e);else if(r)Tt(e);else if(o(r=(i=e)._i))i._d=new Date(f.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=vt.exec(n._i))?n._d=new Date(+t[1]):(St(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid&&(delete n._isValid,n._strict?n._isValid=!1:f.createFromInputFallback(n))))):a(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),xt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),xt(t)):u(r)?i._d=new Date(r):f.createFromInputFallback(i);return A(e)||(e._d=null),e}function Pt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||a(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new q(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function W(e,t,n,s){return Pt(e,t,n,s,!1)}f.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),f.ISO_8601=function(){},f.RFC_2822=function(){};ge=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),we=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Rt(e,t){var n,s;if(!(t=1===t.length&&a(t[0])?t[0]:t).length)return W();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Wt.length;for(t in e)if(c(e,t)&&(-1===S.call(Wt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Wt[n]]){if(s)return!1;parseFloat(e[Wt[n]])!==g(e[Wt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=mt(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),v("Z",Ye),v("ZZ",Ye),D(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(Ye,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+g(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(h(e)||V(e)?e:W(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),f.updateOffset(t,!1),t):W(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}f.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e,i=null;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(i=It.exec(e))?(n="-"===i[1]?-1:1,s={y:0,d:g(i[b])*n,h:g(i[x])*n,m:g(i[T])*n,s:g(i[N])*n,ms:g(Ht(1e3*i[Ne]))*n}):(i=jt.exec(e))?(n="-"===i[1]?-1:1,s={y:Zt(i[2],n),M:Zt(i[3],n),w:Zt(i[4],n),d:Zt(i[5],n),h:Zt(i[6],n),m:Zt(i[7],n),s:Zt(i[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(W(s.from),W(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),i=new Ct(s),Ut(e)&&c(e,"_locale")&&(i._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(i._isValid=e._isValid),i}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,C(e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ve(e,ce(e,"Month")+t*n),r&&fe(e,"Date",ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&f.updateOffset(e,r||t))}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Ce=$t(1,"add"),Je=$t(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return h(e)||V(e)||Bt(e)||u(e)||function(t){var e=a(t),n=!1;e&&(n=0===t.filter(function(e){return!u(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){if(e.date()<t.date())return-Qt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months"),t=t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s);return-(n+t)||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=mt(e))&&(this._locale=e),this)}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Xe=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e=[],t=[],n=[],s=[],i=this.eras(),r=0,a=i.length;r<a;++r)t.push(M(i[r].name)),e.push(M(i[r].abbr)),n.push(M(i[r].narrow)),s.push(M(i[r].name)),s.push(M(i[r].abbr)),s.push(M(i[r].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?qe(this,s,i).year:(r=P(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=Ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),v("N",rn),v("NN",rn),v("NNN",rn),v("NNNN",function(e,t){return t.erasNameRegex(e)}),v("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),D(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?m(n).era=s:m(n).invalidEra=e}),v("y",Me),v("yy",Me),v("yyy",Me),v("yyyy",Me),v("yo",function(e,t){return t._eraYearOrdinalRegex||Me}),D(["y","yy","yyy","yyyy"],Y),D(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Y]=n._locale.eraYearOrdinalParse(e,i):t[Y]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),t("weekYear","gg"),t("isoWeekYear","GG"),n("weekYear",1),n("isoWeekYear",1),v("G",De),v("g",De),v("GG",p,w),v("gg",p,w),v("GGGG",ke,_e),v("gggg",ke,_e),v("GGGGG",ve,ye),v("ggggg",ve,ye),Te(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=g(e)}),Te(["gg","GG"],function(e,t,n,s){t[s]=f.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),t("quarter","Q"),n("quarter",7),v("Q",i),D("Q",function(e,t){t[O]=3*(g(e)-1)}),s("D",["DD",2],"Do","date"),t("date","D"),n("date",9),v("D",p),v("DD",p,w),v("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),D(["D","DD"],b),D("Do",function(e,t){t[b]=g(e.match(p)[0])});ke=de("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),t("dayOfYear","DDD"),n("dayOfYear",4),v("DDD",pe),v("DDDD",me),D(["DDD","DDDD"],function(e,t,n){n._dayOfYear=g(e)}),s("m",["mm",2],0,"minute"),t("minute","m"),n("minute",14),v("m",p),v("mm",p,w),D(["m","mm"],T);var ln,_e=de("Minutes",!1),ve=(s("s",["ss",2],0,"second"),t("second","s"),n("second",15),v("s",p),v("ss",p,w),D(["s","ss"],N),de("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),t("millisecond","ms"),n("millisecond",16),v("S",pe,i),v("SS",pe,w),v("SSS",pe,me),ln="SSSS";ln.length<=9;ln+="S")v(ln,Me);function hn(e,t){t[Ne]=g(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")D(ln,hn);ye=de("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");i=q.prototype;function dn(e){return e}i.add=Ce,i.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||W(),n=Gt(e,this).startOf("day"),n=f.calendarFormat(this,n)||"sameElse",t=t&&(d(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,W(e)))},i.clone=function(){return new q(this)},i.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=_(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:y(r)},i.endOf=function(e){var t,n;if(void 0===(e=_(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1;break}return this._d.setTime(t),f.updateOffset(this,!0),this},i.format=function(e){return e=e||(this.isUtc()?f.defaultFormatUtc:f.defaultFormat),e=re(this,e),this.localeData().postformat(e)},i.from=function(e,t){return this.isValid()&&(h(e)&&e.isValid()||W(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},i.fromNow=function(e){return this.from(W(),e)},i.to=function(e,t){return this.isValid()&&(h(e)&&e.isValid()||W(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},i.toNow=function(e){return this.to(W(),e)},i.get=function(e){return d(this[e=_(e)])?this[e]():this},i.invalidAt=function(){return m(this).overflow},i.isAfter=function(e,t){return e=h(e)?e:W(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},i.isBefore=function(e,t){return e=h(e)?e:W(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},i.isBetween=function(e,t,n,s){return e=h(e)?e:W(e),t=h(t)?t:W(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&(("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n)))},i.isSame=function(e,t){var e=h(e)?e:W(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},i.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},i.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},i.isValid=function(){return A(this)},i.lang=Xe,i.locale=Xt,i.localeData=Kt,i.max=we,i.min=ge,i.parsingFlags=function(){return E({},m(this))},i.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(d(this[e=_(e)]))return this[e](t);return this},i.startOf=function(e){var t,n;if(void 0===(e=_(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3);break}return this._d.setTime(t),f.updateOffset(this,!0),this},i.subtract=Je,i.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},i.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},i.toDate=function(){return new Date(this.valueOf())},i.toISOString=function(e){if(!this.isValid())return null;var t=(e=!0!==e)?this.clone().utc():this;return t.year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):d(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},i.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t="moment",n="";return this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",n="Z"),t="["+t+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+e+"-MM-DD[T]HH:mm:ss.SSS"+(n+'[")]'))},"undefined"!=typeof Symbol&&null!=Symbol.for&&(i[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},i.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},i.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},i.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},i.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},i.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-f(n[s].since).year())*e+n[s].offset;return this.year()},i.year=Ie,i.isLeapYear=function(){return he(this.year())},i.weekYear=function(e){return un.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},i.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},i.quarter=i.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},i.month=Ge,i.daysInMonth=function(){return We(this.year(),this.month())},i.week=i.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},i.isoWeek=i.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},i.weeksInYear=function(){var e=this.localeData()._week;return P(this.year(),e.dow,e.doy)},i.weeksInWeekYear=function(){var e=this.localeData()._week;return P(this.weekYear(),e.dow,e.doy)},i.isoWeeksInYear=function(){return P(this.year(),1,4)},i.isoWeeksInISOWeekYear=function(){return P(this.isoWeekYear(),1,4)},i.date=ke,i.day=i.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},i.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},i.isoWeekday=function(e){return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN;var t,n},i.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},i.hour=i.hours=k,i.minute=i.minutes=_e,i.second=i.seconds=ve,i.millisecond=i.milliseconds=ye,i.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(Ye,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this},i.utc=function(e){return this.utcOffset(0,e)},i.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Et(this),"m")),this},i.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Se,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},i.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?W(e).utcOffset():0,(this.utcOffset()-e)%60==0)},i.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},i.isLocal=function(){return!!this.isValid()&&!this._isUTC},i.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},i.isUtc=At,i.isUTC=At,i.zoneAbbr=function(){return this._isUTC?"UTC":""},i.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},i.dates=e("dates accessor is deprecated. Use date instead.",ke),i.months=e("months accessor is deprecated. Use month instead",Ge),i.years=e("years accessor is deprecated. Use year instead",Ie),i.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),i.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return $(t,this),(t=Nt(t))._a?(e=(t._isUTC?l:W)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&g(e[a])!==g(t[a]))&&r++;return r+i}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});w=K.prototype;function cn(e,t,n,s){var i=mt(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?u(t)&&(n=t,t=void 0):(t=e,e=!1,u(n=t)&&(n=t,t=void 0)),t||"");var i,r=mt(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}w.calendar=function(e,t,n){return d(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},w.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},w.invalidDate=function(){return this._invalidDate},w.ordinal=function(e){return this._ordinal.replace("%d",e)},w.preparse=dn,w.postformat=dn,w.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return d(i)?i(e,t,n,s):i.replace(/%d/i,e)},w.pastFuture=function(e,t){return d(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},w.set=function(e){var t,n;for(n in e)c(e,n)&&(d(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},w.eras=function(e,t){for(var n,s=this._eras||mt("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=f(s[i].since).startOf("day"),s[i].since=n.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=f(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf();break}}return s},w.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s];break}else if(0<=[r,a,o].indexOf(e))return u[s]},w.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?f(e.since).year():f(e.since).year()+(t-e.offset)*n},w.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},w.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},w.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},w.months=function(e,t){return e?(a(this._months)?this._months:this._months[(this._months.isFormat||He).test(t)?"format":"standalone"])[e.month()]:a(this._months)?this._months:this._months.standalone},w.monthsShort=function(e,t){return e?(a(this._monthsShort)?this._monthsShort:this._monthsShort[He.test(t)?"format":"standalone"])[e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},w.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=S.call(this._shortMonthsParse,e))?i:null:-1!==(i=S.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=S.call(this._shortMonthsParse,e))||-1!==(i=S.call(this._longMonthsParse,e))?i:null:-1!==(i=S.call(this._longMonthsParse,e))||-1!==(i=S.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},w.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ee.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},w.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ee.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},w.week=function(e){return qe(e,this._week.dow,this._week.doy).week},w.firstDayOfYear=function(){return this._week.doy},w.firstDayOfWeek=function(){return this._week.dow},w.weekdays=function(e,t){return t=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Be(t,this._week.dow):e?t[e.day()]:t},w.weekdaysMin=function(e){return!0===e?Be(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},w.weekdaysShort=function(e){return!0===e?Be(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},w.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=S.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=S.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._shortWeekdaysParse,e))||-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=S.call(this._shortWeekdaysParse,e))||-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:-1!==(i=S.call(this._minWeekdaysParse,e))||-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},w.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Ke),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},w.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},w.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},w.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},w.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ct("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===g(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),f.lang=e("moment.lang is deprecated. Use moment.locale instead.",ct),f.langData=e("moment.langData is deprecated. Use moment.localeData instead.",mt);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}pe=kn("ms"),me=kn("s"),Ce=kn("m"),we=kn("h"),ge=kn("d"),Je=kn("w"),k=kn("M"),_e=kn("Q"),ve=kn("y");function vn(e){return function(){return this.isValid()?this._data[e]:NaN}}var ye=vn("milliseconds"),ke=vn("seconds"),Ie=vn("minutes"),w=vn("hours"),Mn=vn("days"),Dn=vn("months"),Sn=vn("years");var Yn=Math.round,On={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bn(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),h=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return(r=(r=null!=n.w?r||h<=1&&["w"]||h<n.w&&["ww",h]:r)||l<=1&&["M"]||l<n.M&&["MM",l]||i<=1&&["y"]||["yy",i])[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var xn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function Nn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o=xn(this._milliseconds)/1e3,u=xn(this._days),l=xn(this._months),h=this.asSeconds();return h?(e=y(o/60),t=y(e/60),o%=60,e%=60,n=y(l/12),l%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",i=Tn(this._months)!==Tn(h)?"-":"",r=Tn(this._days)!==Tn(h)?"-":"",a=Tn(this._milliseconds)!==Tn(h)?"-":"",(h<0?"-":"")+"P"+(n?i+n+"Y":"")+(l?i+l+"M":"")+(u?r+u+"D":"")+(t||e||o?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(o?a+s+"S":"")):"P0D"}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=_(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=pe,U.asSeconds=me,U.asMinutes=Ce,U.asHours=we,U.asDays=ge,U.asWeeks=Je,U.asMonths=k,U.asQuarters=_e,U.asYears=ve,U.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12):NaN},U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=y(e/1e3),s.seconds=e%60,e=y(e/60),s.minutes=e%60,e=y(e/60),s.hours=e%24,t+=y(e/24),n+=e=y(wn(t)),t-=gn(pn(e)),e=y(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=_(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=ye,U.seconds=ke,U.minutes=Ie,U.hours=w,U.days=Mn,U.weeks=function(){return y(this.days()/7)},U.months=Dn,U.years=Sn,U.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=On;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},On,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),e=this.localeData(),t=bn(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)},U.toISOString=Nn,U.toString=Nn,U.toJSON=Nn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),U.lang=Xe,s("X",0,0,"unix"),s("x",0,0,"valueOf"),v("x",De),v("X",/[+-]?\d+(\.\d{1,3})?/),D("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),D("x",function(e,t,n){n._d=new Date(g(e))}),f.version="2.29.2",H=W,f.fn=i,f.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},f.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},f.now=function(){return Date.now?Date.now():+new Date},f.utc=l,f.unix=function(e){return W(1e3*e)},f.months=function(e,t){return fn(e,t,"months")},f.isDate=V,f.locale=ct,f.invalid=I,f.duration=C,f.isMoment=h,f.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},f.parseZone=function(){return W.apply(null,arguments).parseZone()},f.localeData=mt,f.isDuration=Ut,f.monthsShort=function(e,t){return fn(e,t,"monthsShort")},f.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},f.defineLocale=ft,f.updateLocale=function(e,t){var n,s;return null!=t?(s=ot,null!=R[e]&&null!=R[e].parentLocale?R[e].set(X(R[e]._config,t)):(t=X(s=null!=(n=dt(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=R[e],R[e]=s),ct(e)):null!=R[e]&&(null!=R[e].parentLocale?(R[e]=R[e].parentLocale,e===ct()&&ct(e)):null!=R[e]&&delete R[e]),R[e]},f.locales=function(){return ee(R)},f.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},f.normalizeUnits=_,f.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},f.relativeTimeThreshold=function(e,t){return void 0!==On[e]&&(void 0===t?On[e]:(On[e]=t,"s"===e&&(On.ss=t-1),!0))},f.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},f.prototype=i,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f});
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function _(){return H.apply(null,arguments)}function y(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function g(e){return void 0===e}function w(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Wt(e,t,n,s,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){var t,n,s=e._d&&!isNaN(e._d.getTime());return s&&(t=p(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n),e._strict)&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function I(e){var t=l(NaN);return null!=e?E(p(t),e):p(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=_.momentProperties=[],z=!1;function q(e,t){var n,s,i,r=Z.length;if(g(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),g(t._i)||(e._i=t._i),g(t._f)||(e._f=t._f),g(t._l)||(e._l=t._l),g(t._strict)||(e._strict=t._strict),g(t._tzm)||(e._tzm=t._tzm),g(t._isUTC)||(e._isUTC=t._isUTC),g(t._offset)||(e._offset=t._offset),g(t._pf)||(e._pf=p(t)),g(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)g(i=t[s=Z[n]])||(e[s]=i);return e}function $(e){q(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,_.updateOffset(this),z=!1)}function k(e){return e instanceof $||null!=e&&null!=e._isAMomentObject}function B(e){!1===_.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=_.deprecationHandler&&_.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=_.deprecationHandler&&_.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function a(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=a(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function o(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=o(n))&&(s[t]=e[n]);return s}var le={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var de=/\d/,t=/\d\d/,he=/\d{3}/,ce=/\d{4}/,fe=/[+-]?\d{6}/,n=/\d\d?/,me=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,we=/[+-]?\d{1,6}/,pe=/\d+/,ke=/[+-]?\d+/,Me=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,i=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,u=/^[1-9]\d?/,d=/^([1-9]\d|\d)/;function h(e,n,s){Ye[e]=a(n)?n:function(e,t){return e&&s?s:n}}function De(e,t){return c(Ye,e)?Ye[e](t._strict,t._locale):new RegExp(f(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function f(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function m(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function M(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?m(e):t}var Ye={},Se={};function v(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),w(n)&&(i=function(e,t){t[n]=M(e)}),s=e.length,t=0;t<s;t++)Se[e[t]]=i}function Oe(e,i){v(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}function be(e){return e%4==0&&e%100!=0||e%400==0}var D=0,Y=1,S=2,O=3,b=4,T=5,Te=6,xe=7,Ne=8;function We(e){return be(e)?366:365}s("Y",0,0,function(){var e=this.year();return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),h("Y",ke),h("YY",n,t),h("YYYY",ge,ce),h("YYYYY",we,fe),h("YYYYYY",we,fe),v(["YYYYY","YYYYYY"],D),v("YYYY",function(e,t){t[D]=2===e.length?_.parseTwoDigitYear(e):M(e)}),v("YY",function(e,t){t[D]=_.parseTwoDigitYear(e)}),v("Y",function(e,t){t[D]=parseInt(e,10)}),_.parseTwoDigitYear=function(e){return M(e)+(68<M(e)?1900:2e3)};var x,Pe=Re("FullYear",!0);function Re(t,n){return function(e){return null!=e?(Ue(this,t,e),_.updateOffset(this,n),this):Ce(this,t)}}function Ce(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ue(e,t,n){var s,i,r;if(e.isValid()&&!isNaN(n)){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return i?s.setUTCMilliseconds(n):s.setMilliseconds(n);case"Seconds":return i?s.setUTCSeconds(n):s.setSeconds(n);case"Minutes":return i?s.setUTCMinutes(n):s.setMinutes(n);case"Hours":return i?s.setUTCHours(n):s.setHours(n);case"Date":return i?s.setUTCDate(n):s.setDate(n);case"FullYear":break;default:return}t=n,r=e.month(),e=29!==(e=e.date())||1!==r||be(t)?e:28,i?s.setUTCFullYear(t,r,e):s.setFullYear(t,r,e)}}function He(e,t){var n;return isNaN(e)||isNaN(t)?NaN:(n=(t%(n=12)+n)%n,e+=(t-n)/12,1==n?be(e)?29:28:31-n%7%2)}x=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),h("M",n,u),h("MM",n,t),h("MMM",function(e,t){return t.monthsShortRegex(e)}),h("MMMM",function(e,t){return t.monthsRegex(e)}),v(["M","MM"],function(e,t){t[Y]=M(e)-1}),v(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[Y]=s:p(n).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Le="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ve=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ge=i,Ee=i;function Ae(e,t){if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=M(t);else if(!w(t=e.localeData().monthsParse(t)))return;var n=(n=e.date())<29?n:Math.min(n,He(e.year(),t));e._isUTC?e._d.setUTCMonth(t,n):e._d.setMonth(t,n)}}function Ie(e){return null!=e?(Ae(this,e),_.updateOffset(this,!0),this):Ce(this,"Month")}function je(){function e(e,t){return t.length-e.length}for(var t,n,s=[],i=[],r=[],a=0;a<12;a++)n=l([2e3,a]),t=f(this.monthsShort(n,"")),n=f(this.months(n,"")),s.push(t),i.push(n),r.push(n),r.push(t);s.sort(e),i.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ze(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function qe(e,t,n){n=7+t-n;return n-(7+ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+qe(e,s,i),n=t<=0?We(r=e-1)+t:t>We(e)?(r=e+1,t-We(e)):(r=e,t);return{year:r,dayOfYear:n}}function Be(e,t,n){var s,i,r=qe(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+N(i=e.year()-1,t,n):r>N(e.year(),t,n)?(s=r-N(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function N(e,t,n){var s=qe(e,t,n),t=qe(e+1,t,n);return(We(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),h("w",n,u),h("ww",n,t),h("W",n,u),h("WW",n,t),Oe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=M(e)});function Je(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),h("d",n),h("e",n),h("E",n),h("dd",function(e,t){return t.weekdaysMinRegex(e)}),h("ddd",function(e,t){return t.weekdaysShortRegex(e)}),h("dddd",function(e,t){return t.weekdaysRegex(e)}),Oe(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:p(n).invalidWeekday=e}),Oe(["d","e","E"],function(e,t,n,s){t[s]=M(e)});var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),et=i,tt=i,nt=i;function st(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=f(this.weekdaysMin(s,"")),n=f(this.weekdaysShort(s,"")),s=f(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function it(){return this.hours()%12||12}function rt(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,it),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),rt("a",!0),rt("A",!1),h("a",at),h("A",at),h("H",n,d),h("h",n,u),h("k",n,u),h("HH",n,t),h("hh",n,t),h("kk",n,t),h("hmm",me),h("hmmss",_e),h("Hmm",me),h("Hmmss",_e),v(["H","HH"],O),v(["k","kk"],function(e,t,n){e=M(e);t[O]=24===e?0:e}),v(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),v(["h","hh"],function(e,t,n){t[O]=M(e),p(n).bigHour=!0}),v("hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s)),p(n).bigHour=!0}),v("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i)),p(n).bigHour=!0}),v("Hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s))}),v("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i))});i=Re("Hours",!0);var ot,ut={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Fe,monthsShort:Le,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},W={},lt={};function dt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=dt(e[r]).split("-")).length,n=(n=dt(e[r+1]))?n.split("-"):null;0<t;){if(s=ct(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return ot}function ct(t){var e,n;if(void 0===W[t]&&"undefined"!=typeof module&&module&&module.exports&&(n=t)&&n.match("^[^/\\\\]*$"))try{e=ot._abbr,require("./locale/"+t),ft(e)}catch(e){W[t]=null}return W[t]}function ft(e,t){return e&&((t=g(t)?P(e):mt(e,t))?ot=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function mt(e,t){if(null===t)return delete W[e],null;var n,s=ut;if(t.abbr=e,null!=W[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=W[e]._config;else if(null!=t.parentLocale)if(null!=W[t.parentLocale])s=W[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return W[e]=new K(X(s,t)),lt[e]&&lt[e].forEach(function(e){mt(e.name,e.config)}),ft(e),W[e]}function P(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return ot;if(!y(e)){if(t=ct(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===p(e).overflow&&(t=t[Y]<0||11<t[Y]?Y:t[S]<1||t[S]>He(t[D],t[Y])?S:t[O]<0||24<t[O]||24===t[O]&&(0!==t[b]||0!==t[T]||0!==t[Te])?O:t[b]<0||59<t[b]?b:t[T]<0||59<t[T]?T:t[Te]<0||999<t[Te]?Te:-1,p(e)._overflowDayOfYear&&(t<D||S<t)&&(t=S),p(e)._overflowWeeks&&-1===t&&(t=xe),p(e)._overflowWeekday&&-1===t&&(t=Ne),p(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((-?\d+)/i,vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Yt(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(p(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xt(e)}else e._isValid=!1}}else e._isValid=!1}function St(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Le.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s=vt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));s?(t=St(s[4],s[3],s[2],s[5],s[6],s[7]),function(e,t,n){if(!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay())return 1;p(n).weekdayMismatch=!0,n._isValid=!1}(s[1],t,e)&&(e._a=t,e._tzm=(t=s[8],n=s[9],s=s[10],t?Dt[t]:n?0:60*(((t=parseInt(s,10))-(n=t%100))/100)+n),e._d=ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function Tt(e){var t,n,s,i,r,a,o,u,l,d,h,c=[];if(!e._d){for(s=e,i=new Date(_.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[S]&&null==e._a[Y]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[D],Be(R(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(d=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,h=Be(R(),u,l),r=bt(i.gg,s._a[D],h.year),a=bt(i.w,h.week),null!=i.d?((o=i.d)<0||6<o)&&(d=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(d=!0)):o=u),a<1||a>N(r,u,l)?p(s)._overflowWeeks=!0:null!=d?p(s)._overflowWeekday=!0:(h=$e(r,a,o,u,l),s._a[D]=h.year,s._dayOfYear=h.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[D],n[D]),(e._dayOfYear>We(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),d=ze(i,0,e._dayOfYear),e._a[Y]=d.getUTCMonth(),e._a[S]=d.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[O]&&0===e._a[b]&&0===e._a[T]&&0===e._a[Te]&&(e._nextDay=!0,e._a[O]=0),e._d=(e._useUTC?ze:Ze).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[O]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(p(e).weekdayMismatch=!0)}}function xt(e){if(e._f===_.ISO_8601)Yt(e);else if(e._f===_.RFC_2822)Ot(e);else{e._a=[],p(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],d=l.length,h=0;h<d;h++)n=l[h],(t=(a.match(De(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&p(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?p(e).empty=!1:p(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(Se,s)&&Se[s](i,r._a,r,s)):e._strict&&!t&&p(e).unusedTokens.push(n);p(e).charsLeftOver=o-u,0<a.length&&p(e).unusedInput.push(a),e._a[O]<=12&&!0===p(e).bigHour&&0<e._a[O]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[O]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[O],e._meridiem),null!==(o=p(e).era)&&(e._a[D]=e._locale.erasConvertYear(o,e._a[D])),Tt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||P(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),k(i))return new $(_t(i));if(V(i))e._d=i;else if(y(r)){var a,o,u,l,d,h,c=e,f=!1,m=c._f.length;if(0===m)p(c).invalidFormat=!0,c._d=new Date(NaN);else{for(l=0;l<m;l++)d=0,h=!1,a=q({},c),null!=c._useUTC&&(a._useUTC=c._useUTC),a._f=c._f[l],xt(a),A(a)&&(h=!0),d=(d+=p(a).charsLeftOver)+10*p(a).unusedTokens.length,p(a).score=d,f?d<u&&(u=d,o=a):(null==u||d<u||h)&&(u=d,o=a,h)&&(f=!0);E(c,o||a)}}else if(r)xt(e);else if(g(r=(i=e)._i))i._d=new Date(_.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=Mt.exec(n._i))?n._d=new Date(+t[1]):(Yt(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid)&&(delete n._isValid,n._strict?n._isValid=!1:_.createFromInputFallback(n)))):y(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),Tt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),Tt(t)):w(r)?i._d=new Date(r):_.createFromInputFallback(i);return A(e)||(e._d=null),e}function Wt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||y(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new $(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function R(e,t,n,s){return Wt(e,t,n,s,!1)}_.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),_.ISO_8601=function(){},_.RFC_2822=function(){};me=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),_e=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Pt(e,t){var n,s;if(!(t=1===t.length&&y(t[0])?t[0]:t).length)return R();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Rt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Rt.length;for(t in e)if(c(e,t)&&(-1===x.call(Rt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Rt[n]]){if(s)return!1;parseFloat(e[Rt[n]])!==M(e[Rt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=P(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),h("Z",ve),h("ZZ",ve),v(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(ve,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+M(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(k(e)||V(e)?e:R(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),_.updateOffset(t,!1),t):R(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&this._isUTC&&0===this._offset}_.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:w(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(t=It.exec(e))?(n="-"===t[1]?-1:1,s={y:0,d:M(t[S])*n,h:M(t[O])*n,m:M(t[b])*n,s:M(t[T])*n,ms:M(Ht(1e3*t[Te]))*n}):(t=jt.exec(e))?(n="-"===t[1]?-1:1,s={y:Zt(t[2],n),M:Zt(t[3],n),w:Zt(t[4],n),d:Zt(t[5],n),h:Zt(t[6],n),m:Zt(t[7],n),s:Zt(t[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(R(s.from),R(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),n=new Ct(s),Ut(e)&&c(e,"_locale")&&(n._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(n._isValid=e._isValid),n}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,C(e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ae(e,Ce(e,"Month")+t*n),r&&Ue(e,"Date",Ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s)&&_.updateOffset(e,r||t)}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Fe=qt(1,"add"),Qe=qt(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return k(e)||V(e)||Bt(e)||w(e)||function(t){var e=y(t),n=!1;e&&(n=0===t.filter(function(e){return!w(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){var n,s;return e.date()<t.date()?-Qt(t,e):-((n=12*(t.year()-e.year())+(t.month()-e.month()))+(t-(s=e.clone().add(n,"months"))<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s)))||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=P(e))&&(this._locale=e),this)}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Ke=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e,t,n,s=[],i=[],r=[],a=[],o=this.eras(),u=0,l=o.length;u<l;++u)e=f(o[u].name),t=f(o[u].abbr),n=f(o[u].narrow),i.push(e),s.push(t),r.push(n),a.push(e),a.push(t),a.push(n);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?Be(this,s,i).year:(r=N(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),h("N",rn),h("NN",rn),h("NNN",rn),h("NNNN",function(e,t){return t.erasNameRegex(e)}),h("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),v(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?p(n).era=s:p(n).invalidEra=e}),h("y",pe),h("yy",pe),h("yyy",pe),h("yyyy",pe),h("yo",function(e,t){return t._eraYearOrdinalRegex||pe}),v(["y","yy","yyy","yyyy"],D),v(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[D]=n._locale.eraYearOrdinalParse(e,i):t[D]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),h("G",ke),h("g",ke),h("GG",n,t),h("gg",n,t),h("GGGG",ge,ce),h("gggg",ge,ce),h("GGGGG",we,fe),h("ggggg",we,fe),Oe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=M(e)}),Oe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),h("Q",de),v("Q",function(e,t){t[Y]=3*(M(e)-1)}),s("D",["DD",2],"Do","date"),h("D",n,u),h("DD",n,t),h("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),v(["D","DD"],S),v("Do",function(e,t){t[S]=M(e.match(n)[0])});ge=Re("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),h("DDD",ye),h("DDDD",he),v(["DDD","DDDD"],function(e,t,n){n._dayOfYear=M(e)}),s("m",["mm",2],0,"minute"),h("m",n,d),h("mm",n,t),v(["m","mm"],b);var ln,ce=Re("Minutes",!1),we=(s("s",["ss",2],0,"second"),h("s",n,d),h("ss",n,t),v(["s","ss"],T),Re("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),h("S",ye,de),h("SS",ye,t),h("SSS",ye,he),ln="SSSS";ln.length<=9;ln+="S")h(ln,pe);function dn(e,t){t[Te]=M(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")v(ln,dn);fe=Re("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");u=$.prototype;function hn(e){return e}u.add=Fe,u.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||R(),n=Gt(e,this).startOf("day"),n=_.calendarFormat(this,n)||"sameElse",t=t&&(a(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,R(e)))},u.clone=function(){return new $(this)},u.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=o(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:m(r)},u.endOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1;break}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.format=function(e){return e=e||(this.isUtc()?_.defaultFormatUtc:_.defaultFormat),e=re(this,e),this.localeData().postformat(e)},u.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.fromNow=function(e){return this.from(R(),e)},u.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.toNow=function(e){return this.to(R(),e)},u.get=function(e){return a(this[e=o(e)])?this[e]():this},u.invalidAt=function(){return p(this).overflow},u.isAfter=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},u.isBefore=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},u.isBetween=function(e,t,n,s){return e=k(e)?e:R(e),t=k(t)?t:R(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},u.isSame=function(e,t){var e=k(e)?e:R(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},u.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},u.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},u.isValid=function(){return A(this)},u.lang=Ke,u.locale=Xt,u.localeData=Kt,u.max=_e,u.min=me,u.parsingFlags=function(){return E({},p(this))},u.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(a(this[e=o(e)]))return this[e](t);return this},u.startOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3);break}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.subtract=Qe,u.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},u.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},u.toDate=function(){return new Date(this.valueOf())},u.toISOString=function(e){var t;return this.isValid()?(t=(e=!0!==e)?this.clone().utc():this).year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):a(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ"):null},u.inspect=function(){var e,t,n;return this.isValid()?(t="moment",e="",this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z"),t="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+n+"-MM-DD[T]HH:mm:ss.SSS"+(e+'[")]'))):"moment.invalid(/* "+this._i+" */)"},"undefined"!=typeof Symbol&&null!=Symbol.for&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=function(){return this.isValid()?this.toISOString():null},u.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},u.unix=function(){return Math.floor(this.valueOf()/1e3)},u.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},u.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},u.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},u.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},u.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},u.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-_(n[s].since).year())*e+n[s].offset;return this.year()},u.year=Pe,u.isLeapYear=function(){return be(this.year())},u.weekYear=function(e){return un.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},u.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},u.quarter=u.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},u.month=Ie,u.daysInMonth=function(){return He(this.year(),this.month())},u.week=u.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},u.isoWeek=u.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},u.weeksInYear=function(){var e=this.localeData()._week;return N(this.year(),e.dow,e.doy)},u.weeksInWeekYear=function(){var e=this.localeData()._week;return N(this.weekYear(),e.dow,e.doy)},u.isoWeeksInYear=function(){return N(this.year(),1,4)},u.isoWeeksInISOWeekYear=function(){return N(this.isoWeekYear(),1,4)},u.date=ge,u.day=u.days=function(e){var t,n,s;return this.isValid()?(t=Ce(this,"Day"),null!=e?(n=e,s=this.localeData(),e="string"!=typeof n?n:isNaN(n)?"number"==typeof(n=s.weekdaysParse(n))?n:null:parseInt(n,10),this.add(e-t,"d")):t):null!=e?this:NaN},u.weekday=function(e){var t;return this.isValid()?(t=(this.day()+7-this.localeData()._week.dow)%7,null==e?t:this.add(e-t,"d")):null!=e?this:NaN},u.isoWeekday=function(e){var t,n;return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN},u.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},u.hour=u.hours=i,u.minute=u.minutes=ce,u.second=u.seconds=we,u.millisecond=u.milliseconds=fe,u.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this},u.utc=function(e){return this.utcOffset(0,e)},u.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e)&&this.subtract(Et(this),"m"),this},u.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Me,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},u.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?R(e).utcOffset():0,(this.utcOffset()-e)%60==0)},u.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},u.isLocal=function(){return!!this.isValid()&&!this._isUTC},u.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},u.isUtc=At,u.isUTC=At,u.zoneAbbr=function(){return this._isUTC?"UTC":""},u.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},u.dates=e("dates accessor is deprecated. Use date instead.",ge),u.months=e("months accessor is deprecated. Use month instead",Ie),u.years=e("years accessor is deprecated. Use year instead",Pe),u.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),u.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var e,t;return g(this._isDSTShifted)&&(q(e={},this),(e=Nt(e))._a?(t=(e._isUTC?l:R)(e._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&M(e[a])!==M(t[a]))&&r++;return r+i}(e._a,t.toArray())):this._isDSTShifted=!1),this._isDSTShifted});d=K.prototype;function cn(e,t,n,s){var i=P(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(w(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?w(t)&&(n=t,t=void 0):(t=e,e=!1,w(n=t)&&(n=t,t=void 0)),t||"");var i,r=P(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}d.calendar=function(e,t,n){return a(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},d.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},d.invalidDate=function(){return this._invalidDate},d.ordinal=function(e){return this._ordinal.replace("%d",e)},d.preparse=hn,d.postformat=hn,d.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return a(i)?i(e,t,n,s):i.replace(/%d/i,e)},d.pastFuture=function(e,t){return a(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},d.set=function(e){var t,n;for(n in e)c(e,n)&&(a(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},d.eras=function(e,t){for(var n,s=this._eras||P("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=_(s[i].since).startOf("day"),s[i].since=n.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=_(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf();break}}return s},d.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s];break}else if(0<=[r,a,o].indexOf(e))return u[s]},d.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?_(e.since).year():_(e.since).year()+(t-e.offset)*n},d.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},d.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},d.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},d.months=function(e,t){return e?(y(this._months)?this._months:this._months[(this._months.isFormat||Ve).test(t)?"format":"standalone"])[e.month()]:y(this._months)?this._months:this._months.standalone},d.monthsShort=function(e,t){return e?(y(this._monthsShort)?this._monthsShort:this._monthsShort[Ve.test(t)?"format":"standalone"])[e.month()]:y(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},d.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))||-1!==(i=x.call(this._longMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))||-1!==(i=x.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},d.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},d.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Ge),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},d.week=function(e){return Be(e,this._week.dow,this._week.doy).week},d.firstDayOfYear=function(){return this._week.doy},d.firstDayOfWeek=function(){return this._week.dow},d.weekdays=function(e,t){return t=y(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Je(t,this._week.dow):e?t[e.day()]:t},d.weekdaysMin=function(e){return!0===e?Je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},d.weekdaysShort=function(e){return!0===e?Je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},d.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},d.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=et),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},d.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},d.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},d.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},d.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===M(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),_.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),_.langData=e("moment.langData is deprecated. Use moment.localeData instead.",P);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}de=kn("ms"),t=kn("s"),ye=kn("m"),he=kn("h"),Fe=kn("d"),_e=kn("w"),me=kn("M"),Qe=kn("Q"),i=kn("y"),ce=de;function Mn(e){return function(){return this.isValid()?this._data[e]:NaN}}var we=Mn("milliseconds"),fe=Mn("seconds"),ge=Mn("minutes"),Pe=Mn("hours"),d=Mn("days"),vn=Mn("months"),Dn=Mn("years");var Yn=Math.round,Sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function On(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),d=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||(a<=1?["m"]:a<n.m&&["mm",a])||(o<=1?["h"]:o<n.h&&["hh",o])||(u<=1?["d"]:u<n.d&&["dd",u]);return(r=(r=null!=n.w?r||(d<=1?["w"]:d<n.w&&["ww",d]):r)||(l<=1?["M"]:l<n.M&&["MM",l])||(i<=1?["y"]:["yy",i]))[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var bn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function xn(){var e,t,n,s,i,r,a,o,u,l,d;return this.isValid()?(e=bn(this._milliseconds)/1e3,t=bn(this._days),n=bn(this._months),(o=this.asSeconds())?(s=m(e/60),i=m(s/60),e%=60,s%=60,r=m(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=Tn(this._months)!==Tn(o)?"-":"",l=Tn(this._days)!==Tn(o)?"-":"",d=Tn(this._milliseconds)!==Tn(o)?"-":"",(o<0?"-":"")+"P"+(r?u+r+"Y":"")+(n?u+n+"M":"")+(t?l+t+"D":"")+(i||s||e?"T":"")+(i?d+i+"H":"")+(s?d+s+"M":"")+(e?d+a+"S":"")):"P0D"):this.localeData().invalidDate()}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=o(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=de,U.asSeconds=t,U.asMinutes=ye,U.asHours=he,U.asDays=Fe,U.asWeeks=_e,U.asMonths=me,U.asQuarters=Qe,U.asYears=i,U.valueOf=ce,U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=m(e/1e3),s.seconds=e%60,e=m(e/60),s.minutes=e%60,e=m(e/60),s.hours=e%24,t+=m(e/24),n+=e=m(wn(t)),t-=gn(pn(e)),e=m(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=o(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=we,U.seconds=fe,U.minutes=ge,U.hours=Pe,U.days=d,U.weeks=function(){return m(this.days()/7)},U.months=vn,U.years=Dn,U.humanize=function(e,t){var n,s;return this.isValid()?(n=!1,s=Sn,"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},Sn,t),null!=t.s)&&null==t.ss&&(s.ss=t.s-1),e=this.localeData(),t=On(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)):this.localeData().invalidDate()},U.toISOString=xn,U.toString=xn,U.toJSON=xn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xn),U.lang=Ke,s("X",0,0,"unix"),s("x",0,0,"valueOf"),h("x",ke),h("X",/[+-]?\d+(\.\d{1,3})?/),v("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),v("x",function(e,t,n){n._d=new Date(M(e))}),_.version="2.30.1",H=R,_.fn=u,_.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},_.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},_.now=function(){return Date.now?Date.now():+new Date},_.utc=l,_.unix=function(e){return R(1e3*e)},_.months=function(e,t){return fn(e,t,"months")},_.isDate=V,_.locale=ft,_.invalid=I,_.duration=C,_.isMoment=k,_.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},_.parseZone=function(){return R.apply(null,arguments).parseZone()},_.localeData=P,_.isDuration=Ut,_.monthsShort=function(e,t){return fn(e,t,"monthsShort")},_.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},_.defineLocale=mt,_.updateLocale=function(e,t){var n,s;return null!=t?(s=ut,null!=W[e]&&null!=W[e].parentLocale?W[e].set(X(W[e]._config,t)):(t=X(s=null!=(n=ct(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=W[e],W[e]=s),ft(e)):null!=W[e]&&(null!=W[e].parentLocale?(W[e]=W[e].parentLocale,e===ft()&&ft(e)):null!=W[e]&&delete W[e]),W[e]},_.locales=function(){return ee(W)},_.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},_.normalizeUnits=o,_.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},_.relativeTimeThreshold=function(e,t){return void 0!==Sn[e]&&(void 0===t?Sn[e]:(Sn[e]=t,"s"===e&&(Sn.ss=t-1),!0))},_.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},_.prototype=u,_.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},_});
 //# sourceMappingURL=moment.min.js.map
\ No newline at end of file
index bd5769912bd09de2843293d1e05b78b1ea8326dd..9ec582ab836ea97f1f9b2de1697d74346adedd1b 100644 (file)
@@ -1,3 +1,3 @@
-(function(root,factory){if(typeof define==="function"&&define.amd){define(["d3"],function(d3){return root.Rickshaw=factory(d3)})}else if(typeof exports==="object"){module.exports=factory(require("d3"))}else{root.Rickshaw=factory(d3)}})(this,function(d3){var Rickshaw={namespace:function(namespace,obj){var parts=namespace.split(".");var parent=Rickshaw;for(var i=1,length=parts.length;i<length;i++){var currentPart=parts[i];parent[currentPart]=parent[currentPart]||{};parent=parent[currentPart]}return parent},keys:function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},extend:function(destination,source){for(var property in source){destination[property]=source[property]}return destination},clone:function(obj){return JSON.parse(JSON.stringify(obj))}};(function(globalContext){var _toString=Object.prototype.toString,NULL_TYPE="Null",UNDEFINED_TYPE="Undefined",BOOLEAN_TYPE="Boolean",NUMBER_TYPE="Number",STRING_TYPE="String",OBJECT_TYPE="Object",FUNCTION_CLASS="[object Function]";function isFunction(object){return _toString.call(object)===FUNCTION_CLASS}function extend(destination,source){for(var property in source)if(source.hasOwnProperty(property))destination[property]=source[property];return destination}function keys(object){if(Type(object)!==OBJECT_TYPE){throw new TypeError}var results=[];for(var property in object){if(object.hasOwnProperty(property)){results.push(property)}}return results}function Type(o){switch(o){case null:return NULL_TYPE;case void 0:return UNDEFINED_TYPE}var type=typeof o;switch(type){case"boolean":return BOOLEAN_TYPE;case"number":return NUMBER_TYPE;case"string":return STRING_TYPE}return OBJECT_TYPE}function isUndefined(object){return typeof object==="undefined"}var slice=Array.prototype.slice;function argumentNames(fn){var names=fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}function wrap(fn,wrapper){var __method=fn;return function(){var a=update([bind(__method,this)],arguments);return wrapper.apply(this,a)}}function update(array,args){var arrayLength=array.length,length=args.length;while(length--)array[arrayLength+length]=args[length];return array}function merge(array,args){array=slice.call(array,0);return update(array,args)}function bind(fn,context){if(arguments.length<2&&isUndefined(arguments[0]))return this;var __method=fn,args=slice.call(arguments,2);return function(){var a=merge(args,arguments);return __method.apply(context,a)}}var emptyFunction=function(){};var Class=function(){var IS_DONTENUM_BUGGY=function(){for(var p in{toString:1}){if(p==="toString")return false}return true}();function subclass(){}function create(){var parent=null,properties=[].slice.apply(arguments);if(isFunction(properties[0]))parent=properties.shift();function klass(){this.initialize.apply(this,arguments)}extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;try{parent.subclasses.push(klass)}catch(e){}}for(var i=0,length=properties.length;i<length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=emptyFunction;klass.prototype.constructor=klass;return klass}function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype,properties=keys(source);if(IS_DONTENUM_BUGGY){if(source.toString!=Object.prototype.toString)properties.push("toString");if(source.valueOf!=Object.prototype.valueOf)properties.push("valueOf")}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&isFunction(value)&&argumentNames(value)[0]=="$super"){var method=value;value=wrap(function(m){return function(){return ancestor[m].apply(this,arguments)}}(property),method);value.valueOf=bind(method.valueOf,method);value.toString=bind(method.toString,method)}this.prototype[property]=value}return this}return{create:create,Methods:{addMethods:addMethods}}}();if(globalContext.exports){globalContext.exports.Class=Class}else{globalContext.Class=Class}})(Rickshaw);Rickshaw.namespace("Rickshaw.Compat.ClassList");Rickshaw.Compat.ClassList=function(){if(typeof document!=="undefined"&&!("classList"in document.createElement("a"))){(function(view){"use strict";var classListProp="classList",protoProp="prototype",elemCtrProto=(view.HTMLElement||view.Element)[protoProp],objCtr=Object,strTrim=String[protoProp].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[protoProp].indexOf||function(item){var i=0,len=this.length;for(;i<len;i++){if(i in this&&this[i]===item){return i}}return-1},DOMEx=function(type,message){this.name=type;this.code=DOMException[type];this.message=message},checkTokenAndGetIndex=function(classList,token){if(token===""){throw new DOMEx("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(token)){throw new DOMEx("INVALID_CHARACTER_ERR","String contains an invalid character")}return arrIndexOf.call(classList,token)},ClassList=function(elem){var trimmedClasses=strTrim.call(elem.className),classes=trimmedClasses?trimmedClasses.split(/\s+/):[],i=0,len=classes.length;for(;i<len;i++){this.push(classes[i])}this._updateClassName=function(){elem.className=this.toString()}},classListProto=ClassList[protoProp]=[],classListGetter=function(){return new ClassList(this)};DOMEx[protoProp]=Error[protoProp];classListProto.item=function(i){return this[i]||null};classListProto.contains=function(token){token+="";return checkTokenAndGetIndex(this,token)!==-1};classListProto.add=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.push(token);this._updateClassName()}};classListProto.remove=function(token){token+="";var index=checkTokenAndGetIndex(this,token);if(index!==-1){this.splice(index,1);this._updateClassName()}};classListProto.toggle=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.add(token)}else{this.remove(token)}};classListProto.toString=function(){return this.join(" ")};if(objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:true,configurable:true};try{objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}catch(ex){if(ex.number===-2146823252){classListPropDesc.enumerable=false;objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}}}else if(objCtr[protoProp].__defineGetter__){elemCtrProto.__defineGetter__(classListProp,classListGetter)}})(window)}};if(typeof RICKSHAW_NO_COMPAT!=="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT==="undefined"){new Rickshaw.Compat.ClassList}Rickshaw.namespace("Rickshaw.Graph");Rickshaw.Graph=function(args){var self=this;this.initialize=function(args){if(!args.element)throw"Rickshaw.Graph needs a reference to an element";if(args.element.nodeType!==1)throw"Rickshaw.Graph element was defined but not an HTML element";this.element=args.element;this.series=args.series;this.window={};this.updateCallbacks=[];this.configureCallbacks=[];this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined,preserve:false,xScale:undefined,yScale:undefined,stack:true};this._loadRenderers();this.configure(args);this.validateSeries(args.series);this.series.active=function(){return self.series.filter(function(s){return!s.disabled})};this.setSize({width:args.width,height:args.height});this.element.classList.add("rickshaw_graph");this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);this.discoverRange()};this._loadRenderers=function(){for(var name in Rickshaw.Graph.Renderer){if(!name||!Rickshaw.Graph.Renderer.hasOwnProperty(name))continue;var r=Rickshaw.Graph.Renderer[name];if(!r||!r.prototype||!r.prototype.render)continue;self.registerRenderer(new r({graph:self}))}};this.validateSeries=function(series){if(!Array.isArray(series)&&!(series instanceof Rickshaw.Series)){var seriesSignature=Object.prototype.toString.apply(series);throw"series is not an array: "+seriesSignature}var pointsCount;series.forEach(function(s){if(!(s instanceof Object)){throw"series element is not an object: "+s}if(!s.data){throw"series has no data: "+JSON.stringify(s)}if(!Array.isArray(s.data)){throw"series data is not an array: "+JSON.stringify(s.data)}if(s.data.length>0){var x=s.data[0].x;var y=s.data[0].y;if(typeof x!="number"||typeof y!="number"&&y!==null){throw"x and y properties of points should be numbers instead of "+typeof x+" and "+typeof y}}if(s.data.length>=3){if(s.data[2].x<s.data[1].x||s.data[1].x<s.data[0].x||s.data[s.data.length-1].x<s.data[0].x){throw"series data needs to be sorted on x values for series name: "+s.name}}},this)};this.dataDomain=function(){var data=this.series.map(function(s){return s.data});var min=d3.min(data.map(function(d){return d[0].x}));var max=d3.max(data.map(function(d){return d[d.length-1].x}));return[min,max]};this.discoverRange=function(){var domain=this.renderer.domain();this.x=(this.xScale||d3.scale.linear()).copy().domain(domain.x).range([0,this.width]);this.y=(this.yScale||d3.scale.linear()).copy().domain(domain.y).range([this.height,0]);this.x.magnitude=d3.scale.linear().domain([domain.x[0]-domain.x[0],domain.x[1]-domain.x[0]]).range([0,this.width]);this.y.magnitude=d3.scale.linear().domain([domain.y[0]-domain.y[0],domain.y[1]-domain.y[0]]).range([0,this.height])};this.render=function(){var stackedData=this.stackData();this.discoverRange();this.renderer.render();this.updateCallbacks.forEach(function(callback){callback()})};this.update=this.render;this.stackData=function(){var data=this.series.active().map(function(d){return d.data}).map(function(d){return d.filter(function(d){return this._slice(d)},this)},this);var preserve=this.preserve;if(!preserve){this.series.forEach(function(series){if(series.scale){preserve=true}})}data=preserve?Rickshaw.clone(data):data;this.series.active().forEach(function(series,index){if(series.scale){var seriesData=data[index];if(seriesData){seriesData.forEach(function(d){d.y=series.scale(d.y)})}}});this.stackData.hooks.data.forEach(function(entry){data=entry.f.apply(self,[data])});var stackedData;if(!this.renderer.unstack){this._validateStackable();var layout=d3.layout.stack();layout.offset(self.offset);stackedData=layout(data)}stackedData=stackedData||data;if(this.renderer.unstack){stackedData.forEach(function(seriesData){seriesData.forEach(function(d){d.y0=d.y0===undefined?0:d.y0})})}this.stackData.hooks.after.forEach(function(entry){stackedData=entry.f.apply(self,[data])});var i=0;this.series.forEach(function(series){if(series.disabled)return;series.stack=stackedData[i++]});this.stackedData=stackedData;return stackedData};this._validateStackable=function(){var series=this.series;var pointsCount;series.forEach(function(s){pointsCount=pointsCount||s.data.length;if(pointsCount&&s.data.length!=pointsCount){throw"stacked series cannot have differing numbers of points: "+pointsCount+" vs "+s.data.length+"; see Rickshaw.Series.fill()"}},this)};this.stackData.hooks={data:[],after:[]};this._slice=function(d){if(this.window.xMin||this.window.xMax){var isInRange=true;if(this.window.xMin&&d.x<this.window.xMin)isInRange=false;if(this.window.xMax&&d.x>this.window.xMax)isInRange=false;return isInRange}return true};this.onUpdate=function(callback){this.updateCallbacks.push(callback)};this.onConfigure=function(callback){this.configureCallbacks.push(callback)};this.registerRenderer=function(renderer){this._renderers=this._renderers||{};this._renderers[renderer.name]=renderer};this.configure=function(args){this.config=this.config||{};if(args.width||args.height){this.setSize(args)}Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this?this[k]:this.defaults[k]},this);Rickshaw.keys(this.config).forEach(function(k){this[k]=this.config[k]},this);if("stack"in args)args.unstack=!args.stack;var renderer=args.renderer||this.renderer&&this.renderer.name||"stack";this.setRenderer(renderer,args);this.configureCallbacks.forEach(function(callback){callback(args)})};this.setRenderer=function(r,args){if(typeof r=="function"){this.renderer=new r({graph:self});this.registerRenderer(this.renderer)}else{if(!this._renderers[r]){throw"couldn't find renderer "+r}this.renderer=this._renderers[r]}if(typeof args=="object"){this.renderer.configure(args)}};this.setSize=function(args){args=args||{};if(typeof window!==undefined){var style=window.getComputedStyle(this.element,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);var elementHeight=parseInt(style.getPropertyValue("height"),10)}this.width=args.width||elementWidth||400;this.height=args.height||elementHeight||250;this.vis&&this.vis.attr("width",this.width).attr("height",this.height)};this.initialize(args)};Rickshaw.namespace("Rickshaw.Fixtures.Color");Rickshaw.Fixtures.Color=function(){this.schemes={};this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse();this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"];this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"];this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse();this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"};this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse();this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"];this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]};Rickshaw.namespace("Rickshaw.Fixtures.RandomData");Rickshaw.Fixtures.RandomData=function(timeInterval){var addData;timeInterval=timeInterval||1;var lastRandomValue=200;var timeBase=Math.floor((new Date).getTime()/1e3);this.addData=function(data){var randomValue=Math.random()*100+15+lastRandomValue;var index=data[0].length;var counter=1;data.forEach(function(series){var randomVariance=Math.random()*20;var v=randomValue/25+counter++ +(Math.cos(index*counter*11/960)+2)*15+(Math.cos(index/7)+2)*7+(Math.cos(index/17)+2)*1;series.push({x:index*timeInterval+timeBase,y:v+randomVariance})});lastRandomValue=randomValue*.85};this.removeData=function(data){data.forEach(function(series){series.shift()});timeBase+=timeInterval}};Rickshaw.namespace("Rickshaw.Fixtures.Time");Rickshaw.Fixtures.Time=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getUTCFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getUTCFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getUTCMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getUTCDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getUTCMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getUTCMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toUTCString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year;if(unit.name=="month"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),date.getUTCMonth())/1e3;if(floor==time)return time;year=date.getUTCFullYear();var month=date.getUTCMonth();if(month==11){month=0;year=year+1}else{month+=1}return Date.UTC(year,month)/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),0)/1e3;if(floor==time)return time;year=date.getUTCFullYear()+1;return Date.UTC(year,0)/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Time.Local");Rickshaw.Fixtures.Time.Local=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year;if(unit.name=="day"){var nearFuture=new Date((time+unit.seconds-1)*1e3);var rounded=new Date(0);rounded.setMilliseconds(0);rounded.setSeconds(0);rounded.setMinutes(0);rounded.setHours(0);rounded.setDate(nearFuture.getDate());rounded.setMonth(nearFuture.getMonth());rounded.setFullYear(nearFuture.getFullYear());return rounded.getTime()/1e3}if(unit.name=="month"){date=new Date(time*1e3);floor=new Date(date.getFullYear(),date.getMonth()).getTime()/1e3;if(floor==time)return time;year=date.getFullYear();var month=date.getMonth();if(month==11){month=0;year=year+1}else{month+=1}return new Date(year,month).getTime()/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=new Date(date.getUTCFullYear(),0).getTime()/1e3;if(floor==time)return time;year=date.getFullYear()+1;return new Date(year,0).getTime()/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Number");Rickshaw.Fixtures.Number.formatKMBT=function(y){var abs_y=Math.abs(y);if(abs_y>=1e12){return y/1e12+"T"}else if(abs_y>=1e9){return y/1e9+"B"}else if(abs_y>=1e6){return y/1e6+"M"}else if(abs_y>=1e3){return y/1e3+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y===0){return""}else{return y}};Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(y){var abs_y=Math.abs(y);if(abs_y>=0x4000000000000){return y/0x4000000000000+"P"}else if(abs_y>=1099511627776){return y/1099511627776+"T"}else if(abs_y>=1073741824){return y/1073741824+"G"}else if(abs_y>=1048576){return y/1048576+"M"}else if(abs_y>=1024){return y/1024+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y===0){return""}else{return y}};Rickshaw.namespace("Rickshaw.Color.Palette");Rickshaw.Color.Palette=function(args){var color=new Rickshaw.Fixtures.Color;args=args||{};this.schemes={};this.scheme=color.schemes[args.scheme]||args.scheme||color.schemes.colorwheel;this.runningIndex=0;this.generatorIndex=0;if(args.interpolatedStopCount){var schemeCount=this.scheme.length-1;var i,j,scheme=[];for(i=0;i<schemeCount;i++){scheme.push(this.scheme[i]);var generator=d3.interpolateHsl(this.scheme[i],this.scheme[i+1]);for(j=1;j<args.interpolatedStopCount;j++){scheme.push(generator(1/args.interpolatedStopCount*j))}}scheme.push(this.scheme[this.scheme.length-1]);this.scheme=scheme}this.rotateCount=this.scheme.length;this.color=function(key){return this.scheme[key]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"};this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var color;if(this.generatorIndex==this.rotateCount*2-1){color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5);this.generatorIndex=0;this.rotateCount*=2}else{color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5);this.generatorIndex++}this.scheme.push(color);return color}};Rickshaw.namespace("Rickshaw.Graph.Ajax");Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(args){this.dataURL=args.dataURL;this.onData=args.onData||function(d){return d};this.onComplete=args.onComplete||function(){};this.onError=args.onError||function(){};this.args=args;this.request()},request:function(){jQuery.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL);this.onError(this)},success:function(data,status){data=this.onData(data);this.args.series=this._splice({data:data,series:this.args.series});this.graph=this.graph||new Rickshaw.Graph(this.args);this.graph.render();this.onComplete(this)},_splice:function(args){var data=args.data;var series=args.series;if(!args.series)return data;series.forEach(function(s){var seriesKey=s.key||s.name;if(!seriesKey)throw"series needs a key or a name";data.forEach(function(d){var dataKey=d.key||d.name;if(!dataKey)throw"data needs a key or a name";if(seriesKey==dataKey){var properties=["color","name","data"];properties.forEach(function(p){if(d[p])s[p]=d[p]})}})});return series}});Rickshaw.namespace("Rickshaw.Graph.Annotate");Rickshaw.Graph.Annotate=function(args){var graph=this.graph=args.graph;this.elements={timeline:args.element};var self=this;this.data={};this.elements.timeline.classList.add("rickshaw_annotation_timeline");this.add=function(time,content,end_time){self.data[time]=self.data[time]||{boxes:[]};self.data[time].boxes.push({content:content,end:end_time})};this.update=function(){Rickshaw.keys(self.data).forEach(function(time){var annotation=self.data[time];var left=self.graph.x(time);if(left<0||left>self.graph.x.range()[1]){if(annotation.element){annotation.line.classList.add("offscreen");annotation.element.style.display="none"}annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.add("offscreen")});return}if(!annotation.element){var element=annotation.element=document.createElement("div");element.classList.add("annotation");this.elements.timeline.appendChild(element);element.addEventListener("click",function(e){element.classList.toggle("active");annotation.line.classList.toggle("active");annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.toggle("active")})},false)}annotation.element.style.left=left+"px";annotation.element.style.display="block";annotation.boxes.forEach(function(box){var element=box.element;if(!element){element=box.element=document.createElement("div");element.classList.add("content");element.innerHTML=box.content;annotation.element.appendChild(element);annotation.line=document.createElement("div");annotation.line.classList.add("annotation_line");self.graph.element.appendChild(annotation.line);if(box.end){box.rangeElement=document.createElement("div");box.rangeElement.classList.add("annotation_range");self.graph.element.appendChild(box.rangeElement)}}if(box.end){var annotationRangeStart=left;var annotationRangeEnd=Math.min(self.graph.x(box.end),self.graph.x.range()[1]);if(annotationRangeStart>annotationRangeEnd){annotationRangeEnd=left;annotationRangeStart=Math.max(self.graph.x(box.end),self.graph.x.range()[0])}var annotationRangeWidth=annotationRangeEnd-annotationRangeStart;box.rangeElement.style.left=annotationRangeStart+"px";box.rangeElement.style.width=annotationRangeWidth+"px";box.rangeElement.classList.remove("offscreen")}annotation.line.classList.remove("offscreen");annotation.line.style.left=left+"px"})},this)};this.graph.onUpdate(function(){self.update()})};Rickshaw.namespace("Rickshaw.Graph.Axis.Time");Rickshaw.Graph.Axis.Time=function(args){var self=this;this.graph=args.graph;this.elements=[];this.ticksTreatment=args.ticksTreatment||"plain";this.fixedTimeUnit=args.timeUnit;var time=args.timeFixture||new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var unit;var units=time.units;var domain=this.graph.x.domain();var rangeSeconds=domain[1]-domain[0];units.forEach(function(u){if(Math.floor(rangeSeconds/u.seconds)>=2){unit=unit||u}});return unit||time.units[time.units.length-1]};this.tickOffsets=function(){var domain=this.graph.x.domain();var unit=this.fixedTimeUnit||this.appropriateTimeUnit();var count=Math.ceil((domain[1]-domain[0])/unit.seconds);var runningTick=domain[0];var offsets=[];for(var i=0;i<count;i++){var tickValue=time.ceil(runningTick,unit);runningTick=tickValue+unit.seconds/2;offsets.push({value:tickValue,unit:unit})}return offsets};this.render=function(){this.elements.forEach(function(e){e.parentNode.removeChild(e)});this.elements=[];var offsets=this.tickOffsets();offsets.forEach(function(o){if(self.graph.x(o.value)>self.graph.x.range()[1])return;var element=document.createElement("div");element.style.left=self.graph.x(o.value)+"px";element.classList.add("x_tick");element.classList.add(self.ticksTreatment);var title=document.createElement("div");title.classList.add("title");title.innerHTML=o.unit.formatter(new Date(o.value*1e3));element.appendChild(title);self.graph.element.appendChild(element);self.elements.push(element)})};this.graph.onUpdate(function(){self.render()})};Rickshaw.namespace("Rickshaw.Graph.Axis.X");Rickshaw.Graph.Axis.X=function(args){var self=this;var berthRate=.1;this.initialize=function(args){this.graph=args.graph;this.orientation=args.orientation||"top";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";if(args.element){this.element=args.element;this._discoverSize(args.element,args);this.vis=d3.select(args.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}this.graph.onUpdate(function(){self.render()})};this.setSize=function(args){args=args||{};if(!this.element)return;this._discoverSize(this.element.parentNode,args);this.vis.attr("height",this.height).attr("width",this.width*(1+berthRate));var berth=Math.floor(this.width*berthRate/2);this.element.style.left=-1*berth+"px"};this.render=function(){if(this._renderWidth!==undefined&&this.graph.width!==this._renderWidth)this.setSize({auto:true});var axis=d3.svg.axis().scale(this.graph.x).orient(this.orientation);axis.tickFormat(args.tickFormat||function(x){return x});if(this.tickValues)axis.tickValues(this.tickValues);this.ticks=this.staticTicks||Math.floor(this.graph.width/this.pixelsPerTick);var berth=Math.floor(this.width*berthRate/2)||0;var transform;if(this.orientation=="top"){var yOffset=this.height||this.graph.height;transform="translate("+berth+","+yOffset+")"}else{transform="translate("+berth+", 0)"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var gridSize=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-x-value",this.textContent)});this._renderHeight=this.graph.height};this._discoverSize=function(element,args){if(typeof window!=="undefined"){var style=window.getComputedStyle(element,null);var elementHeight=parseInt(style.getPropertyValue("height"),10);if(!args.auto){var elementWidth=parseInt(style.getPropertyValue("width"),10)}}this.width=(args.width||elementWidth||this.graph.width)*(1+berthRate);this.height=args.height||elementHeight||40};this.initialize(args)};Rickshaw.namespace("Rickshaw.Graph.Axis.Y");Rickshaw.Graph.Axis.Y=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.orientation=args.orientation||"right";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";this.tickFormat=args.tickFormat||function(y){return y};this.berthRate=.1;if(args.element){this.element=args.element;this.vis=d3.select(args.element).append("svg:svg").attr("class","rickshaw_graph y_axis");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}var self=this;this.graph.onUpdate(function(){self.render()})},setSize:function(args){args=args||{};if(!this.element)return;if(typeof window!=="undefined"){var style=window.getComputedStyle(this.element.parentNode,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);if(!args.auto){var elementHeight=parseInt(style.getPropertyValue("height"),10)}}this.width=args.width||elementWidth||this.graph.width*this.berthRate;this.height=args.height||elementHeight||this.graph.height;this.vis.attr("width",this.width).attr("height",this.height*(1+this.berthRate));var berth=this.height*this.berthRate;if(this.orientation=="left"){this.element.style.top=-1*berth+"px"}},render:function(){if(this._renderHeight!==undefined&&this.graph.height!==this._renderHeight)this.setSize({auto:true});this.ticks=this.staticTicks||Math.floor(this.graph.height/this.pixelsPerTick);var axis=this._drawAxis(this.graph.y);this._drawGrid(axis);this._renderHeight=this.graph.height},_drawAxis:function(scale){var axis=d3.svg.axis().scale(scale).orient(this.orientation);axis.tickFormat(this.tickFormat);if(this.tickValues)axis.tickValues(this.tickValues);if(this.orientation=="left"){var berth=this.height*this.berthRate;var transform="translate("+this.width+", "+berth+")"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));return axis},_drawGrid:function(axis){var gridSize=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)
-})}});Rickshaw.namespace("Rickshaw.Graph.Axis.Y.Scaled");Rickshaw.Graph.Axis.Y.Scaled=Rickshaw.Class.create(Rickshaw.Graph.Axis.Y,{initialize:function($super,args){if(typeof args.scale==="undefined"){throw new Error("Scaled requires scale")}this.scale=args.scale;if(typeof args.grid==="undefined"){this.grid=true}else{this.grid=args.grid}$super(args)},_drawAxis:function($super,scale){var domain=this.scale.domain();var renderDomain=this.graph.renderer.domain().y;var extents=[Math.min.apply(Math,domain),Math.max.apply(Math,domain)];var extentMap=d3.scale.linear().domain([0,1]).range(extents);var adjExtents=[extentMap(renderDomain[0]),extentMap(renderDomain[1])];var adjustment=d3.scale.linear().domain(extents).range(adjExtents);var adjustedScale=this.scale.copy().domain(domain.map(adjustment)).range(scale.range());return $super(adjustedScale)},_drawGrid:function($super,axis){if(this.grid){$super(axis)}}});Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;var colorSafe={};var activeLine=null;var disabledColor=args.disabledColor||function(seriesColor){return d3.interpolateRgb(seriesColor,d3.rgb("#d8d8d8"))(.8).toString()};this.addHighlightEvents=function(l){l.element.addEventListener("mouseover",function(e){if(activeLine)return;else activeLine=l;self.legend.lines.forEach(function(line){if(l===line){if(self.graph.renderer.unstack&&(line.series.renderer?line.series.renderer.unstack:true)){var seriesIndex=self.graph.series.indexOf(line.series);line.originalIndex=seriesIndex;var series=self.graph.series.splice(seriesIndex,1)[0];self.graph.series.push(series)}return}colorSafe[line.series.name]=colorSafe[line.series.name]||line.series.color;line.series.color=disabledColor(line.series.color)});self.graph.update()},false);l.element.addEventListener("mouseout",function(e){if(!activeLine)return;else activeLine=null;self.legend.lines.forEach(function(line){if(l===line&&line.hasOwnProperty("originalIndex")){var series=self.graph.series.pop();self.graph.series.splice(line.originalIndex,0,series);delete line.originalIndex}if(colorSafe[line.series.name]){line.series.color=colorSafe[line.series.name]}});self.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(l){self.addHighlightEvents(l)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;if(typeof window.jQuery=="undefined"){throw"couldn't find jQuery at window.jQuery"}if(typeof window.jQuery.ui=="undefined"){throw"couldn't find jQuery UI at window.jQuery.ui"}jQuery(function(){jQuery(self.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(event,ui){var series=[];jQuery(self.legend.list).find("li").each(function(index,item){if(!item.series)return;series.push(item.series)});for(var i=self.graph.series.length-1;i>=0;i--){self.graph.series[i]=series.shift()}self.graph.update()}});jQuery(self.legend.list).disableSelection()});this.graph.onUpdate(function(){var h=window.getComputedStyle(self.legend.element).height;self.legend.element.style.height=h})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;this.addAnchor=function(line){var anchor=document.createElement("a");anchor.innerHTML="&#10004;";anchor.classList.add("action");line.element.insertBefore(anchor,line.element.firstChild);anchor.onclick=function(e){if(line.series.disabled){line.series.enable();line.element.classList.remove("disabled")}else{if(this.graph.series.filter(function(s){return!s.disabled}).length<=1)return;line.series.disable();line.element.classList.add("disabled")}self.graph.update()}.bind(this);var label=line.element.getElementsByTagName("span")[0];label.onclick=function(e){var disableAllOtherLines=line.series.disabled;if(!disableAllOtherLines){for(var i=0;i<self.legend.lines.length;i++){var l=self.legend.lines[i];if(line.series===l.series){}else if(l.series.disabled){}else{disableAllOtherLines=true;break}}}if(disableAllOtherLines){line.series.enable();line.element.classList.remove("disabled");self.legend.lines.forEach(function(l){if(line.series===l.series){}else{l.series.disable();l.element.classList.add("disabled")}})}else{self.legend.lines.forEach(function(l){l.series.enable();l.element.classList.remove("disabled")})}self.graph.update()}};if(this.legend){var $=jQuery;if(typeof $!="undefined"&&$(this.legend.list).sortable){$(this.legend.list).sortable({start:function(event,ui){ui.item.bind("no.onclick",function(event){event.preventDefault()})},stop:function(event,ui){setTimeout(function(){ui.item.unbind("no.onclick")},250)}})}this.legend.lines.forEach(function(l){self.addAnchor(l)})}this._addBehavior=function(){this.graph.series.forEach(function(s){s.disable=function(){if(self.graph.series.length<=1){throw"only one series left"}s.disabled=true};s.enable=function(){s.disabled=false}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(args){var graph=this.graph=args.graph;this.xFormatter=args.xFormatter||function(x){return new Date(x*1e3).toUTCString()};this.yFormatter=args.yFormatter||function(y){return y===null?y:y.toFixed(2)};var element=this.element=document.createElement("div");element.className="detail";this.visible=true;graph.element.appendChild(element);this.lastEvent=null;this._addListeners();this.onShow=args.onShow;this.onHide=args.onHide;this.onRender=args.onRender;this.formatter=args.formatter||this.formatter},formatter:function(series,x,y,formattedX,formattedY,d){return series.name+":&nbsp;"+formattedY},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect|circle)$/))return;var graph=this.graph;var eventX=e.offsetX||e.layerX;var eventY=e.offsetY||e.layerY;var j=0;var points=[];var nearestPoint;this.graph.series.active().forEach(function(series){var data=this.graph.stackedData[j++];if(!data.length)return;var domainX=graph.x.invert(eventX);var domainIndexScale=d3.scale.linear().domain([data[0].x,data.slice(-1)[0].x]).range([0,data.length-1]);var approximateIndex=Math.round(domainIndexScale(domainX));if(approximateIndex==data.length-1)approximateIndex--;var dataIndex=Math.min(approximateIndex||0,data.length-1);for(var i=approximateIndex;i<data.length-1;){if(!data[i]||!data[i+1])break;if(data[i].x<=domainX&&data[i+1].x>domainX){dataIndex=Math.abs(domainX-data[i].x)<Math.abs(domainX-data[i+1].x)?i:i+1;break}if(data[i+1].x<=domainX){i++}else{i--}}if(dataIndex<0)dataIndex=0;var value=data[dataIndex];var distance=Math.sqrt(Math.pow(Math.abs(graph.x(value.x)-eventX),2)+Math.pow(Math.abs(graph.y(value.y+value.y0)-eventY),2));var xFormatter=series.xFormatter||this.xFormatter;var yFormatter=series.yFormatter||this.yFormatter;var point={formattedXValue:xFormatter(value.x),formattedYValue:yFormatter(series.scale?series.scale.invert(value.y):value.y),series:series,value:value,distance:distance,order:j,name:series.name};if(!nearestPoint||distance<nearestPoint.distance){nearestPoint=point}points.push(point)},this);if(!nearestPoint)return;nearestPoint.active=true;var domainX=nearestPoint.value.x;var formattedXValue=nearestPoint.formattedXValue;this.element.innerHTML="";this.element.style.left=graph.x(domainX)+"px";this.visible&&this.render({points:points,detail:points,mouseX:eventX,mouseY:eventY,formattedXValue:formattedXValue,domainX:domainX})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(args){var graph=this.graph;var points=args.points;var point=points.filter(function(p){return p.active}).shift();if(point.value.y===null)return;var formattedXValue=point.formattedXValue;var formattedYValue=point.formattedYValue;this.element.innerHTML="";this.element.style.left=graph.x(point.value.x)+"px";var xLabel=document.createElement("div");xLabel.className="x_label";xLabel.innerHTML=formattedXValue;this.element.appendChild(xLabel);var item=document.createElement("div");item.className="item";var series=point.series;var actualY=series.scale?series.scale.invert(point.value.y):point.value.y;item.innerHTML=this.formatter(series,point.value.x,actualY,formattedXValue,formattedYValue,point);item.style.top=this.graph.y(point.value.y0+point.value.y)+"px";this.element.appendChild(item);var dot=document.createElement("div");dot.className="dot";dot.style.top=item.style.top;dot.style.borderColor=series.color;this.element.appendChild(dot);if(point.active){item.classList.add("active");dot.classList.add("active")}var alignables=[xLabel,item];alignables.forEach(function(el){el.classList.add("left")});this.show();var leftAlignError=this._calcLayoutError(alignables);if(leftAlignError>0){alignables.forEach(function(el){el.classList.remove("left");el.classList.add("right")});var rightAlignError=this._calcLayoutError(alignables);if(rightAlignError>leftAlignError){alignables.forEach(function(el){el.classList.remove("right");el.classList.add("left")})}}if(typeof this.onRender=="function"){this.onRender(args)}},_calcLayoutError:function(alignables){var parentRect=this.element.parentNode.getBoundingClientRect();var error=0;var alignRight=alignables.forEach(function(el){var rect=el.getBoundingClientRect();if(!rect.width){return}if(rect.right>parentRect.right){error+=rect.right-parentRect.right}if(rect.left<parentRect.left){error+=parentRect.left-rect.left}});return error},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(e){this.visible=true;this.update(e)}.bind(this),false);this.graph.onUpdate(function(){this.update()}.bind(this));this.graph.element.addEventListener("mouseout",function(e){if(e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this),false)}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){jQuery.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=Rickshaw.Class.create({className:"rickshaw_legend",initialize:function(args){this.element=args.element;this.graph=args.graph;this.naturalOrder=args.naturalOrder;this.element.classList.add(this.className);this.list=document.createElement("ul");this.element.appendChild(this.list);this.render();this.graph.onUpdate(function(){})},render:function(){var self=this;while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.lines=[];var series=this.graph.series.map(function(s){return s});if(!this.naturalOrder){series=series.reverse()}series.forEach(function(s){self.addLine(s)})},addLine:function(series){var line=document.createElement("li");line.className="line";if(series.disabled){line.className+=" disabled"}if(series.className){d3.select(line).classed(series.className,true)}var swatch=document.createElement("div");swatch.className="swatch";swatch.style.backgroundColor=series.color;line.appendChild(swatch);var label=document.createElement("span");label.className="label";label.innerHTML=series.name;line.appendChild(label);this.list.appendChild(line);line.series=series;if(series.noLegend){line.style.display="none"}var _line={element:line,series:series};if(this.shelving){this.shelving.addAnchor(_line);this.shelving.updateBehaviour()}if(this.highlighter){this.highlighter.addHighlightEvents(_line)}this.lines.push(_line);return line}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(args){var element=this.element=args.element;var graph=this.graph=args.graph;this.slideCallbacks=[];this.build();graph.onUpdate(function(){this.update()}.bind(this))},build:function(){var element=this.element;var graph=this.graph;var $=jQuery;var domain=graph.dataDomain();var self=this;$(function(){$(element).slider({range:true,min:domain[0],max:domain[1],values:[domain[0],domain[1]],slide:function(event,ui){if(ui.values[1]<=ui.values[0])return;graph.window.xMin=ui.values[0];graph.window.xMax=ui.values[1];graph.update();var domain=graph.dataDomain();if(domain[0]==ui.values[0]){graph.window.xMin=undefined}if(domain[1]==ui.values[1]){graph.window.xMax=undefined}self.slideCallbacks.forEach(function(callback){callback(graph,graph.window.xMin,graph.window.xMax)})}})});$(element)[0].style.width=graph.width+"px"},update:function(){var element=this.element;var graph=this.graph;var $=jQuery;var values=$(element).slider("option","values");var domain=graph.dataDomain();$(element).slider("option","min",domain[0]);$(element).slider("option","max",domain[1]);if(graph.window.xMin==null){values[0]=domain[0]}if(graph.window.xMax==null){values[1]=domain[1]}$(element).slider("option","values",values)},onSlide:function(callback){this.slideCallbacks.push(callback)}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider.Preview");Rickshaw.Graph.RangeSlider.Preview=Rickshaw.Class.create({initialize:function(args){if(!args.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!args.graph&&!args.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=args.element;this.element.style.position="relative";this.graphs=args.graph?[args.graph]:args.graphs;this.defaults={height:75,width:400,gripperColor:undefined,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0,heightRatio:.2};this.heightRatio=args.heightRatio||this.defaults.heightRatio;this.defaults.gripperColor=d3.rgb(this.defaults.frameColor).darker().toString();this.configureCallbacks=[];this.slideCallbacks=[];this.previews=[];if(!args.width)this.widthFromGraph=true;if(!args.height)this.heightFromGraph=true;if(this.widthFromGraph||this.heightFromGraph){this.graphs[0].onConfigure(function(){this.configure(args);this.render()}.bind(this))}args.width=args.width||this.graphs[0].width||this.defaults.width;args.height=args.height||this.graphs[0].height*this.heightRatio||this.defaults.height;this.configure(args);this.render()},onSlide:function(callback){this.slideCallbacks.push(callback)},onConfigure:function(callback){this.configureCallbacks.push(callback)},configure:function(args){this.config=this.config||{};this.configureCallbacks.forEach(function(callback){callback(args)});Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this.config?this.config[k]:this.defaults[k]},this);if("width"in args||"height"in args){if(this.widthFromGraph){this.config.width=this.graphs[0].width}if(this.heightFromGraph){this.config.height=this.graphs[0].height*this.heightRatio;this.previewHeight=this.config.height}this.previews.forEach(function(preview){var height=this.previewHeight/this.graphs.length-this.config.frameTopThickness*2;var width=this.config.width-this.config.frameHandleThickness*2;preview.setSize({width:width,height:height});if(this.svg){var svgHeight=height+this.config.frameHandleThickness*2;var svgWidth=width+this.config.frameHandleThickness*2;this.svg.style("width",svgWidth+"px");this.svg.style("height",svgHeight+"px")}},this)}},render:function(){var self=this;this.svg=d3.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]);this.previewHeight=this.config.height-this.config.frameTopThickness*2;this.previewWidth=this.config.width-this.config.frameHandleThickness*2;this.currentFrame=[0,this.previewWidth];var buildGraph=function(parent,index){var graphArgs=Rickshaw.extend({},parent.config);var height=self.previewHeight/self.graphs.length;var renderer=parent.renderer.name;Rickshaw.extend(graphArgs,{element:this.appendChild(document.createElement("div")),height:height,width:self.previewWidth,series:parent.series,renderer:renderer});var graph=new Rickshaw.Graph(graphArgs);self.previews.push(graph);parent.onUpdate(function(){graph.render();self.render()});parent.onConfigure(function(args){delete args.height;args.width=args.width-self.config.frameHandleThickness*2;graph.configure(args);graph.render()});graph.render()};var graphContainer=d3.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs);var translateCommand="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";graphContainer.enter().append("div").classed("rickshaw_range_slider_preview_container",true).style("-webkit-transform",translateCommand).style("-moz-transform",translateCommand).style("-ms-transform",translateCommand).style("transform",translateCommand).each(buildGraph);graphContainer.exit().remove();var masterGraph=this.graphs[0];var domainScale=d3.scale.linear().domain([0,this.previewWidth]).range(masterGraph.dataDomain());var currentWindow=[masterGraph.window.xMin,masterGraph.window.xMax];this.currentFrame[0]=currentWindow[0]===undefined?0:Math.round(domainScale.invert(currentWindow[0]));if(this.currentFrame[0]<0)this.currentFrame[0]=0;this.currentFrame[1]=currentWindow[1]===undefined?this.previewWidth:domainScale.invert(currentWindow[1]);if(this.currentFrame[1]-this.currentFrame[0]<self.config.minimumFrameWidth){this.currentFrame[1]=(this.currentFrame[0]||0)+self.config.minimumFrameWidth}this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",true).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","absolute").style("top",0);this._renderDimming();this._renderFrame();this._renderGrippers();this._renderHandles();this._renderMiddle();this._registerMouseEvents()},_renderDimming:function(){var element=this.svg.selectAll("path.dimming").data([null]);element.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",true);var path="";path+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness;path+=" h "+this.previewWidth;path+=" v "+this.previewHeight;path+=" h "+-this.previewWidth;path+=" z ";path+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+Math.min(this.currentFrame[1]+this.config.frameHandleThickness*2,this.previewWidth+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderFrame:function(){var element=this.svg.selectAll("path.frame").data([null]);element.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",true);var path="";path+=" M "+this.currentFrame[0]+" 0";path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness*2);path+=" V "+this.config.height;path+=" H "+this.currentFrame[0];path+=" z";path+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderGrippers:function(){var gripper=this.svg.selectAll("path.gripper").data([null]);gripper.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",true);var path="";[.4,.6].forEach(function(spacing){path+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*spacing)+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7);path+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+spacing))+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7)}.bind(this));gripper.attr("d",path)},_renderHandles:function(){var leftHandle=this.svg.selectAll("rect.left_handle").data([null]);leftHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",true);leftHandle.attr("x",this.currentFrame[0]).attr("height",this.config.height);var rightHandle=this.svg.selectAll("rect.right_handle").data([null]);rightHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",true);rightHandle.attr("x",this.currentFrame[1]+this.config.frameHandleThickness).attr("height",this.config.height)},_renderMiddle:function(){var middleHandle=this.svg.selectAll("rect.middle_handle").data([null]);middleHandle.enter().append("rect").style("cursor","move").style("fill-opacity","0").classed("middle_handle",true);middleHandle.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness).attr("height",this.config.height)},_registerMouseEvents:function(){var element=d3.select(this.element);var drag={target:null,start:null,stop:null,left:false,right:false,rigid:false};var self=this;function onMousemove(datum,index){drag.stop=self._getClientXFromEvent(d3.event,drag);var distanceTraveled=drag.stop-drag.start;var frameAfterDrag=self.frameBeforeDrag.slice(0);var minimumFrameWidth=self.config.minimumFrameWidth;if(drag.rigid){minimumFrameWidth=self.frameBeforeDrag[1]-self.frameBeforeDrag[0]}if(drag.left){frameAfterDrag[0]=Math.max(frameAfterDrag[0]+distanceTraveled,0)}if(drag.right){frameAfterDrag[1]=Math.min(frameAfterDrag[1]+distanceTraveled,self.previewWidth)}var currentFrameWidth=frameAfterDrag[1]-frameAfterDrag[0];if(currentFrameWidth<=minimumFrameWidth){if(drag.left){frameAfterDrag[0]=frameAfterDrag[1]-minimumFrameWidth}if(drag.right){frameAfterDrag[1]=frameAfterDrag[0]+minimumFrameWidth}if(frameAfterDrag[0]<=0){frameAfterDrag[1]-=frameAfterDrag[0];frameAfterDrag[0]=0}if(frameAfterDrag[1]>=self.previewWidth){frameAfterDrag[0]-=frameAfterDrag[1]-self.previewWidth;frameAfterDrag[1]=self.previewWidth}}self.graphs.forEach(function(graph){var domainScale=d3.scale.linear().interpolate(d3.interpolateNumber).domain([0,self.previewWidth]).range(graph.dataDomain());var windowAfterDrag=[domainScale(frameAfterDrag[0]),domainScale(frameAfterDrag[1])];self.slideCallbacks.forEach(function(callback){callback(graph,windowAfterDrag[0],windowAfterDrag[1])});if(frameAfterDrag[0]===0){windowAfterDrag[0]=undefined}if(frameAfterDrag[1]===self.previewWidth){windowAfterDrag[1]=undefined}graph.window.xMin=windowAfterDrag[0];graph.window.xMax=windowAfterDrag[1];graph.update()})}function onMousedown(){drag.target=d3.event.target;drag.start=self._getClientXFromEvent(d3.event,drag);self.frameBeforeDrag=self.currentFrame.slice();d3.event.preventDefault?d3.event.preventDefault():d3.event.returnValue=false;d3.select(document).on("mousemove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("mouseup.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchmove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("touchend.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",onMouseup)}function onMousedownLeftHandle(datum,index){drag.left=true;onMousedown()}function onMousedownRightHandle(datum,index){drag.right=true;onMousedown()}function onMousedownMiddleHandle(datum,index){drag.left=true;drag.right=true;drag.rigid=true;onMousedown()}function onMouseup(datum,index){d3.select(document).on("mousemove.rickshaw_range_slider_preview",null);d3.select(document).on("mouseup.rickshaw_range_slider_preview",null);d3.select(document).on("touchmove.rickshaw_range_slider_preview",null);d3.select(document).on("touchend.rickshaw_range_slider_preview",null);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",null);delete self.frameBeforeDrag;drag.left=false;drag.right=false;drag.rigid=false}element.select("rect.left_handle").on("mousedown",onMousedownLeftHandle);element.select("rect.right_handle").on("mousedown",onMousedownRightHandle);element.select("rect.middle_handle").on("mousedown",onMousedownMiddleHandle);element.select("rect.left_handle").on("touchstart",onMousedownLeftHandle);element.select("rect.right_handle").on("touchstart",onMousedownRightHandle);element.select("rect.middle_handle").on("touchstart",onMousedownMiddleHandle)},_getClientXFromEvent:function(event,drag){switch(event.type){case"touchstart":case"touchmove":var touchList=event.changedTouches;var touch=null;for(var touchIndex=0;touchIndex<touchList.length;touchIndex++){if(touchList[touchIndex].target===drag.target){touch=touchList[touchIndex];break}}return touch!==null?touch.clientX:undefined;default:return event.clientX}}});Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.tension=args.tension||this.tension;this.configure(args)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false}},domain:function(data){var stackedData=data||this.graph.stackedData||this.graph.stackData();var xMin=+Infinity;var xMax=-Infinity;var yMin=+Infinity;var yMax=-Infinity;stackedData.forEach(function(series){series.forEach(function(d){if(d.y==null)return;var y=d.y+d.y0;if(y<yMin)yMin=y;if(y>yMax)yMax=y});if(!series.length)return;if(series[0].x<xMin)xMin=series[0].x;if(series[series.length-1].x>xMax)xMax=series[series.length-1].x});xMin-=(xMax-xMin)*this.padding.left;xMax+=(xMax-xMin)*this.padding.right;yMin=this.graph.min==="auto"?yMin:this.graph.min||0;yMax=this.graph.max===undefined?yMax:this.graph.max;if(this.graph.min==="auto"||yMin<0){yMin-=(yMax-yMin)*this.padding.bottom}if(this.graph.max===undefined){yMax+=(yMax-yMin)*this.padding.top}return{x:[xMin,xMax],y:[yMin,yMax]}},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var pathNodes=vis.selectAll("path.path").data(data).enter().append("svg:path").classed("path",true).attr("d",this.seriesPathFactory());if(this.stroke){var strokeNodes=vis.selectAll("path.stroke").data(data).enter().append("svg:path").classed("stroke",true).attr("d",this.seriesStrokeFactory())}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=pathNodes[0][i];if(this.stroke)series.stroke=strokeNodes[0][i];this._styleSeries(series);i++},this)},_styleSeries:function(series){var fill=this.fill?series.color:"none";var stroke=this.stroke?series.color:"none";series.path.setAttribute("fill",fill);series.path.setAttribute("stroke",stroke);series.path.setAttribute("stroke-width",this.strokeWidth);if(series.className){d3.select(series.path).classed(series.className,true)}if(series.className&&this.stroke){d3.select(series.stroke).classed(series.className,true)}},configure:function(args){args=args||{};Rickshaw.keys(this.defaults()).forEach(function(key){if(!args.hasOwnProperty(key)){this[key]=this[key]||this.graph[key]||this.defaults()[key];return}if(typeof this.defaults()[key]=="object"){Rickshaw.keys(this.defaults()[key]).forEach(function(k){this[key][k]=args[key][k]!==undefined?args[key][k]:this[key][k]!==undefined?this[key][k]:this.defaults()[key][k]},this)}else{this[key]=args[key]!==undefined?args[key]:this[key]!==undefined?this[key]:this.graph[key]!==undefined?this.graph[key]:this.defaults()[key]}},this)},setStrokeWidth:function(strokeWidth){if(strokeWidth!==undefined){this.strokeWidth=strokeWidth}},setTension:function(tension){if(tension!==undefined){this.tension=tension}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var defaults=Rickshaw.extend($super(),{gapSize:.05,unstack:false});delete defaults.tension;return defaults},initialize:function($super,args){args=args||{};this.gapSize=args.gapSize||this.gapSize;$super(args)},domain:function($super){var domain=$super();var frequentInterval=this._frequentInterval(this.graph.stackedData.slice(-1).shift());domain.x[1]+=Number(frequentInterval.magnitude);return domain},barWidth:function(series){var frequentInterval=this._frequentInterval(series.stack);var barWidth=this.graph.x.magnitude(frequentInterval.magnitude)*(1-this.gapSize);return barWidth},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var barWidth=this.barWidth(series.active()[0]);var barXOffset=0;var activeSeriesCount=series.filter(function(s){return!s.disabled}).length;var seriesBarWidth=this.unstack?barWidth/activeSeriesCount:barWidth;var transform=function(d){var matrix=[1,0,0,d.y<0?-1:1,0,d.y<0?graph.y.magnitude(Math.abs(d.y))*2:0];return"matrix("+matrix.join(",")+")"};series.forEach(function(series){if(series.disabled)return;var barWidth=this.barWidth(series);var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:rect").attr("x",function(d){return graph.x(d.x)+barXOffset}).attr("y",function(d){return graph.y(d.y0+Math.abs(d.y))*(d.y<0?-1:1)}).attr("width",seriesBarWidth).attr("height",function(d){return graph.y.magnitude(Math.abs(d.y))}).attr("transform",transform);Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)});if(this.unstack)barXOffset+=seriesBarWidth},this)},_frequentInterval:function(data){var intervalCounts={};for(var i=0;i<data.length-1;i++){var interval=data[i+1].x-data[i].x;intervalCounts[interval]=intervalCounts[interval]||0;intervalCounts[interval]++}var frequentInterval={count:0,magnitude:1};Rickshaw.keys(intervalCounts).forEach(function(i){if(frequentInterval.count<intervalCounts[i]){frequentInterval={count:intervalCounts[i],magnitude:i}}});return frequentInterval}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);
-factory.defined&&factory.defined(function(d){return d.y!==null});return factory},seriesStrokeFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var method=this.unstack?"append":"insert";var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter()[method]("svg:g","g");nodes.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){nodes.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){if(!series.path)return;d3.select(series.path).select(".area").attr("fill",series.color);if(this.stroke){d3.select(series.path).select(".line").attr("fill","none").attr("stroke",series.stroke||d3.interpolateRgb(series.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(series.className){series.path.setAttribute("class",series.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,args){$super(args)},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});if(series.className){nodes.classed(series.className,true)}Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Multi");Rickshaw.Graph.Renderer.Multi=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"multi",initialize:function($super,args){$super(args)},defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},configure:function($super,args){args=args||{};this.config=args;$super(args)},domain:function($super){this.graph.stackData();var domains=[];var groups=this._groups();this._stack(groups);groups.forEach(function(group){var data=group.series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});if(!data.length)return;var domain=null;if(group.renderer&&group.renderer.domain){domain=group.renderer.domain(data)}else{domain=$super(data)}domains.push(domain)});var xMin=d3.min(domains.map(function(d){return d.x[0]}));var xMax=d3.max(domains.map(function(d){return d.x[1]}));var yMin=d3.min(domains.map(function(d){return d.y[0]}));var yMax=d3.max(domains.map(function(d){return d.y[1]}));return{x:[xMin,xMax],y:[yMin,yMax]}},_groups:function(){var graph=this.graph;var renderGroups={};graph.series.forEach(function(series){if(series.disabled)return;if(!renderGroups[series.renderer]){var ns="http://www.w3.org/2000/svg";var vis=document.createElementNS(ns,"g");graph.vis[0][0].appendChild(vis);var renderer=graph._renderers[series.renderer];var config={};var defaults=[this.defaults(),renderer.defaults(),this.config,this.graph];defaults.forEach(function(d){Rickshaw.extend(config,d)});renderer.configure(config);renderGroups[series.renderer]={renderer:renderer,series:[],vis:d3.select(vis)}}renderGroups[series.renderer].series.push(series)},this);var groups=[];Object.keys(renderGroups).forEach(function(key){var group=renderGroups[key];groups.push(group)});return groups},_stack:function(groups){groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});var data=series.map(function(series){return series.stack});if(!group.renderer.unstack){var layout=d3.layout.stack();var stackedData=Rickshaw.clone(layout(data));series.forEach(function(series,index){series._stack=Rickshaw.clone(stackedData[index])})}},this);return groups},render:function(){this.graph.series.forEach(function(series){if(!series.renderer){throw new Error("Each series needs a renderer for graph 'multi' renderer")}});this.graph.vis.selectAll("*").remove();var groups=this._groups();groups=this._stack(groups);groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});series.active=function(){return series};group.renderer.render({series:series,vis:group.vis});series.forEach(function(s){s.stack=s._stack||s.stack||s.data})})}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LinePlot");Rickshaw.Graph.Renderer.LinePlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"lineplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter().append("svg:path").attr("d",this.seriesPathFactory());var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this);series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("x").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});Array.prototype.forEach.call(nodes[0],function(n){if(!n)return;n.setAttribute("data-color",series.color);n.setAttribute("fill","white");n.setAttribute("stroke",series.color);n.setAttribute("stroke-width",this.strokeWidth)}.bind(this))},this)}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.element=args.element;this.aggregationScale=1;this.build();this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var self=this;var $=jQuery;if(this.element){$(function(){$(self.element).slider({min:1,max:100,slide:function(event,ui){self.setScale(ui.value)}})})}},setScale:function(scale){if(scale<1){throw"scale out of range: "+scale}this.aggregationScale=scale;this.graph.update()},transformer:function(data){if(this.aggregationScale==1)return data;var aggregatedData=[];data.forEach(function(seriesData){var aggregatedSeriesData=[];while(seriesData.length){var avgX=0,avgY=0;var slice=seriesData.splice(0,this.aggregationScale);slice.forEach(function(d){avgX+=d.x/slice.length;avgY+=d.y/slice.length});aggregatedSeriesData.push({x:avgX,y:avgY})}aggregatedData.push(aggregatedSeriesData)}.bind(this));return aggregatedData}});Rickshaw.namespace("Rickshaw.Graph.Socketio");Rickshaw.Graph.Socketio=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){var socket=io.connect(this.dataURL);var self=this;socket.on("rickshaw",function(data){self.success(data)})}});Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(data,palette,options){options=options||{};this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;var timeInterval=typeof options.timeInterval=="undefined"?1e3:options.timeInterval;this.setTimeInterval(timeInterval);if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this)}},addItem:function(item){if(typeof item.name==="undefined"){throw"addItem() needs a name"}item.color=item.color||this.palette.color(item.name);item.data=item.data||[];if(item.data.length===0&&this.length&&this.getIndex()>0){this[0].data.forEach(function(plot){item.data.push({x:plot.x,y:0})})}else if(item.data.length===0){item.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},addData:function(data,x){var index=this.getIndex();Rickshaw.keys(data).forEach(function(name){if(!this.itemByName(name)){this.addItem({name:name})}},this);this.forEach(function(item){item.data.push({x:x||(index*this.timeInterval||1)+this.timeBase,y:data[item.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(name){for(var i=0;i<this.length;i++){if(this[i].name==name)return this[i]}},setTimeInterval:function(iv){this.timeInterval=iv/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var data={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(item){var newItem={color:item.color,name:item.name,data:[]};item.data.forEach(function(plot){newItem.data.push({x:plot.x,y:plot.y})});data.items.push(newItem)});return data},load:function(data){if(data.timeInterval){this.timeInterval=data.timeInterval}if(data.timeBase){this.timeBase=data.timeBase}if(data.items){data.items.forEach(function(item){this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},this)}}});Rickshaw.Series.zeroFill=function(series){Rickshaw.Series.fill(series,0)};Rickshaw.Series.fill=function(series,fill){var x;var i=0;var data=series.map(function(s){return s.data});while(i<Math.max.apply(null,data.map(function(d){return d.length}))){x=Math.min.apply(null,data.filter(function(d){return d[i]}).map(function(d){return d[i].x}));data.forEach(function(d){if(!d[i]||d[i].x!=x){d.splice(i,0,{x:x,y:fill})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(data,palette,options){options=options||{};if(typeof options.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof options.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;this.setTimeInterval(options.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=options.maxDataPoints;if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>1;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(item){item.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,data,x){$super(data,x);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(item){item.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});return Rickshaw});
\ No newline at end of file
+(function(root,factory){if(typeof define==="function"&&define.amd){define(["d3"],function(d3){return root.Rickshaw=factory(d3)})}else if(typeof exports==="object"){module.exports=factory(require("d3"))}else{root.Rickshaw=factory(d3)}})(this,function(d3){var Rickshaw={version:"1.7.0",namespace:function(namespace,obj){var parts=namespace.split(".");var parent=Rickshaw;for(var i=1,length=parts.length;i<length;i++){var currentPart=parts[i];parent[currentPart]=parent[currentPart]||{};parent=parent[currentPart]}return parent},keys:function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},extend:function(destination,source){for(var property in source){destination[property]=source[property]}return destination},clone:function(obj){return JSON.parse(JSON.stringify(obj))}};(function(globalContext){var _toString=Object.prototype.toString,NULL_TYPE="Null",UNDEFINED_TYPE="Undefined",BOOLEAN_TYPE="Boolean",NUMBER_TYPE="Number",STRING_TYPE="String",OBJECT_TYPE="Object",FUNCTION_CLASS="[object Function]";function isFunction(object){return _toString.call(object)===FUNCTION_CLASS}function extend(destination,source){for(var property in source)if(source.hasOwnProperty(property))destination[property]=source[property];return destination}function keys(object){if(Type(object)!==OBJECT_TYPE){throw new TypeError}var results=[];for(var property in object){if(object.hasOwnProperty(property)){results.push(property)}}return results}function Type(o){switch(o){case null:return NULL_TYPE;case void 0:return UNDEFINED_TYPE}var type=typeof o;switch(type){case"boolean":return BOOLEAN_TYPE;case"number":return NUMBER_TYPE;case"string":return STRING_TYPE}return OBJECT_TYPE}function isUndefined(object){return typeof object==="undefined"}var slice=Array.prototype.slice;function argumentNames(fn){var names=fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}function wrap(fn,wrapper){var __method=fn;return function(){var a=update([bind(__method,this)],arguments);return wrapper.apply(this,a)}}function update(array,args){var arrayLength=array.length,length=args.length;while(length--)array[arrayLength+length]=args[length];return array}function merge(array,args){array=slice.call(array,0);return update(array,args)}function bind(fn,context){if(arguments.length<2&&isUndefined(arguments[0]))return this;var __method=fn,args=slice.call(arguments,2);return function(){var a=merge(args,arguments);return __method.apply(context,a)}}var emptyFunction=function(){};var Class=function(){var IS_DONTENUM_BUGGY=function(){for(var p in{toString:1}){if(p==="toString")return false}return true}();function subclass(){}function create(){var parent=null,properties=[].slice.apply(arguments);if(isFunction(properties[0]))parent=properties.shift();function klass(){this.initialize.apply(this,arguments)}extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;try{parent.subclasses.push(klass)}catch(e){}}for(var i=0,length=properties.length;i<length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=emptyFunction;klass.prototype.constructor=klass;return klass}function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype,properties=keys(source);if(IS_DONTENUM_BUGGY){if(source.toString!=Object.prototype.toString)properties.push("toString");if(source.valueOf!=Object.prototype.valueOf)properties.push("valueOf")}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&isFunction(value)&&argumentNames(value)[0]=="$super"){var method=value;value=wrap(function(m){return function(){return ancestor[m].apply(this,arguments)}}(property),method);value.valueOf=bind(method.valueOf,method);value.toString=bind(method.toString,method)}this.prototype[property]=value}return this}return{create:create,Methods:{addMethods:addMethods}}}();if(globalContext.exports){globalContext.exports.Class=Class}else{globalContext.Class=Class}})(Rickshaw);Rickshaw.namespace("Rickshaw.Compat.ClassList");Rickshaw.Compat.ClassList=function(){if(typeof document!=="undefined"&&!("classList"in document.createElement("a"))){(function(view){"use strict";var classListProp="classList",protoProp="prototype",elemCtrProto=(view.HTMLElement||view.Element)[protoProp],objCtr=Object,strTrim=String[protoProp].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[protoProp].indexOf||function(item){var i=0,len=this.length;for(;i<len;i++){if(i in this&&this[i]===item){return i}}return-1},DOMEx=function(type,message){this.name=type;this.code=DOMException[type];this.message=message},checkTokenAndGetIndex=function(classList,token){if(token===""){throw new DOMEx("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(token)){throw new DOMEx("INVALID_CHARACTER_ERR","String contains an invalid character")}return arrIndexOf.call(classList,token)},ClassList=function(elem){var trimmedClasses=strTrim.call(elem.className),classes=trimmedClasses?trimmedClasses.split(/\s+/):[],i=0,len=classes.length;for(;i<len;i++){this.push(classes[i])}this._updateClassName=function(){elem.className=this.toString()}},classListProto=ClassList[protoProp]=[],classListGetter=function(){return new ClassList(this)};DOMEx[protoProp]=Error[protoProp];classListProto.item=function(i){return this[i]||null};classListProto.contains=function(token){token+="";return checkTokenAndGetIndex(this,token)!==-1};classListProto.add=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.push(token);this._updateClassName()}};classListProto.remove=function(token){token+="";var index=checkTokenAndGetIndex(this,token);if(index!==-1){this.splice(index,1);this._updateClassName()}};classListProto.toggle=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.add(token)}else{this.remove(token)}};classListProto.toString=function(){return this.join(" ")};if(objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:true,configurable:true};try{objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}catch(ex){if(ex.number===-2146823252){classListPropDesc.enumerable=false;objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}}}else if(objCtr[protoProp].__defineGetter__){elemCtrProto.__defineGetter__(classListProp,classListGetter)}})(window)}};if(typeof RICKSHAW_NO_COMPAT!=="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT==="undefined"){new Rickshaw.Compat.ClassList}Rickshaw.namespace("Rickshaw.Graph");Rickshaw.Graph=function(args){var self=this;this.initialize=function(args){if(!args.element)throw"Rickshaw.Graph needs a reference to an element";if(args.element.nodeType!==1)throw"Rickshaw.Graph element was defined but not an HTML element";this.element=args.element;this.series=args.series;this.window={};this.updateCallbacks=[];this.configureCallbacks=[];this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined,preserve:false,xScale:undefined,yScale:undefined,stack:true};this._loadRenderers();this.configure(args);this.setSeries(args.series);this.setSize({width:args.width,height:args.height});this.element.classList.add("rickshaw_graph");this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);this.discoverRange()};this._loadRenderers=function(){for(var name in Rickshaw.Graph.Renderer){if(!name||!Rickshaw.Graph.Renderer.hasOwnProperty(name))continue;var r=Rickshaw.Graph.Renderer[name];if(!r||!r.prototype||!r.prototype.render)continue;self.registerRenderer(new r({graph:self}))}};this.validateSeries=function(series){if(!Array.isArray(series)&&!(series instanceof Rickshaw.Series)){var seriesSignature=Object.prototype.toString.apply(series);throw"series is not an array: "+seriesSignature}var pointsCount;series.forEach(function(s){if(!(s instanceof Object)){throw"series element is not an object: "+s}if(!s.data){throw"series has no data: "+JSON.stringify(s)}if(!Array.isArray(s.data)){throw"series data is not an array: "+JSON.stringify(s.data)}if(s.data.length>0){var x=s.data[0].x;var y=s.data[0].y;if(typeof x!="number"||typeof y!="number"&&y!==null){throw"x and y properties of points should be numbers instead of "+typeof x+" and "+typeof y}}if(s.data.length>=3){if(s.data[2].x<s.data[1].x||s.data[1].x<s.data[0].x||s.data[s.data.length-1].x<s.data[0].x){throw"series data needs to be sorted on x values for series name: "+s.name}}},this)};this.setSeries=function(series){this.validateSeries(series);this.series=series;this.series.active=function(){return self.series.filter(function(s){return!s.disabled})}};this.dataDomain=function(){var data=this.series.map(function(s){return s.data});var min=d3.min(data.map(function(d){return d[0].x}));var max=d3.max(data.map(function(d){return d[d.length-1].x}));return[min,max]};this.discoverRange=function(){var domain=this.renderer.domain();this.x=(this.xScale||d3.scale.linear()).copy().domain(domain.x).range([0,this.width]);this.y=(this.yScale||d3.scale.linear()).copy().domain(domain.y).range([this.height,0]);this.x.magnitude=d3.scale.linear().domain([domain.x[0]-domain.x[0],domain.x[1]-domain.x[0]]).range([0,this.width]);this.y.magnitude=d3.scale.linear().domain([domain.y[0]-domain.y[0],domain.y[1]-domain.y[0]]).range([0,this.height])};this.render=function(){var stackedData=this.stackData();this.discoverRange();this.renderer.render();this.updateCallbacks.forEach(function(callback){callback()})};this.update=this.render;this.stackData=function(){var data=this.series.active().map(function(d){return d.data}).map(function(d){return d.filter(function(d){return this._slice(d)},this)},this);var preserve=this.preserve;if(!preserve){this.series.forEach(function(series){if(series.scale){preserve=true}})}data=preserve?Rickshaw.clone(data):data;this.series.active().forEach(function(series,index){if(series.scale){var seriesData=data[index];if(seriesData){seriesData.forEach(function(d){d.y=series.scale(d.y)})}}});this.stackData.hooks.data.forEach(function(entry){data=entry.f.apply(self,[data])});var stackedData;if(!this.renderer.unstack){this._validateStackable();var layout=d3.layout.stack();layout.offset(self.offset);stackedData=layout(data)}stackedData=stackedData||data;if(this.renderer.unstack){stackedData.forEach(function(seriesData){seriesData.forEach(function(d){d.y0=d.y0===undefined?0:d.y0})})}this.stackData.hooks.after.forEach(function(entry){stackedData=entry.f.apply(self,[data])});var i=0;this.series.forEach(function(series){if(series.disabled)return;series.stack=stackedData[i++]});this.stackedData=stackedData;return stackedData};this._validateStackable=function(){var series=this.series;var pointsCount;series.forEach(function(s){pointsCount=pointsCount||s.data.length;if(pointsCount&&s.data.length!=pointsCount){throw"stacked series cannot have differing numbers of points: "+pointsCount+" vs "+s.data.length+"; see Rickshaw.Series.fill()"}},this)};this.stackData.hooks={data:[],after:[]};this._slice=function(d){if(this.window.xMin||this.window.xMax){var isInRange=true;if(this.window.xMin&&d.x<this.window.xMin)isInRange=false;if(this.window.xMax&&d.x>this.window.xMax)isInRange=false;return isInRange}return true};this.onUpdate=function(callback){this.updateCallbacks.push(callback)};this.onConfigure=function(callback){this.configureCallbacks.push(callback)};this.registerRenderer=function(renderer){this._renderers=this._renderers||{};this._renderers[renderer.name]=renderer};this.configure=function(args){this.config=this.config||{};if(args.width||args.height){this.setSize(args)}Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this?this[k]:this.defaults[k]},this);Rickshaw.keys(this.config).forEach(function(k){this[k]=this.config[k]},this);if("stack"in args)args.unstack=!args.stack;var renderer=args.renderer||this.renderer&&this.renderer.name||"stack";this.setRenderer(renderer,args);this.configureCallbacks.forEach(function(callback){callback(args)})};this.setRenderer=function(r,args){if(typeof r=="function"){this.renderer=new r({graph:self});this.registerRenderer(this.renderer)}else{if(!this._renderers[r]){throw"couldn't find renderer "+r}this.renderer=this._renderers[r]}if(typeof args=="object"){this.renderer.configure(args)}};this.setSize=function(args){args=args||{};if(args.width&&args.height){this.width=args.width;this.height=args.height}else{if(typeof window!=="undefined"){var style=window.getComputedStyle(this.element,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);var elementHeight=parseInt(style.getPropertyValue("height"),10)}this.width=args.width||elementWidth||400;this.height=args.height||elementHeight||250}this.vis&&this.vis.attr("width",this.width).attr("height",this.height)};this.initialize(args)};Rickshaw.namespace("Rickshaw.Fixtures.Color");Rickshaw.Fixtures.Color=function(){this.schemes={};this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse();this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"];this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"];this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse();this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"};this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse();this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"];this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]};Rickshaw.namespace("Rickshaw.Fixtures.RandomData");Rickshaw.Fixtures.RandomData=function(timeInterval){var addData;timeInterval=timeInterval||1;var lastRandomValue=200;var timeBase=Math.floor((new Date).getTime()/1e3);this.addData=function(data){var randomValue=Math.random()*100+15+lastRandomValue;var index=data[0].length;var counter=1;data.forEach(function(series){var randomVariance=Math.random()*20;var v=randomValue/25+counter+++(Math.cos(index*counter*11/960)+2)*15+(Math.cos(index/7)+2)*7+(Math.cos(index/17)+2)*1;series.push({x:index*timeInterval+timeBase,y:v+randomVariance})});lastRandomValue=randomValue*.85};this.removeData=function(data){data.forEach(function(series){series.shift()});timeBase+=timeInterval}};Rickshaw.namespace("Rickshaw.Fixtures.Time");Rickshaw.Fixtures.Time=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getUTCFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getUTCFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getUTCMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getUTCDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getUTCMinutes()+"m"}},{name:"15 second",seconds:15,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getUTCMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getUTCMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toUTCString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year;if(unit.name=="month"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),date.getUTCMonth())/1e3;if(floor==time)return time;year=date.getUTCFullYear();var month=date.getUTCMonth();if(month==11){month=0;year=year+1}else{month+=1}return Date.UTC(year,month)/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),0)/1e3;if(floor==time)return time;year=date.getUTCFullYear()+1;return Date.UTC(year,0)/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Time.Local");Rickshaw.Fixtures.Time.Local=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year,offset;if(unit.name=="day"){var nearFuture=new Date((time+unit.seconds-1)*1e3);var rounded=new Date(0);rounded.setFullYear(nearFuture.getFullYear());rounded.setMonth(nearFuture.getMonth());rounded.setDate(nearFuture.getDate());rounded.setMilliseconds(0);rounded.setSeconds(0);rounded.setMinutes(0);rounded.setHours(0);return rounded.getTime()/1e3}if(unit.name=="month"){date=new Date(time*1e3);floor=new Date(date.getFullYear(),date.getMonth()).getTime()/1e3;if(floor==time)return time;year=date.getFullYear();var month=date.getMonth();if(month==11){month=0;year=year+1}else{month+=1}return new Date(year,month).getTime()/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=new Date(date.getUTCFullYear(),0).getTime()/1e3;if(floor==time)return time;year=date.getFullYear()+1;return new Date(year,0).getTime()/1e3}offset=new Date(time*1e3).getTimezoneOffset()*60;return Math.ceil((time-offset)/unit.seconds)*unit.seconds+offset}};Rickshaw.namespace("Rickshaw.Fixtures.Number");Rickshaw.Fixtures.Number.formatKMBT=function(y){var abs_y=Math.abs(y);if(abs_y>=1e12){return(y/1e12).toFixed(2)+"T"}else if(abs_y>=1e9){return(y/1e9).toFixed(2)+"B"}else if(abs_y>=1e6){return(y/1e6).toFixed(2)+"M"}else if(abs_y>=1e3){return(y/1e3).toFixed(2)+"K"}else if(abs_y<1&&abs_y>0){return y.toFixed(2)}else if(abs_y===0){return"0"}else{return y}};Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(y){var abs_y=Math.abs(y);if(abs_y>=0x4000000000000){return(y/0x4000000000000).toFixed(2)+"P"}else if(abs_y>=1099511627776){return(y/1099511627776).toFixed(2)+"T"}else if(abs_y>=1073741824){return(y/1073741824).toFixed(2)+"G"}else if(abs_y>=1048576){return(y/1048576).toFixed(2)+"M"}else if(abs_y>=1024){return(y/1024).toFixed(2)+"K"}else if(abs_y<1&&abs_y>0){return y.toFixed(2)}else if(abs_y===0){return"0"}else{return y}};Rickshaw.namespace("Rickshaw.Color.Palette");Rickshaw.Color.Palette=function(args){var color=new Rickshaw.Fixtures.Color;args=args||{};this.schemes={};this.scheme=color.schemes[args.scheme]||args.scheme||color.schemes.colorwheel;this.runningIndex=0;this.generatorIndex=0;if(args.interpolatedStopCount){var schemeCount=this.scheme.length-1;var i,j,scheme=[];for(i=0;i<schemeCount;i++){scheme.push(this.scheme[i]);var generator=d3.interpolateHsl(this.scheme[i],this.scheme[i+1]);for(j=1;j<args.interpolatedStopCount;j++){scheme.push(generator(1/args.interpolatedStopCount*j))}}scheme.push(this.scheme[this.scheme.length-1]);this.scheme=scheme}this.rotateCount=this.scheme.length;this.color=function(key){return this.scheme[key]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"};this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var color;if(this.generatorIndex==this.rotateCount*2-1){color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5);this.generatorIndex=0;this.rotateCount*=2}else{color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5);this.generatorIndex++}this.scheme.push(color);return color}};Rickshaw.namespace("Rickshaw.Graph.Ajax");Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(args){this.dataURL=args.dataURL;this.onData=args.onData||function(d){return d};this.onComplete=args.onComplete||function(){};this.onError=args.onError||function(){};this.args=args;this.request()},request:function(){jQuery.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL);this.onError(this)},success:function(data,status){data=this.onData(data);this.args.series=this._splice({data:data,series:this.args.series});this.graph=this.graph||new Rickshaw.Graph(this.args);this.graph.render();this.onComplete(this)},_splice:function(args){var data=args.data;var series=args.series;if(!args.series)return data;series.forEach(function(s){var seriesKey=s.key||s.name;if(!seriesKey)throw"series needs a key or a name";data.forEach(function(d){var dataKey=d.key||d.name;if(!dataKey)throw"data needs a key or a name";if(seriesKey==dataKey){var properties=["color","name","data"];properties.forEach(function(p){if(d[p])s[p]=d[p]})}})});return series}});Rickshaw.namespace("Rickshaw.Graph.Annotate");Rickshaw.Graph.Annotate=function(args){var graph=this.graph=args.graph;this.elements={timeline:args.element};var self=this;this.data={};this.elements.timeline.classList.add("rickshaw_annotation_timeline");this.add=function(time,content,end_time){self.data[time]=self.data[time]||{boxes:[]};self.data[time].boxes.push({content:content,end:end_time})};this.update=function(){Rickshaw.keys(self.data).forEach(function(time){var annotation=self.data[time];var left=self.graph.x(time);if(left<0||left>self.graph.x.range()[1]){if(annotation.element){annotation.line.classList.add("offscreen");annotation.element.style.display="none"}annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.add("offscreen")});return}if(!annotation.element){var element=annotation.element=document.createElement("div");element.classList.add("annotation");this.elements.timeline.appendChild(element);element.addEventListener("click",function(e){element.classList.toggle("active");annotation.line.classList.toggle("active");annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.toggle("active")})},false)}annotation.element.style.left=left+"px";annotation.element.style.display="block";annotation.boxes.forEach(function(box){var element=box.element;if(!element){element=box.element=document.createElement("div");element.classList.add("content");element.innerHTML=box.content;annotation.element.appendChild(element);annotation.line=document.createElement("div");annotation.line.classList.add("annotation_line");self.graph.element.appendChild(annotation.line);if(box.end){box.rangeElement=document.createElement("div");box.rangeElement.classList.add("annotation_range");self.graph.element.appendChild(box.rangeElement)}}if(box.end){var annotationRangeStart=left;var annotationRangeEnd=Math.min(self.graph.x(box.end),self.graph.x.range()[1]);if(annotationRangeStart>annotationRangeEnd){annotationRangeEnd=left;annotationRangeStart=Math.max(self.graph.x(box.end),self.graph.x.range()[0])}var annotationRangeWidth=annotationRangeEnd-annotationRangeStart;box.rangeElement.style.left=annotationRangeStart+"px";box.rangeElement.style.width=annotationRangeWidth+"px";box.rangeElement.classList.remove("offscreen")}annotation.line.classList.remove("offscreen");annotation.line.style.left=left+"px"})},this)};this.graph.onUpdate(function(){self.update()})};Rickshaw.namespace("Rickshaw.Graph.Axis.Time");Rickshaw.Graph.Axis.Time=function(args){var self=this;this.graph=args.graph;this.elements=[];this.ticksTreatment=args.ticksTreatment||"plain";this.fixedTimeUnit=args.timeUnit;var time=args.timeFixture||new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var unit;var units=time.units;var domain=this.graph.x.domain();var rangeSeconds=domain[1]-domain[0];units.forEach(function(u){if(Math.floor(rangeSeconds/u.seconds)>=2){unit=unit||u}});return unit||time.units[time.units.length-1]};this.tickOffsets=function(){var domain=this.graph.x.domain();var unit=this.fixedTimeUnit||this.appropriateTimeUnit();var count=Math.ceil((domain[1]-domain[0])/unit.seconds);var runningTick=domain[0];var offsets=[];for(var i=0;i<count;i++){var tickValue=time.ceil(runningTick,unit);runningTick=tickValue+unit.seconds/2;offsets.push({value:tickValue,unit:unit})}return offsets};this.render=function(){this.elements.forEach(function(e){e.parentNode.removeChild(e)});this.elements=[];var offsets=this.tickOffsets();offsets.forEach(function(o){if(self.graph.x(o.value)>self.graph.x.range()[1])return;var element=document.createElement("div");element.style.left=self.graph.x(o.value)+"px";element.classList.add("x_tick");element.classList.add(self.ticksTreatment);var title=document.createElement("div");title.classList.add("title");title.innerHTML=o.unit.formatter(new Date(o.value*1e3));element.appendChild(title);self.graph.element.appendChild(element);self.elements.push(element)})};this.graph.onUpdate(function(){self.render()})};Rickshaw.namespace("Rickshaw.Graph.Axis.X");Rickshaw.Graph.Axis.X=function(args){var self=this;var berthRate=.1;this.initialize=function(args){this.graph=args.graph;this.orientation=args.orientation||"top";this.color=args.color||"#000000";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";if(args.element){this.element=args.element;this._discoverSize(args.element,args);this.vis=d3.select(args.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("stroke",this.color).attr("class","rickshaw_graph x_axis_d3");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}this.graph.onUpdate(function(){self.render()})};this.setSize=function(args){args=args||{};if(!this.element)return;this._discoverSize(this.element.parentNode,args);this.vis.attr("height",this.height).attr("width",this.width*(1+berthRate));var berth=Math.floor(this.width*berthRate/2);this.element.style.left=-1*berth+"px"};this.render=function(){if(this._renderWidth!==undefined&&this.graph.width!==this._renderWidth)this.setSize({auto:true});var axis=d3.svg.axis().scale(this.graph.x).orient(this.orientation);axis.tickFormat(args.tickFormat||function(x){return x});if(this.tickValues)axis.tickValues(this.tickValues);this.ticks=this.staticTicks||Math.floor(this.graph.width/this.pixelsPerTick);var berth=Math.floor(this.width*berthRate/2)||0;var bar_offset=this.graph.renderer.name=="bar"&&Math.ceil(this.graph.width*.95/this.graph.series[0].data.length/2)||0;var transform;if(this.orientation=="top"){var yOffset=this.height||this.graph.height;transform="translate("+(berth+bar_offset)+","+yOffset+")"}else{transform="translate("+(berth+bar_offset)+", 0)"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var gridSize=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-x-value",this.textContent)});this._renderHeight=this.graph.height};this._discoverSize=function(element,args){if(typeof window!=="undefined"){var style=window.getComputedStyle(element,null);var elementHeight=parseInt(style.getPropertyValue("height"),10);if(!args.auto){var elementWidth=parseInt(style.getPropertyValue("width"),10)}}this.width=(args.width||elementWidth||this.graph.width)*(1+berthRate);this.height=args.height||elementHeight||40};this.initialize(args)};Rickshaw.namespace("Rickshaw.Graph.Axis.Y");Rickshaw.Graph.Axis.Y=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.orientation=args.orientation||"right";this.color=args.color||"#000000";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";this.tickFormat=args.tickFormat||function(y){return y};this.berthRate=.1;if(args.element){this.element=args.element;this.vis=d3.select(args.element).append("svg:svg").attr("stroke",this.color).attr("class","rickshaw_graph y_axis");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}var self=this;this.graph.onUpdate(function(){self.render()})},setSize:function(args){args=args||{};if(!this.element)return;if(typeof window!=="undefined"){var style=window.getComputedStyle(this.element.parentNode,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);if(!args.auto){var elementHeight=parseInt(style.getPropertyValue("height"),10)}}this.width=args.width||elementWidth||this.graph.width*this.berthRate;this.height=args.height||elementHeight||this.graph.height;this.vis.attr("width",this.width).attr("height",this.height*(1+this.berthRate));var berth=this.height*this.berthRate;if(this.orientation=="left"){this.element.style.top=-1*berth+"px"}},render:function(){if(this._renderHeight!==undefined&&this.graph.height!==this._renderHeight)this.setSize({auto:true});this.ticks=this.staticTicks||Math.floor(this.graph.height/this.pixelsPerTick);var axis=this._drawAxis(this.graph.y);this._drawGrid(axis);this._renderHeight=this.graph.height},_drawAxis:function(scale){var axis=d3.svg.axis().scale(scale).orient(this.orientation);axis.tickFormat(this.tickFormat)
+;if(this.tickValues)axis.tickValues(this.tickValues);if(this.orientation=="left"){var berth=this.height*this.berthRate;var transform="translate("+this.width+", "+berth+")"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));return axis},_drawGrid:function(axis){var gridSize=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)})}});Rickshaw.namespace("Rickshaw.Graph.Axis.Y.Scaled");Rickshaw.Graph.Axis.Y.Scaled=Rickshaw.Class.create(Rickshaw.Graph.Axis.Y,{initialize:function($super,args){if(typeof args.scale==="undefined"){throw new Error("Scaled requires scale")}this.scale=args.scale;if(typeof args.grid==="undefined"){this.grid=true}else{this.grid=args.grid}$super(args)},_drawAxis:function($super,scale){var domain=this.scale.domain();var renderDomain=this.graph.renderer.domain().y;var extents=[Math.min.apply(Math,domain),Math.max.apply(Math,domain)];var extentMap=d3.scale.linear().domain([0,1]).range(extents);var adjExtents=[extentMap(renderDomain[0]),extentMap(renderDomain[1])];var adjustment=d3.scale.linear().domain(extents).range(adjExtents);var adjustedScale=this.scale.copy().domain(domain.map(adjustment)).range(scale.range());return $super(adjustedScale)},_drawGrid:function($super,axis){if(this.grid){$super(axis)}}});Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;var propertiesSafe={};var activeLine=null;var disabledColor=args.disabledColor||function(seriesColor){return d3.interpolateRgb(seriesColor,d3.rgb("#d8d8d8"))(.8).toString()};var transformFn=args.transform||function(isActive,series){var newProperties={};if(!isActive){newProperties.color=disabledColor(series.color)}return newProperties};this.addHighlightEvents=function(l){l.element.addEventListener("mouseover",function(e){if(activeLine)return;else activeLine=l;self.legend.lines.forEach(function(line){var newProperties;var isActive=false;if(l===line){isActive=true;if(self.graph.renderer.unstack&&(line.series.renderer?line.series.renderer.unstack:true)){var seriesIndex=self.graph.series.indexOf(line.series);line.originalIndex=seriesIndex;var series=self.graph.series.splice(seriesIndex,1)[0];self.graph.series.push(series)}}newProperties=transformFn(isActive,line.series);propertiesSafe[line.series.name]=propertiesSafe[line.series.name]||{color:line.series.color,stroke:line.series.stroke};if(newProperties.color){line.series.color=newProperties.color}if(newProperties.stroke){line.series.stroke=newProperties.stroke}});self.graph.update()},false);l.element.addEventListener("mouseout",function(e){if(!activeLine)return;else activeLine=null;self.legend.lines.forEach(function(line){if(l===line&&line.hasOwnProperty("originalIndex")){var series=self.graph.series.pop();self.graph.series.splice(line.originalIndex,0,series);delete line.originalIndex}var lineProperties=propertiesSafe[line.series.name];if(lineProperties){line.series.color=lineProperties.color;line.series.stroke=lineProperties.stroke}});self.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(l){self.addHighlightEvents(l)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;if(typeof window.jQuery=="undefined"){throw"couldn't find jQuery at window.jQuery"}if(typeof window.jQuery.ui=="undefined"){throw"couldn't find jQuery UI at window.jQuery.ui"}jQuery(function(){jQuery(self.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(event,ui){var series=[];jQuery(self.legend.list).find("li").each(function(index,item){if(!item.series)return;series.push(item.series)});for(var i=self.graph.series.length-1;i>=0;i--){self.graph.series[i]=series.shift()}self.graph.update()}});jQuery(self.legend.list).disableSelection()});this.graph.onUpdate(function(){var h=window.getComputedStyle(self.legend.element).height;self.legend.element.style.height=h})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;this.addAnchor=function(line){var anchor=document.createElement("a");anchor.innerHTML="&#10004;";anchor.classList.add("action");line.element.insertBefore(anchor,line.element.firstChild);anchor.onclick=function(e){if(line.series.disabled){line.series.enable();line.element.classList.remove("disabled")}else{if(this.graph.series.filter(function(s){return!s.disabled}).length<=1)return;line.series.disable();line.element.classList.add("disabled")}self.graph.update()}.bind(this);var label=line.element.getElementsByTagName("span")[0];label.onclick=function(e){var disableAllOtherLines=line.series.disabled;if(!disableAllOtherLines){for(var i=0;i<self.legend.lines.length;i++){var l=self.legend.lines[i];if(line.series===l.series){}else if(l.series.disabled){}else{disableAllOtherLines=true;break}}}if(disableAllOtherLines){line.series.enable();line.element.classList.remove("disabled");self.legend.lines.forEach(function(l){if(line.series===l.series){}else{l.series.disable();l.element.classList.add("disabled")}})}else{self.legend.lines.forEach(function(l){l.series.enable();l.element.classList.remove("disabled")})}self.graph.update()}};if(this.legend){if(typeof jQuery!="undefined"&&jQuery(this.legend.list).sortable){jQuery(this.legend.list).sortable({start:function(event,ui){ui.item.bind("no.onclick",function(event){event.preventDefault()})},stop:function(event,ui){setTimeout(function(){ui.item.unbind("no.onclick")},250)}})}this.legend.lines.forEach(function(l){self.addAnchor(l)})}this._addBehavior=function(){this.graph.series.forEach(function(s){s.disable=function(){if(self.graph.series.length<=1){throw"only one series left"}s.disabled=true};s.enable=function(){s.disabled=false}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.DragZoom");Rickshaw.Graph.DragZoom=Rickshaw.Class.create({initialize:function(args){if(!args||!args.graph){throw new Error("Rickshaw.Graph.DragZoom needs a reference to a graph")}var defaults={opacity:.5,fill:"steelblue",minimumTimeSelection:60,callback:function(){}};this.graph=args.graph;this.svg=d3.select(this.graph.element).select("svg");this.svgWidth=parseInt(this.svg.attr("width"),10);this.opacity=args.opacity||defaults.opacity;this.fill=args.fill||defaults.fill;this.minimumTimeSelection=args.minimumTimeSelection||defaults.minimumTimeSelection;this.callback=args.callback||defaults.callback;this.registerMouseEvents()},registerMouseEvents:function(){var self=this;var ESCAPE_KEYCODE=27;var rectangle;var drag={startDt:null,stopDt:null,startPX:null,stopPX:null};this.svg.on("mousedown",onMousedown);function onMouseup(datum,index){drag.stopDt=pointAsDate(d3.event);var windowAfterDrag=[drag.startDt,drag.stopDt].sort(compareNumbers);self.graph.window.xMin=windowAfterDrag[0];self.graph.window.xMax=windowAfterDrag[1];var endTime=self.graph.window.xMax;var range=self.graph.window.xMax-self.graph.window.xMin;reset(this);if(range<self.minimumTimeSelection||isNaN(range)){return}self.graph.update();self.callback({range:range,endTime:endTime})}function onMousemove(){var offset=drag.stopPX=d3.event.offsetX||d3.event.layerX;if(offset>self.svgWidth-1||offset<1){return}var limits=[drag.startPX,offset].sort(compareNumbers);var selectionWidth=limits[1]-limits[0];if(isNaN(selectionWidth)){return reset(this)}rectangle.attr("fill",self.fill).attr("x",limits[0]).attr("width",selectionWidth)}function onMousedown(){var el=d3.select(this);rectangle=el.append("rect").style("opacity",self.opacity).attr("y",0).attr("height","100%");if(d3.event.preventDefault){d3.event.preventDefault()}else{d3.event.returnValue=false}drag.target=d3.event.target;drag.startDt=pointAsDate(d3.event);drag.startPX=d3.event.offsetX||d3.event.layerX;el.on("mousemove",onMousemove);d3.select(document).on("mouseup",onMouseup);d3.select(document).on("keyup",function(){if(d3.event.keyCode===ESCAPE_KEYCODE){reset(this)}})}function reset(el){var s=d3.select(el);s.on("mousemove",null);d3.select(document).on("mouseup",null);drag={};rectangle.remove()}function compareNumbers(a,b){return a-b}function pointAsDate(e){return Math.floor(self.graph.x.invert(e.offsetX||e.layerX))}}});Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(args){var graph=this.graph=args.graph;this.xFormatter=args.xFormatter||function(x){return new Date(x*1e3).toUTCString()};this.yFormatter=args.yFormatter||function(y){return y===null?y:y.toFixed(2)};var element=this.element=document.createElement("div");element.className="detail inactive";this.visible=true;graph.element.appendChild(element);this.lastEvent=null;this._addListeners();this.onShow=args.onShow;this.onHide=args.onHide;this.onRender=args.onRender;this.formatter=args.formatter||this.formatter},formatter:function(series,x,y,formattedX,formattedY,d){return series.name+":&nbsp;"+formattedY},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect|circle)$/))return;var graph=this.graph;var rect=graph.element.getBoundingClientRect();var eventX=e.clientX-rect.left;var eventY=e.clientY-rect.top;var j=0;var points=[];var nearestPoint;this.graph.series.active().forEach(function(series){var data=this.graph.stackedData[j++];if(!data.length)return;var domainX=graph.x.invert(eventX);var domainIndexScale=d3.scale.linear().domain([data[0].x,data.slice(-1)[0].x]).range([0,data.length-1]);var approximateIndex=Math.round(domainIndexScale(domainX));if(approximateIndex==data.length-1)approximateIndex--;var dataIndex=Math.min(approximateIndex||0,data.length-1);for(var i=approximateIndex;i<data.length-1;){if(!data[i]||!data[i+1])break;if(data[i].x<=domainX&&data[i+1].x>domainX){dataIndex=Math.abs(domainX-data[i].x)<Math.abs(domainX-data[i+1].x)?i:i+1;break}if(data[i+1].x<=domainX){i++}else{i--}}if(dataIndex<0)dataIndex=0;var value=data[dataIndex];var distance=Math.sqrt(Math.pow(Math.abs(graph.x(value.x)-eventX),2)+Math.pow(Math.abs(graph.y(value.y+value.y0)-eventY),2));var xFormatter=series.xFormatter||this.xFormatter;var yFormatter=series.yFormatter||this.yFormatter;var point={formattedXValue:xFormatter(value.x),formattedYValue:yFormatter(series.scale?series.scale.invert(value.y):value.y),series:series,value:value,distance:distance,order:j,name:series.name};if(!nearestPoint||distance<nearestPoint.distance){nearestPoint=point}points.push(point)},this);if(!nearestPoint)return;nearestPoint.active=true;var domainX=nearestPoint.value.x;var formattedXValue=nearestPoint.formattedXValue;this.element.innerHTML="";this.element.style.left=graph.x(domainX)+"px";this.visible&&this.render({points:points,detail:points,mouseX:eventX,mouseY:eventY,formattedXValue:formattedXValue,domainX:domainX})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(args){var graph=this.graph;var points=args.points;var point=points.filter(function(p){return p.active}).shift();if(point.value.y===null)return;var formattedXValue=point.formattedXValue;var formattedYValue=point.formattedYValue;this.element.innerHTML="";this.element.style.left=graph.x(point.value.x)+"px";var xLabel=document.createElement("div");xLabel.className="x_label";xLabel.innerHTML=formattedXValue;this.element.appendChild(xLabel);var item=document.createElement("div");item.className="item";var series=point.series;var actualY=series.scale?series.scale.invert(point.value.y):point.value.y;item.innerHTML=this.formatter(series,point.value.x,actualY,formattedXValue,formattedYValue,point);item.style.top=this.graph.y(point.value.y0+point.value.y)+"px";this.element.appendChild(item);var dot=document.createElement("div");dot.className="dot";dot.style.top=item.style.top;dot.style.borderColor=series.color;this.element.appendChild(dot);if(point.active){item.classList.add("active");dot.classList.add("active")}var alignables=[xLabel,item];alignables.forEach(function(el){el.classList.add("left")});this.show();var leftAlignError=this._calcLayoutError(alignables);if(leftAlignError>0){alignables.forEach(function(el){el.classList.remove("left");el.classList.add("right")});var rightAlignError=this._calcLayoutError(alignables);if(rightAlignError>leftAlignError){alignables.forEach(function(el){el.classList.remove("right");el.classList.add("left")})}}if(typeof this.onRender=="function"){this.onRender(args)}},_calcLayoutError:function(alignables){var parentRect=this.element.parentNode.getBoundingClientRect();var error=0;var alignRight=alignables.forEach(function(el){var rect=el.getBoundingClientRect();if(!rect.width){return}if(rect.right>parentRect.right){error+=rect.right-parentRect.right}if(rect.left<parentRect.left){error+=parentRect.left-rect.left}});return error},_addListeners:function(){this.mousemoveListener=function(e){this.visible=true;this.update(e)}.bind(this);this.graph.element.addEventListener("mousemove",this.mousemoveListener,false);this.graph.onUpdate(function(){this.update()}.bind(this));this.mouseoutListener=function(e){if(e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this);this.graph.element.addEventListener("mouseout",this.mouseoutListener,false)},_removeListeners:function(){if(this.mousemoveListener){this.graph.element.removeEventListener("mousemove",this.mousemoveListener,false)}if(this.mouseoutListener){this.graph.element.removeEventListener("mouseout",this.mouseoutListener,false)}}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){jQuery.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=Rickshaw.Class.create({className:"rickshaw_legend",initialize:function(args){this.element=args.element;this.graph=args.graph;this.naturalOrder=args.naturalOrder;this.colorKey=args.colorKey||"color";this.element.classList.add(this.className);this.list=document.createElement("ul");this.element.appendChild(this.list);this.render();this.graph.onUpdate(function(){})},render:function(){var self=this;while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.lines=[];var series=this.graph.series.map(function(s){return s});if(!this.naturalOrder){series=series.reverse()}series.forEach(function(s){self.addLine(s)})},addLine:function(series){var line=document.createElement("li");line.className="line";if(series.disabled){line.className+=" disabled"}if(series.className){d3.select(line).classed(series.className,true)}var swatch=document.createElement("div");swatch.className="swatch";swatch.style.backgroundColor=series[this.colorKey];line.appendChild(swatch);var label=document.createElement("span");label.className="label";label.innerHTML=series.name;line.appendChild(label);this.list.appendChild(line);line.series=series;if(series.noLegend){line.style.display="none"}var _line={element:line,series:series};if(this.shelving){this.shelving.addAnchor(_line);this.shelving.updateBehaviour()}if(this.highlighter){this.highlighter.addHighlightEvents(_line)}this.lines.push(_line);return line}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(args){var $=jQuery;var self=this;var element=this.element=args.element;var graphs=this.graphs=args.graphs;if(!graphs){graphs=this.graph=args.graph}if(graphs.constructor!==Array){graphs=[graphs]}this.graph=graphs[0];this.slideCallbacks=[];this.build();for(var i=0;i<graphs.length;i++){graphs[i].onUpdate(function(){self.update()}.bind(self));(function(idx){graphs[idx].onConfigure(function(){$(this.element)[0].style.width=graphs[idx].width+"px"}.bind(self))})(i)}},build:function(){var domain;var element=this.element;var $=jQuery;var self=this;var graphs=this.graphs||this.graph;if(graphs.constructor!==Array){graphs=[graphs]}this.graph=graphs[0];domain=graphs[0].dataDomain();$(function(){$(element).slider({range:true,min:domain[0],max:domain[1],values:[domain[0],domain[1]],start:function(event,ui){self.slideStarted({event:event,ui:ui})},stop:function(event,ui){self.slideFinished({event:event,ui:ui})},slide:function(event,ui){if(!self.slideShouldUpdate(event,ui))return;if(ui.values[1]<=ui.values[0])return;for(var i=0;i<graphs.length;i++){self.processSlideChange({event:event,ui:ui,graph:graphs[i]})}}})});graphs[0].onConfigure(function(){$(this.element)[0].style.width=graphs[0].width+"px"}.bind(this))},update:function(){var element=this.element;var graph=this.graph;var $=jQuery;var values=$(element).slider("option","values");var domain=graph.dataDomain();$(element).slider("option","min",domain[0]);$(element).slider("option","max",domain[1]);if(graph.window.xMin==null){values[0]=domain[0]}if(graph.window.xMax==null){values[1]=domain[1]}$(element).slider("option","values",values)},onSlide:function(callback){this.slideCallbacks.push(callback)},processSlideChange:function(args){var event=args.event;var ui=args.ui;var graph=args.graph;graph.window.xMin=ui.values[0];graph.window.xMax=ui.values[1];graph.update();var domain=graph.dataDomain();if(domain[0]==ui.values[0]){graph.window.xMin=undefined}if(domain[1]==ui.values[1]){graph.window.xMax=undefined}this.slideCallbacks.forEach(function(callback){callback(graph,graph.window.xMin,graph.window.xMax)})},slideShouldUpdate:function(){return true},slideStarted:function(){return},slideFinished:function(){return}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider.Preview");Rickshaw.Graph.RangeSlider.Preview=Rickshaw.Class.create({initialize:function(args){if(!args.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!args.graph&&!args.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=args.element;this.element.style.position="relative";this.graphs=args.graph?[args.graph]:args.graphs;this.defaults={height:75,width:400,gripperColor:undefined,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0,heightRatio:.2};this.heightRatio=args.heightRatio||this.defaults.heightRatio;this.defaults.gripperColor=d3.rgb(this.defaults.frameColor).darker().toString();this.configureCallbacks=[];this.slideCallbacks=[];this.previews=[];if(!args.width)this.widthFromGraph=true;if(!args.height)this.heightFromGraph=true;if(this.widthFromGraph||this.heightFromGraph){this.graphs[0].onConfigure(function(){this.configure(args);this.render()}.bind(this))}args.width=args.width||this.graphs[0].width||this.defaults.width;args.height=args.height||this.graphs[0].height*this.heightRatio||this.defaults.height;this.configure(args);this.render()},onSlide:function(callback){this.slideCallbacks.push(callback)},onConfigure:function(callback){this.configureCallbacks.push(callback)},configure:function(args){this.config=this.config||{};this.configureCallbacks.forEach(function(callback){callback(args)});Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this.config?this.config[k]:this.defaults[k]},this);if("width"in args||"height"in args){if(this.widthFromGraph){this.config.width=this.graphs[0].width}if(this.heightFromGraph){this.config.height=this.graphs[0].height*this.heightRatio;this.previewHeight=this.config.height}this.previews.forEach(function(preview){var height=this.previewHeight/this.graphs.length-this.config.frameTopThickness*2;var width=this.config.width-this.config.frameHandleThickness*2;preview.setSize({width:width,height:height});if(this.svg){var svgHeight=height+this.config.frameHandleThickness*2;var svgWidth=width+this.config.frameHandleThickness*2;this.svg.style("width",svgWidth+"px");this.svg.style("height",svgHeight+"px")}},this)}},render:function(){var self=this;this.svg=d3.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]);this.previewHeight=this.config.height-this.config.frameTopThickness*2;this.previewWidth=this.config.width-this.config.frameHandleThickness*2;this.currentFrame=[0,this.previewWidth];var buildGraph=function(parent,index){var graphArgs=Rickshaw.extend({},parent.config);var height=self.previewHeight/self.graphs.length;var renderer=parent.renderer.name;Rickshaw.extend(graphArgs,{element:this.appendChild(document.createElement("div")),height:height,width:self.previewWidth,series:parent.series,renderer:renderer});var graph=new Rickshaw.Graph(graphArgs);self.previews.push(graph);parent.onUpdate(function(){graph.render();self.render()});parent.onConfigure(function(args){delete args.height;args.width=args.width-self.config.frameHandleThickness*2;graph.configure(args);graph.render()});graph.render()};var graphContainer=d3.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs);var translateCommand="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";graphContainer.enter().append("div").classed("rickshaw_range_slider_preview_container",true).style("-webkit-transform",translateCommand).style("-moz-transform",translateCommand).style("-ms-transform",translateCommand).style("transform",translateCommand).each(buildGraph);graphContainer.exit().remove();var masterGraph=this.graphs[0];var domainScale=d3.scale.linear().domain([0,this.previewWidth]).range(masterGraph.dataDomain());var currentWindow=[masterGraph.window.xMin,masterGraph.window.xMax];this.currentFrame[0]=currentWindow[0]===undefined?0:Math.round(domainScale.invert(currentWindow[0]));if(this.currentFrame[0]<0)this.currentFrame[0]=0;this.currentFrame[1]=currentWindow[1]===undefined?this.previewWidth:domainScale.invert(currentWindow[1]);if(this.currentFrame[1]-this.currentFrame[0]<self.config.minimumFrameWidth){this.currentFrame[1]=(this.currentFrame[0]||0)+self.config.minimumFrameWidth}this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",true).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","absolute").style("top",0);this._renderDimming();this._renderFrame();this._renderGrippers();this._renderHandles();this._renderMiddle();this._registerMouseEvents()},_renderDimming:function(){var element=this.svg.selectAll("path.dimming").data([null]);element.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",true);var path="";path+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness;path+=" h "+this.previewWidth;path+=" v "+this.previewHeight;path+=" h "+-this.previewWidth;path+=" z ";path+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+Math.min(this.currentFrame[1]+this.config.frameHandleThickness*2,this.previewWidth+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderFrame:function(){var element=this.svg.selectAll("path.frame").data([null]);element.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",true);var path="";path+=" M "+this.currentFrame[0]+" 0";path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness*2);path+=" V "+this.config.height;path+=" H "+this.currentFrame[0];path+=" z";path+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderGrippers:function(){var gripper=this.svg.selectAll("path.gripper").data([null]);gripper.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",true);var path="";[.4,.6].forEach(function(spacing){path+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*spacing)+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7);path+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+spacing))+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7)}.bind(this));gripper.attr("d",path)},_renderHandles:function(){var leftHandle=this.svg.selectAll("rect.left_handle").data([null]);leftHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",true);leftHandle.attr("x",this.currentFrame[0]).attr("height",this.config.height);var rightHandle=this.svg.selectAll("rect.right_handle").data([null]);rightHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",true);rightHandle.attr("x",this.currentFrame[1]+this.config.frameHandleThickness).attr("height",this.config.height)},_renderMiddle:function(){var middleHandle=this.svg.selectAll("rect.middle_handle").data([null]);middleHandle.enter().append("rect").style("cursor","move").style("fill-opacity","0").classed("middle_handle",true);middleHandle.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness).attr("height",this.config.height)},_registerMouseEvents:function(){var element=d3.select(this.element);var drag={target:null,start:null,stop:null,left:false,right:false,rigid:false};var self=this;function onMousemove(datum,index){drag.stop=self._getClientXFromEvent(d3.event,drag);var distanceTraveled=drag.stop-drag.start;var frameAfterDrag=self.frameBeforeDrag.slice(0);var minimumFrameWidth=self.config.minimumFrameWidth;if(drag.rigid){minimumFrameWidth=self.frameBeforeDrag[1]-self.frameBeforeDrag[0]}if(drag.left){frameAfterDrag[0]=Math.max(frameAfterDrag[0]+distanceTraveled,0)}if(drag.right){frameAfterDrag[1]=Math.min(frameAfterDrag[1]+distanceTraveled,self.previewWidth)}var currentFrameWidth=frameAfterDrag[1]-frameAfterDrag[0];if(currentFrameWidth<=minimumFrameWidth){if(drag.left){frameAfterDrag[0]=frameAfterDrag[1]-minimumFrameWidth}if(drag.right){frameAfterDrag[1]=frameAfterDrag[0]+minimumFrameWidth}if(frameAfterDrag[0]<=0){frameAfterDrag[1]-=frameAfterDrag[0];frameAfterDrag[0]=0}if(frameAfterDrag[1]>=self.previewWidth){frameAfterDrag[0]-=frameAfterDrag[1]-self.previewWidth;frameAfterDrag[1]=self.previewWidth}}self.graphs.forEach(function(graph){var domainScale=d3.scale.linear().interpolate(d3.interpolateNumber).domain([0,self.previewWidth]).range(graph.dataDomain());var windowAfterDrag=[domainScale(frameAfterDrag[0]),domainScale(frameAfterDrag[1])];self.slideCallbacks.forEach(function(callback){callback(graph,windowAfterDrag[0],windowAfterDrag[1])});if(frameAfterDrag[0]===0){windowAfterDrag[0]=undefined}if(frameAfterDrag[1]===self.previewWidth){windowAfterDrag[1]=undefined}graph.window.xMin=windowAfterDrag[0];graph.window.xMax=windowAfterDrag[1];graph.update()})}function onMousedown(){drag.target=d3.event.target;drag.start=self._getClientXFromEvent(d3.event,drag);self.frameBeforeDrag=self.currentFrame.slice();d3.event.preventDefault?d3.event.preventDefault():d3.event.returnValue=false;d3.select(document).on("mousemove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("mouseup.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchmove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("touchend.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",onMouseup)}function onMousedownLeftHandle(datum,index){drag.left=true;onMousedown()}function onMousedownRightHandle(datum,index){drag.right=true;onMousedown()}function onMousedownMiddleHandle(datum,index){drag.left=true;drag.right=true;drag.rigid=true;onMousedown()}function onMouseup(datum,index){d3.select(document).on("mousemove.rickshaw_range_slider_preview",null);d3.select(document).on("mouseup.rickshaw_range_slider_preview",null);d3.select(document).on("touchmove.rickshaw_range_slider_preview",null);d3.select(document).on("touchend.rickshaw_range_slider_preview",null);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",null);delete self.frameBeforeDrag;drag.left=false;drag.right=false;drag.rigid=false}element.select("rect.left_handle").on("mousedown",onMousedownLeftHandle);element.select("rect.right_handle").on("mousedown",onMousedownRightHandle);element.select("rect.middle_handle").on("mousedown",onMousedownMiddleHandle);element.select("rect.left_handle").on("touchstart",onMousedownLeftHandle);element.select("rect.right_handle").on("touchstart",onMousedownRightHandle);element.select("rect.middle_handle").on("touchstart",onMousedownMiddleHandle)},_getClientXFromEvent:function(event,drag){switch(event.type){case"touchstart":case"touchmove":var touchList=event.changedTouches;var touch=null;for(var touchIndex=0;touchIndex<touchList.length;touchIndex++){if(touchList[touchIndex].target===drag.target){touch=touchList[touchIndex];break}}return touch!==null?touch.clientX:undefined;default:return event.clientX}}});Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.tension=args.tension||this.tension;this.configure(args)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false,opacity:1}},domain:function(data){var stackedData=data||this.graph.stackedData||this.graph.stackData();stackedData=stackedData.filter(function(a){return a&&a.length!==0});var xMin=+Infinity;var xMax=-Infinity;var yMin=+Infinity;var yMax=-Infinity;stackedData.forEach(function(series){series.forEach(function(d){if(d.y==null)return;var y=d.y+d.y0;if(y<yMin)yMin=y;if(y>yMax)yMax=y});if(!series.length)return;if(series[0].x<xMin)xMin=series[0].x;if(series[series.length-1].x>xMax)xMax=series[series.length-1].x});xMin-=(xMax-xMin)*this.padding.left;xMax+=(xMax-xMin)*this.padding.right;yMin=this.graph.min==="auto"?yMin:this.graph.min||0;yMax=this.graph.max===undefined?yMax:this.graph.max;if(this.graph.min==="auto"||yMin<0){yMin-=(yMax-yMin)*this.padding.bottom}if(this.graph.max===undefined){yMax+=(yMax-yMin)*this.padding.top}return{x:[xMin,xMax],y:[yMin,yMax]}},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var pathNodes=vis.selectAll("path.path").data(data).enter().append("svg:path").classed("path",true).attr("d",this.seriesPathFactory());if(this.stroke){var strokeNodes=vis.selectAll("path.stroke").data(data).enter().append("svg:path").classed("stroke",true).attr("d",this.seriesStrokeFactory())}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=pathNodes[0][i];if(this.stroke)series.stroke=strokeNodes[0][i];this._styleSeries(series);i++},this)},
+_styleSeries:function(series){var fill=this.fill?series.color:"none";var stroke=this.stroke?series.color:"none";var strokeWidth=series.strokeWidth?series.strokeWidth:this.strokeWidth;var opacity=series.opacity===undefined?this.opacity:series.opacity;series.path.setAttribute("fill",fill);series.path.setAttribute("stroke",stroke);series.path.setAttribute("stroke-width",strokeWidth);series.path.setAttribute("opacity",opacity);if(series.className){d3.select(series.path).classed(series.className,true)}if(series.className&&this.stroke){d3.select(series.stroke).classed(series.className,true)}},configure:function(args){args=args||{};Rickshaw.keys(this.defaults()).forEach(function(key){if(!args.hasOwnProperty(key)){this[key]=this[key]||this.graph[key]||this.defaults()[key];return}if(typeof this.defaults()[key]=="object"){Rickshaw.keys(this.defaults()[key]).forEach(function(k){this[key][k]=args[key][k]!==undefined?args[key][k]:this[key][k]!==undefined?this[key][k]:this.defaults()[key][k]},this)}else{this[key]=args[key]!==undefined?args[key]:this[key]!==undefined?this[key]:this.graph[key]!==undefined?this.graph[key]:this.defaults()[key]}},this)},setStrokeWidth:function(strokeWidth){if(strokeWidth!==undefined){this.strokeWidth=strokeWidth}},setTension:function(tension){if(tension!==undefined){this.tension=tension}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var defaults=Rickshaw.extend($super(),{gapSize:.05,unstack:false,opacity:1});delete defaults.tension;return defaults},initialize:function($super,args){args=args||{};this.gapSize=args.gapSize||this.gapSize;$super(args)},domain:function($super){var domain=$super();var frequentInterval=this._frequentInterval(this.graph.stackedData.slice(-1).shift());domain.x[1]+=Number(frequentInterval.magnitude);return domain},barWidth:function(series){var frequentInterval=this._frequentInterval(series.stack);var barWidth=this.graph.x.magnitude(frequentInterval.magnitude)*(1-this.gapSize);return barWidth},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var barWidth=this.barWidth(series.active()[0]);var barXOffset=0;var activeSeriesCount=series.filter(function(s){return!s.disabled}).length;var seriesBarWidth=this.unstack?barWidth/activeSeriesCount:barWidth;var transform=function(d){var matrix=[1,0,0,d.y<0?-1:1,0,d.y<0?graph.y.magnitude(Math.abs(d.y))*2:0];return"matrix("+matrix.join(",")+")"};series.forEach(function(series){if(series.disabled)return;var barWidth=this.barWidth(series);var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:rect").attr("x",function(d){return graph.x(d.x)+barXOffset}).attr("y",function(d){return graph.y(d.y0+Math.abs(d.y))*(d.y<0?-1:1)}).attr("width",seriesBarWidth).attr("height",function(d){return graph.y.magnitude(Math.abs(d.y))}).attr("opacity",series.opacity).attr("transform",transform);Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)});if(this.unstack)barXOffset+=seriesBarWidth},this)},_frequentInterval:function(data){var intervalCounts={};for(var i=0;i<data.length-1;i++){var interval=data[i+1].x-data[i].x;intervalCounts[interval]=intervalCounts[interval]||0;intervalCounts[interval]++}var frequentInterval={count:0,magnitude:1};var keysSorted=Rickshaw.keys(intervalCounts).sort(function asc(a,b){return Number(a)-Number(b)});keysSorted.forEach(function(i){if(frequentInterval.count<intervalCounts[i]){frequentInterval={count:intervalCounts[i],magnitude:i}}});return frequentInterval}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},seriesStrokeFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var method=this.unstack?"append":"insert";var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter()[method]("svg:g","g");nodes.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){nodes.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){if(!series.path)return;d3.select(series.path).select(".area").attr("fill",series.color);if(this.stroke){d3.select(series.path).select(".line").attr("fill","none").attr("stroke",series.stroke||d3.interpolateRgb(series.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(series.className){series.path.setAttribute("class",series.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,args){$super(args)},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();series.forEach(function(series){if(series.disabled)return;var opacity=series.opacity===undefined?1:series.opacity;var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize}).attr("opacity",function(d){return"opacity"in d?d.opacity:opacity});if(series.className){nodes.classed(series.className,true)}Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Multi");Rickshaw.Graph.Renderer.Multi=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"multi",initialize:function($super,args){$super(args)},defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},configure:function($super,args){args=args||{};this.config=args;$super(args)},domain:function($super){this.graph.stackData();var domains=[];var groups=this._groups();this._stack(groups);groups.forEach(function(group){var data=group.series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});if(!data.length)return;var domain=null;if(group.renderer&&group.renderer.domain){domain=group.renderer.domain(data)}else{domain=$super(data)}domains.push(domain)});var xMin=d3.min(domains.map(function(d){return d.x[0]}));var xMax=d3.max(domains.map(function(d){return d.x[1]}));var yMin=d3.min(domains.map(function(d){return d.y[0]}));var yMax=d3.max(domains.map(function(d){return d.y[1]}));return{x:[xMin,xMax],y:[yMin,yMax]}},_groups:function(){var graph=this.graph;var renderGroups={};graph.series.forEach(function(series){if(series.disabled)return;if(!renderGroups[series.renderer]){var ns="http://www.w3.org/2000/svg";var vis=document.createElementNS(ns,"g");graph.vis[0][0].appendChild(vis);var renderer=graph._renderers[series.renderer];var config={};var defaults=[this.defaults(),renderer.defaults(),this.config,this.graph];defaults.forEach(function(d){Rickshaw.extend(config,d)});renderer.configure(config);renderGroups[series.renderer]={renderer:renderer,series:[],vis:d3.select(vis)}}renderGroups[series.renderer].series.push(series)},this);var groups=[];Object.keys(renderGroups).forEach(function(key){var group=renderGroups[key];groups.push(group)});return groups},_stack:function(groups){groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});var data=series.map(function(series){return series.stack});if(!group.renderer.unstack){var layout=d3.layout.stack();var stackedData=Rickshaw.clone(layout(data));series.forEach(function(series,index){series._stack=Rickshaw.clone(stackedData[index])})}},this);return groups},render:function(){this.graph.series.forEach(function(series){if(!series.renderer){throw new Error("Each series needs a renderer for graph 'multi' renderer")}});this.graph.vis.selectAll("*").remove();var groups=this._groups();groups=this._stack(groups);groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});series.active=function(){return series};group.renderer.render({series:series,vis:group.vis});series.forEach(function(s){s.stack=s._stack||s.stack||s.data})})}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LinePlot");Rickshaw.Graph.Renderer.LinePlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"lineplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter().append("svg:path").attr("d",this.seriesPathFactory());var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this);series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("x").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});Array.prototype.forEach.call(nodes[0],function(n){if(!n)return;n.setAttribute("data-color",series.color);n.setAttribute("fill","white");n.setAttribute("stroke",series.color);n.setAttribute("stroke-width",this.strokeWidth)}.bind(this))},this)}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.element=args.element;this.aggregationScale=1;this.build();this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var self=this;var $=jQuery;if(this.element){$(function(){$(self.element).slider({min:1,max:100,slide:function(event,ui){self.setScale(ui.value)}})})}},setScale:function(scale){if(scale<1){throw"scale out of range: "+scale}this.aggregationScale=scale;this.graph.update()},transformer:function(data){if(this.aggregationScale==1)return data;var aggregatedData=[];data.forEach(function(seriesData){var aggregatedSeriesData=[];while(seriesData.length){var avgX=0,avgY=0;var slice=seriesData.splice(0,this.aggregationScale);slice.forEach(function(d){avgX+=d.x/slice.length;avgY+=d.y/slice.length});aggregatedSeriesData.push({x:avgX,y:avgY})}aggregatedData.push(aggregatedSeriesData)}.bind(this));return aggregatedData}});Rickshaw.namespace("Rickshaw.Graph.Socketio");Rickshaw.Graph.Socketio=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){var socket=io.connect(this.dataURL);var self=this;socket.on("rickshaw",function(data){self.success(data)})}});Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(data,palette,options){options=options||{};this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;var timeInterval=typeof options.timeInterval=="undefined"?1e3:options.timeInterval;this.setTimeInterval(timeInterval);if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this)}},addItem:function(item){if(typeof item.name==="undefined"){throw"addItem() needs a name"}item.color=item.color||this.palette.color(item.name);item.data=item.data||[];if(item.data.length===0&&this.length&&this.getIndex()>0){this[0].data.forEach(function(plot){item.data.push({x:plot.x,y:0})})}else if(item.data.length===0){item.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},addData:function(data,x){var index=this.getIndex();Rickshaw.keys(data).forEach(function(name){if(!this.itemByName(name)){this.addItem({name:name})}},this);this.forEach(function(item){item.data.push({x:x||(index*this.timeInterval||1)+this.timeBase,y:data[item.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(name){for(var i=0;i<this.length;i++){if(this[i].name==name)return this[i]}},setTimeInterval:function(iv){this.timeInterval=iv/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var data={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(item){var newItem={color:item.color,name:item.name,data:[]};item.data.forEach(function(plot){newItem.data.push({x:plot.x,y:plot.y})});data.items.push(newItem)});return data},load:function(data){if(data.timeInterval){this.timeInterval=data.timeInterval}if(data.timeBase){this.timeBase=data.timeBase}if(data.items){data.items.forEach(function(item){this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},this)}}});Rickshaw.Series.zeroFill=function(series){Rickshaw.Series.fill(series,0)};Rickshaw.Series.fill=function(series,fill){var x;var i=0;var data=series.map(function(s){return s.data});while(i<Math.max.apply(null,data.map(function(d){return d.length}))){x=Math.min.apply(null,data.filter(function(d){return d[i]}).map(function(d){return d[i].x}));data.forEach(function(d){if(!d[i]||d[i].x!=x){d.splice(i,0,{x:x,y:fill})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(data,palette,options){options=options||{};if(typeof options.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof options.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;this.setTimeInterval(options.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=options.maxDataPoints;if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>1;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(item){item.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,data,x){$super(data,x);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(item){item.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});return Rickshaw});
index de11d2d479e44a7a657e16d893c1d72618cbaf12..ca8e27fb1fe5797f28c30893f172f0a0827432cd 100644 (file)
@@ -1,4 +1,4 @@
-http://code.jquery.com/jquery-1.12.0.js
+https://code.jquery.com/jquery-3.7.1.js
 https://github.com/mbostock/d3/releases/download/v3.5.13/d3.zip
-https://github.com/shutterstock/rickshaw/archive/v1.5.1.tar.gz
-https://github.com/moment/moment/archive/2.11.1.tar.gz
+https://github.com/shutterstock/rickshaw/archive/refs/tags/v1.7.0.tar.gz
+https://github.com/moment/moment/archive/refs/tags/2.30.1.tar.gz
\ No newline at end of file
index 4855adcbf1428c5ec21d812291f4411a73d05eae..1a86433c223039bda5f68f8b6ef10d15e5e0eff7 100644 (file)
@@ -1,27 +1,26 @@
 /*!
- * jQuery JavaScript Library v1.12.0
- * http://jquery.com/
+ * jQuery JavaScript Library v3.7.1
+ * https://jquery.com/
  *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
+ * Copyright OpenJS Foundation and other contributors
  * Released under the MIT license
- * http://jquery.org/license
+ * https://jquery.org/license
  *
- * Date: 2016-01-08T19:56Z
+ * Date: 2023-08-28T13:37Z
  */
+( function( global, factory ) {
 
-(function( global, factory ) {
+       "use strict";
 
        if ( typeof module === "object" && typeof module.exports === "object" ) {
+
                // For CommonJS and CommonJS-like environments where a proper `window`
                // is present, execute the factory and get jQuery.
                // For environments that do not have a `window` with a `document`
                // (such as Node.js), expose a factory as module.exports.
                // This accentuates the need for the creation of a real `window`.
                // e.g. var jQuery = require("jquery")(window);
-               // See ticket #14549 for more info.
+               // See ticket trac-14549 for more info.
                module.exports = global.document ?
                        factory( global, true ) :
                        function( w ) {
        }
 
 // Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
 
-// Support: Firefox 18+
-// Can't be in strict mode, several libs including ASP.NET trace
-// the stack via arguments.caller.callee and Firefox dies if
-// you try to trace through "use strict" call chains. (#13335)
-//"use strict";
-var deletedIds = [];
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
 
-var document = window.document;
+var arr = [];
+
+var getProto = Object.getPrototypeOf;
 
-var slice = deletedIds.slice;
+var slice = arr.slice;
+
+var flat = arr.flat ? function( array ) {
+       return arr.flat.call( array );
+} : function( array ) {
+       return arr.concat.apply( [], array );
+};
 
-var concat = deletedIds.concat;
 
-var push = deletedIds.push;
+var push = arr.push;
 
-var indexOf = deletedIds.indexOf;
+var indexOf = arr.indexOf;
 
 var class2type = {};
 
@@ -60,12 +65,91 @@ var toString = class2type.toString;
 
 var hasOwn = class2type.hasOwnProperty;
 
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
 var support = {};
 
+var isFunction = function isFunction( obj ) {
+
+               // Support: Chrome <=57, Firefox <=52
+               // In some browsers, typeof returns "function" for HTML <object> elements
+               // (i.e., `typeof document.createElement( "object" ) === "function"`).
+               // We don't want to classify *any* DOM node as a function.
+               // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5
+               // Plus for old WebKit, typeof returns "function" for HTML collections
+               // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)
+               return typeof obj === "function" && typeof obj.nodeType !== "number" &&
+                       typeof obj.item !== "function";
+       };
 
 
-var
-       version = "1.12.0",
+var isWindow = function isWindow( obj ) {
+               return obj != null && obj === obj.window;
+       };
+
+
+var document = window.document;
+
+
+
+       var preservedScriptAttributes = {
+               type: true,
+               src: true,
+               nonce: true,
+               noModule: true
+       };
+
+       function DOMEval( code, node, doc ) {
+               doc = doc || document;
+
+               var i, val,
+                       script = doc.createElement( "script" );
+
+               script.text = code;
+               if ( node ) {
+                       for ( i in preservedScriptAttributes ) {
+
+                               // Support: Firefox 64+, Edge 18+
+                               // Some browsers don't support the "nonce" property on scripts.
+                               // On the other hand, just using `getAttribute` is not enough as
+                               // the `nonce` attribute is reset to an empty string whenever it
+                               // becomes browsing-context connected.
+                               // See https://github.com/whatwg/html/issues/2369
+                               // See https://html.spec.whatwg.org/#nonce-attributes
+                               // The `node.getAttribute` check was added for the sake of
+                               // `jQuery.globalEval` so that it can fake a nonce-containing node
+                               // via an object.
+                               val = node[ i ] || node.getAttribute && node.getAttribute( i );
+                               if ( val ) {
+                                       script.setAttribute( i, val );
+                               }
+                       }
+               }
+               doc.head.appendChild( script ).parentNode.removeChild( script );
+       }
+
+
+function toType( obj ) {
+       if ( obj == null ) {
+               return obj + "";
+       }
+
+       // Support: Android <=2.3 only (functionish RegExp)
+       return typeof obj === "object" || typeof obj === "function" ?
+               class2type[ toString.call( obj ) ] || "object" :
+               typeof obj;
+}
+/* global Symbol */
+// Defining this global in .eslintrc.json would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
+
+
+var version = "3.7.1",
+
+       rhtmlSuffix = /HTML$/i,
 
        // Define a local copy of jQuery
        jQuery = function( selector, context ) {
@@ -73,19 +157,6 @@ var
                // The jQuery object is actually just the init constructor 'enhanced'
                // Need init if jQuery is called (just allow error to be thrown if not included)
                return new jQuery.fn.init( selector, context );
-       },
-
-       // Support: Android<4.1, IE<9
-       // Make sure we trim BOM and NBSP
-       rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-       // Matches dashed string for camelizing
-       rmsPrefix = /^-ms-/,
-       rdashAlpha = /-([\da-z])/gi,
-
-       // Used by jQuery.camelCase as callback to replace()
-       fcamelCase = function( all, letter ) {
-               return letter.toUpperCase();
        };
 
 jQuery.fn = jQuery.prototype = {
@@ -95,9 +166,6 @@ jQuery.fn = jQuery.prototype = {
 
        constructor: jQuery,
 
-       // Start with an empty selector
-       selector: "",
-
        // The default length of a jQuery object is 0
        length: 0,
 
@@ -108,13 +176,14 @@ jQuery.fn = jQuery.prototype = {
        // Get the Nth element in the matched element set OR
        // Get the whole matched element set as a clean array
        get: function( num ) {
-               return num != null ?
 
-                       // Return just the one element from the set
-                       ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+               // Return all the elements in a clean array
+               if ( num == null ) {
+                       return slice.call( this );
+               }
 
-                       // Return all the elements in a clean array
-                       slice.call( this );
+               // Return just the one element from the set
+               return num < 0 ? this[ num + this.length ] : this[ num ];
        },
 
        // Take an array of elements and push it onto the stack
@@ -126,7 +195,6 @@ jQuery.fn = jQuery.prototype = {
 
                // Add the old object onto the stack (as a reference)
                ret.prevObject = this;
-               ret.context = this.context;
 
                // Return the newly-formed element set
                return ret;
@@ -155,6 +223,18 @@ jQuery.fn = jQuery.prototype = {
                return this.eq( -1 );
        },
 
+       even: function() {
+               return this.pushStack( jQuery.grep( this, function( _elem, i ) {
+                       return ( i + 1 ) % 2;
+               } ) );
+       },
+
+       odd: function() {
+               return this.pushStack( jQuery.grep( this, function( _elem, i ) {
+                       return i % 2;
+               } ) );
+       },
+
        eq: function( i ) {
                var len = this.length,
                        j = +i + ( i < 0 ? len : 0 );
@@ -168,12 +248,12 @@ jQuery.fn = jQuery.prototype = {
        // For internal use only.
        // Behaves like an Array's method, not like a jQuery method.
        push: push,
-       sort: deletedIds.sort,
-       splice: deletedIds.splice
+       sort: arr.sort,
+       splice: arr.splice
 };
 
 jQuery.extend = jQuery.fn.extend = function() {
-       var src, copyIsArray, copy, name, options, clone,
+       var options, name, src, copy, copyIsArray, clone,
                target = arguments[ 0 ] || {},
                i = 1,
                length = arguments.length,
@@ -183,17 +263,17 @@ jQuery.extend = jQuery.fn.extend = function() {
        if ( typeof target === "boolean" ) {
                deep = target;
 
-               // skip the boolean and the target
+               // Skip the boolean and the target
                target = arguments[ i ] || {};
                i++;
        }
 
        // Handle case when target is a string or something (possible in deep copy)
-       if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
+       if ( typeof target !== "object" && !isFunction( target ) ) {
                target = {};
        }
 
-       // extend jQuery itself if only one argument is passed
+       // Extend jQuery itself if only one argument is passed
        if ( i === length ) {
                target = this;
                i--;
@@ -206,25 +286,28 @@ jQuery.extend = jQuery.fn.extend = function() {
 
                        // Extend the base object
                        for ( name in options ) {
-                               src = target[ name ];
                                copy = options[ name ];
 
+                               // Prevent Object.prototype pollution
                                // Prevent never-ending loop
-                               if ( target === copy ) {
+                               if ( name === "__proto__" || target === copy ) {
                                        continue;
                                }
 
                                // Recurse if we're merging plain objects or arrays
                                if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
-                                       ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
-
-                                       if ( copyIsArray ) {
-                                               copyIsArray = false;
-                                               clone = src && jQuery.isArray( src ) ? src : [];
-
+                                       ( copyIsArray = Array.isArray( copy ) ) ) ) {
+                                       src = target[ name ];
+
+                                       // Ensure proper type for the source value
+                                       if ( copyIsArray && !Array.isArray( src ) ) {
+                                               clone = [];
+                                       } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
+                                               clone = {};
                                        } else {
-                                               clone = src && jQuery.isPlainObject( src ) ? src : {};
+                                               clone = src;
                                        }
+                                       copyIsArray = false;
 
                                        // Never move original objects, clone them
                                        target[ name ] = jQuery.extend( deep, clone, copy );
@@ -255,110 +338,40 @@ jQuery.extend( {
 
        noop: function() {},
 
-       // See test/unit/core.js for details concerning isFunction.
-       // Since version 1.3, DOM methods and functions like alert
-       // aren't supported. They return false on IE (#2968).
-       isFunction: function( obj ) {
-               return jQuery.type( obj ) === "function";
-       },
-
-       isArray: Array.isArray || function( obj ) {
-               return jQuery.type( obj ) === "array";
-       },
-
-       isWindow: function( obj ) {
-               /* jshint eqeqeq: false */
-               return obj != null && obj == obj.window;
-       },
-
-       isNumeric: function( obj ) {
-
-               // parseFloat NaNs numeric-cast false positives (null|true|false|"")
-               // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
-               // subtraction forces infinities to NaN
-               // adding 1 corrects loss of precision from parseFloat (#15100)
-               var realStringObj = obj && obj.toString();
-               return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
-       },
-
-       isEmptyObject: function( obj ) {
-               var name;
-               for ( name in obj ) {
-                       return false;
-               }
-               return true;
-       },
-
        isPlainObject: function( obj ) {
-               var key;
+               var proto, Ctor;
 
-               // Must be an Object.
-               // Because of IE, we also have to check the presence of the constructor property.
-               // Make sure that DOM nodes and window objects don't pass through, as well
-               if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+               // Detect obvious negatives
+               // Use toString instead of jQuery.type to catch host objects
+               if ( !obj || toString.call( obj ) !== "[object Object]" ) {
                        return false;
                }
 
-               try {
-
-                       // Not own constructor property must be Object
-                       if ( obj.constructor &&
-                               !hasOwn.call( obj, "constructor" ) &&
-                               !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
-                               return false;
-                       }
-               } catch ( e ) {
-
-                       // IE8,9 Will throw exceptions on certain host objects #9897
-                       return false;
-               }
+               proto = getProto( obj );
 
-               // Support: IE<9
-               // Handle iteration over inherited properties before own properties.
-               if ( !support.ownFirst ) {
-                       for ( key in obj ) {
-                               return hasOwn.call( obj, key );
-                       }
+               // Objects with no prototype (e.g., `Object.create( null )`) are plain
+               if ( !proto ) {
+                       return true;
                }
 
-               // Own properties are enumerated firstly, so to speed up,
-               // if last one is own, then all properties are own.
-               for ( key in obj ) {}
-
-               return key === undefined || hasOwn.call( obj, key );
+               // Objects with prototype are plain iff they were constructed by a global Object function
+               Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
+               return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
        },
 
-       type: function( obj ) {
-               if ( obj == null ) {
-                       return obj + "";
-               }
-               return typeof obj === "object" || typeof obj === "function" ?
-                       class2type[ toString.call( obj ) ] || "object" :
-                       typeof obj;
-       },
-
-       // Workarounds based on findings by Jim Driscoll
-       // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-       globalEval: function( data ) {
-               if ( data && jQuery.trim( data ) ) {
+       isEmptyObject: function( obj ) {
+               var name;
 
-                       // We use execScript on Internet Explorer
-                       // We use an anonymous function so that context is window
-                       // rather than jQuery in Firefox
-                       ( window.execScript || function( data ) {
-                               window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation
-                       } )( data );
+               for ( name in obj ) {
+                       return false;
                }
+               return true;
        },
 
-       // Convert dashed to camelCase; used by the css and data modules
-       // Microsoft forgot to hump their vendor prefix (#9572)
-       camelCase: function( string ) {
-               return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-       },
-
-       nodeName: function( elem, name ) {
-               return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+       // Evaluates a script in a provided context; falls back to the global one
+       // if not specified.
+       globalEval: function( code, options, doc ) {
+               DOMEval( code, { nonce: options && options.nonce }, doc );
        },
 
        each: function( obj, callback ) {
@@ -382,11 +395,36 @@ jQuery.extend( {
                return obj;
        },
 
-       // Support: Android<4.1, IE<9
-       trim: function( text ) {
-               return text == null ?
-                       "" :
-                       ( text + "" ).replace( rtrim, "" );
+
+       // Retrieve the text value of an array of DOM nodes
+       text: function( elem ) {
+               var node,
+                       ret = "",
+                       i = 0,
+                       nodeType = elem.nodeType;
+
+               if ( !nodeType ) {
+
+                       // If no nodeType, this is expected to be an array
+                       while ( ( node = elem[ i++ ] ) ) {
+
+                               // Do not traverse comment nodes
+                               ret += jQuery.text( node );
+                       }
+               }
+               if ( nodeType === 1 || nodeType === 11 ) {
+                       return elem.textContent;
+               }
+               if ( nodeType === 9 ) {
+                       return elem.documentElement.textContent;
+               }
+               if ( nodeType === 3 || nodeType === 4 ) {
+                       return elem.nodeValue;
+               }
+
+               // Do not include comment or processing instruction nodes
+
+               return ret;
        },
 
        // results is for internal usage only
@@ -397,7 +435,7 @@ jQuery.extend( {
                        if ( isArrayLike( Object( arr ) ) ) {
                                jQuery.merge( ret,
                                        typeof arr === "string" ?
-                                       [ arr ] : arr
+                                               [ arr ] : arr
                                );
                        } else {
                                push.call( ret, arr );
@@ -408,43 +446,27 @@ jQuery.extend( {
        },
 
        inArray: function( elem, arr, i ) {
-               var len;
-
-               if ( arr ) {
-                       if ( indexOf ) {
-                               return indexOf.call( arr, elem, i );
-                       }
-
-                       len = arr.length;
-                       i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-                       for ( ; i < len; i++ ) {
+               return arr == null ? -1 : indexOf.call( arr, elem, i );
+       },
 
-                               // Skip accessing in sparse arrays
-                               if ( i in arr && arr[ i ] === elem ) {
-                                       return i;
-                               }
-                       }
-               }
+       isXMLDoc: function( elem ) {
+               var namespace = elem && elem.namespaceURI,
+                       docElem = elem && ( elem.ownerDocument || elem ).documentElement;
 
-               return -1;
+               // Assume HTML when documentElement doesn't yet exist, such as inside
+               // document fragments.
+               return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" );
        },
 
+       // Support: Android <=4.0 only, PhantomJS 1 only
+       // push.apply(_, arraylike) throws on ancient WebKit
        merge: function( first, second ) {
                var len = +second.length,
                        j = 0,
                        i = first.length;
 
-               while ( j < len ) {
-                       first[ i++ ] = second[ j++ ];
-               }
-
-               // Support: IE<9
-               // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
-               if ( len !== len ) {
-                       while ( second[ j ] !== undefined ) {
-                               first[ i++ ] = second[ j++ ];
-                       }
+               for ( ; j < len; j++ ) {
+                       first[ i++ ] = second[ j ];
                }
 
                first.length = i;
@@ -500,125 +522,141 @@ jQuery.extend( {
                }
 
                // Flatten any nested arrays
-               return concat.apply( [], ret );
+               return flat( ret );
        },
 
        // A global GUID counter for objects
        guid: 1,
 
-       // Bind a function to a context, optionally partially applying any
-       // arguments.
-       proxy: function( fn, context ) {
-               var args, proxy, tmp;
-
-               if ( typeof context === "string" ) {
-                       tmp = fn[ context ];
-                       context = fn;
-                       fn = tmp;
-               }
-
-               // Quick check to determine if target is callable, in the spec
-               // this throws a TypeError, but we will just return undefined.
-               if ( !jQuery.isFunction( fn ) ) {
-                       return undefined;
-               }
-
-               // Simulated bind
-               args = slice.call( arguments, 2 );
-               proxy = function() {
-                       return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
-               };
-
-               // Set the guid of unique handler to the same of original handler, so it can be removed
-               proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-               return proxy;
-       },
-
-       now: function() {
-               return +( new Date() );
-       },
-
        // jQuery.support is not used in Core but other projects attach their
        // properties to it so it needs to exist.
        support: support
 } );
 
-// JSHint would error on this code due to the Symbol not being defined in ES5.
-// Defining this global in .jshintrc would create a danger of using the global
-// unguarded in another place, it seems safer to just disable JSHint for these
-// three lines.
-/* jshint ignore: start */
 if ( typeof Symbol === "function" ) {
-       jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ];
+       jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
 }
-/* jshint ignore: end */
 
 // Populate the class2type map
 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
-function( i, name ) {
-       class2type[ "[object " + name + "]" ] = name.toLowerCase();
-} );
+       function( _i, name ) {
+               class2type[ "[object " + name + "]" ] = name.toLowerCase();
+       } );
 
 function isArrayLike( obj ) {
 
-       // Support: iOS 8.2 (not reproducible in simulator)
+       // Support: real iOS 8.2 only (not reproducible in simulator)
        // `in` check used to prevent JIT error (gh-2145)
        // hasOwn isn't used here due to false negatives
        // regarding Nodelist length in IE
        var length = !!obj && "length" in obj && obj.length,
-               type = jQuery.type( obj );
+               type = toType( obj );
 
-       if ( type === "function" || jQuery.isWindow( obj ) ) {
+       if ( isFunction( obj ) || isWindow( obj ) ) {
                return false;
        }
 
        return type === "array" || length === 0 ||
                typeof length === "number" && length > 0 && ( length - 1 ) in obj;
 }
-var Sizzle =
-/*!
- * Sizzle CSS Selector Engine v2.2.1
- * http://sizzlejs.com/
- *
- * Copyright jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2015-10-17
- */
-(function( window ) {
+
+
+function nodeName( elem, name ) {
+
+       return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+
+}
+var pop = arr.pop;
+
+
+var sort = arr.sort;
+
+
+var splice = arr.splice;
+
+
+var whitespace = "[\\x20\\t\\r\\n\\f]";
+
+
+var rtrimCSS = new RegExp(
+       "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
+       "g"
+);
+
+
+
+
+// Note: an element does not contain itself
+jQuery.contains = function( a, b ) {
+       var bup = b && b.parentNode;
+
+       return a === bup || !!( bup && bup.nodeType === 1 && (
+
+               // Support: IE 9 - 11+
+               // IE doesn't have `contains` on SVG.
+               a.contains ?
+                       a.contains( bup ) :
+                       a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+       ) );
+};
+
+
+
+
+// CSS string/identifier serialization
+// https://drafts.csswg.org/cssom/#common-serializing-idioms
+var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
+
+function fcssescape( ch, asCodePoint ) {
+       if ( asCodePoint ) {
+
+               // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
+               if ( ch === "\0" ) {
+                       return "\uFFFD";
+               }
+
+               // Control characters and (dependent upon position) numbers get escaped as code points
+               return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+       }
+
+       // Other potentially-special ASCII characters get backslash-escaped
+       return "\\" + ch;
+}
+
+jQuery.escapeSelector = function( sel ) {
+       return ( sel + "" ).replace( rcssescape, fcssescape );
+};
+
+
+
+
+var preferredDoc = document,
+       pushNative = push;
+
+( function() {
 
 var i,
-       support,
        Expr,
-       getText,
-       isXML,
-       tokenize,
-       compile,
-       select,
        outermostContext,
        sortInput,
        hasDuplicate,
+       push = pushNative,
 
        // Local document vars
-       setDocument,
        document,
-       docElem,
+       documentElement,
        documentIsHTML,
        rbuggyQSA,
-       rbuggyMatches,
        matches,
-       contains,
 
        // Instance-specific data
-       expando = "sizzle" + 1 * new Date(),
-       preferredDoc = window.document,
+       expando = jQuery.expando,
        dirruns = 0,
        done = 0,
        classCache = createCache(),
        tokenCache = createCache(),
        compilerCache = createCache(),
+       nonnativeSelectorCache = createCache(),
        sortOrder = function( a, b ) {
                if ( a === b ) {
                        hasDuplicate = true;
@@ -626,151 +664,146 @@ var i,
                return 0;
        },
 
-       // General-purpose constants
-       MAX_NEGATIVE = 1 << 31,
-
-       // Instance methods
-       hasOwn = ({}).hasOwnProperty,
-       arr = [],
-       pop = arr.pop,
-       push_native = arr.push,
-       push = arr.push,
-       slice = arr.slice,
-       // Use a stripped-down indexOf as it's faster than native
-       // http://jsperf.com/thor-indexof-vs-for/5
-       indexOf = function( list, elem ) {
-               var i = 0,
-                       len = list.length;
-               for ( ; i < len; i++ ) {
-                       if ( list[i] === elem ) {
-                               return i;
-                       }
-               }
-               return -1;
-       },
-
-       booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+       booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" +
+               "loop|multiple|open|readonly|required|scoped",
 
        // Regular expressions
 
-       // http://www.w3.org/TR/css3-selectors/#whitespace
-       whitespace = "[\\x20\\t\\r\\n\\f]",
+       // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
+       identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
+               "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
 
-       // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
-       identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
-
-       // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+       // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
        attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+
                // Operator (capture 2)
                "*([*^$|!~]?=)" + whitespace +
+
                // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
-               "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
-               "*\\]",
+               "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
+               whitespace + "*\\]",
 
        pseudos = ":(" + identifier + ")(?:\\((" +
+
                // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
                // 1. quoted (capture 3; capture 4 or capture 5)
                "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+
                // 2. simple (capture 6)
                "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+
                // 3. anything else (capture 2)
                ".*" +
                ")\\)|)",
 
        // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
        rwhitespace = new RegExp( whitespace + "+", "g" ),
-       rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
 
        rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
-       rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
-
-       rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+       rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" +
+               whitespace + "*" ),
+       rdescend = new RegExp( whitespace + "|>" ),
 
        rpseudo = new RegExp( pseudos ),
        ridentifier = new RegExp( "^" + identifier + "$" ),
 
        matchExpr = {
-               "ID": new RegExp( "^#(" + identifier + ")" ),
-               "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
-               "TAG": new RegExp( "^(" + identifier + "|[*])" ),
-               "ATTR": new RegExp( "^" + attributes ),
-               "PSEUDO": new RegExp( "^" + pseudos ),
-               "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
-                       "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-                       "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-               "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+               ID: new RegExp( "^#(" + identifier + ")" ),
+               CLASS: new RegExp( "^\\.(" + identifier + ")" ),
+               TAG: new RegExp( "^(" + identifier + "|[*])" ),
+               ATTR: new RegExp( "^" + attributes ),
+               PSEUDO: new RegExp( "^" + pseudos ),
+               CHILD: new RegExp(
+                       "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
+                               whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
+                               whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+               bool: new RegExp( "^(?:" + booleans + ")$", "i" ),
+
                // For use in libraries implementing .is()
                // We use this for POS matching in `select`
-               "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
-                       whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+               needsContext: new RegExp( "^" + whitespace +
+                       "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
+                       "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
        },
 
        rinputs = /^(?:input|select|textarea|button)$/i,
        rheader = /^h\d$/i,
 
-       rnative = /^[^{]+\{\s*\[native \w/,
-
        // Easily-parseable/retrievable ID or TAG or CLASS selectors
        rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
 
        rsibling = /[+~]/,
-       rescape = /'|\\/g,
-
-       // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
-       runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
-       funescape = function( _, escaped, escapedWhitespace ) {
-               var high = "0x" + escaped - 0x10000;
-               // NaN means non-codepoint
-               // Support: Firefox<24
-               // Workaround erroneous numeric interpretation of +"0x"
-               return high !== high || escapedWhitespace ?
-                       escaped :
-                       high < 0 ?
-                               // BMP codepoint
-                               String.fromCharCode( high + 0x10000 ) :
-                               // Supplemental Plane codepoint (surrogate pair)
-                               String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
-       },
-
-       // Used for iframes
-       // See setDocument()
+
+       // CSS escapes
+       // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+       runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
+               "?|\\\\([^\\r\\n\\f])", "g" ),
+       funescape = function( escape, nonHex ) {
+               var high = "0x" + escape.slice( 1 ) - 0x10000;
+
+               if ( nonHex ) {
+
+                       // Strip the backslash prefix from a non-hex escape sequence
+                       return nonHex;
+               }
+
+               // Replace a hexadecimal escape sequence with the encoded Unicode code point
+               // Support: IE <=11+
+               // For values outside the Basic Multilingual Plane (BMP), manually construct a
+               // surrogate pair
+               return high < 0 ?
+                       String.fromCharCode( high + 0x10000 ) :
+                       String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+       },
+
+       // Used for iframes; see `setDocument`.
+       // Support: IE 9 - 11+, Edge 12 - 18+
        // Removing the function wrapper causes a "Permission Denied"
-       // error in IE
+       // error in IE/Edge.
        unloadHandler = function() {
                setDocument();
-       };
+       },
+
+       inDisabledFieldset = addCombinator(
+               function( elem ) {
+                       return elem.disabled === true && nodeName( elem, "fieldset" );
+               },
+               { dir: "parentNode", next: "legend" }
+       );
+
+// Support: IE <=9 only
+// Accessing document.activeElement can throw unexpectedly
+// https://bugs.jquery.com/ticket/13393
+function safeActiveElement() {
+       try {
+               return document.activeElement;
+       } catch ( err ) { }
+}
 
 // Optimize for push.apply( _, NodeList )
 try {
        push.apply(
-               (arr = slice.call( preferredDoc.childNodes )),
+               ( arr = slice.call( preferredDoc.childNodes ) ),
                preferredDoc.childNodes
        );
-       // Support: Android<4.0
+
+       // Support: Android <=4.0
        // Detect silently failing push.apply
+       // eslint-disable-next-line no-unused-expressions
        arr[ preferredDoc.childNodes.length ].nodeType;
 } catch ( e ) {
-       push = { apply: arr.length ?
-
-               // Leverage slice if possible
-               function( target, els ) {
-                       push_native.apply( target, slice.call(els) );
-               } :
-
-               // Support: IE<9
-               // Otherwise append directly
-               function( target, els ) {
-                       var j = target.length,
-                               i = 0;
-                       // Can't trust NodeList.length
-                       while ( (target[j++] = els[i++]) ) {}
-                       target.length = j - 1;
+       push = {
+               apply: function( target, els ) {
+                       pushNative.apply( target, slice.call( els ) );
+               },
+               call: function( target ) {
+                       pushNative.apply( target, slice.call( arguments, 1 ) );
                }
        };
 }
 
-function Sizzle( selector, context, results, seed ) {
-       var m, i, elem, nid, nidselect, match, groups, newSelector,
+function find( selector, context, results, seed ) {
+       var m, i, elem, nid, match, groups, newSelector,
                newContext = context && context.ownerDocument,
 
                // nodeType defaults to 9, since context defaults to document
@@ -787,30 +820,26 @@ function Sizzle( selector, context, results, seed ) {
 
        // Try to shortcut find operations (as opposed to filters) in HTML documents
        if ( !seed ) {
-
-               if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
-                       setDocument( context );
-               }
+               setDocument( context );
                context = context || document;
 
                if ( documentIsHTML ) {
 
                        // If the selector is sufficiently simple, try using a "get*By*" DOM method
                        // (excepting DocumentFragment context, where the methods don't exist)
-                       if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+                       if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
 
                                // ID selector
-                               if ( (m = match[1]) ) {
+                               if ( ( m = match[ 1 ] ) ) {
 
                                        // Document context
                                        if ( nodeType === 9 ) {
-                                               if ( (elem = context.getElementById( m )) ) {
+                                               if ( ( elem = context.getElementById( m ) ) ) {
 
-                                                       // Support: IE, Opera, Webkit
-                                                       // TODO: identify versions
+                                                       // Support: IE 9 only
                                                        // getElementById can match elements by name instead of ID
                                                        if ( elem.id === m ) {
-                                                               results.push( elem );
+                                                               push.call( results, elem );
                                                                return results;
                                                        }
                                                } else {
@@ -820,79 +849,86 @@ function Sizzle( selector, context, results, seed ) {
                                        // Element context
                                        } else {
 
-                                               // Support: IE, Opera, Webkit
-                                               // TODO: identify versions
+                                               // Support: IE 9 only
                                                // getElementById can match elements by name instead of ID
-                                               if ( newContext && (elem = newContext.getElementById( m )) &&
-                                                       contains( context, elem ) &&
+                                               if ( newContext && ( elem = newContext.getElementById( m ) ) &&
+                                                       find.contains( context, elem ) &&
                                                        elem.id === m ) {
 
-                                                       results.push( elem );
+                                                       push.call( results, elem );
                                                        return results;
                                                }
                                        }
 
                                // Type selector
-                               } else if ( match[2] ) {
+                               } else if ( match[ 2 ] ) {
                                        push.apply( results, context.getElementsByTagName( selector ) );
                                        return results;
 
                                // Class selector
-                               } else if ( (m = match[3]) && support.getElementsByClassName &&
-                                       context.getElementsByClassName ) {
-
+                               } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) {
                                        push.apply( results, context.getElementsByClassName( m ) );
                                        return results;
                                }
                        }
 
                        // Take advantage of querySelectorAll
-                       if ( support.qsa &&
-                               !compilerCache[ selector + " " ] &&
-                               (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
-
-                               if ( nodeType !== 1 ) {
-                                       newContext = context;
-                                       newSelector = selector;
-
-                               // qSA looks outside Element context, which is not what we want
-                               // Thanks to Andrew Dupont for this workaround technique
-                               // Support: IE <=8
-                               // Exclude object elements
-                               } else if ( context.nodeName.toLowerCase() !== "object" ) {
-
-                                       // Capture the context ID, setting it first if necessary
-                                       if ( (nid = context.getAttribute( "id" )) ) {
-                                               nid = nid.replace( rescape, "\\$&" );
-                                       } else {
-                                               context.setAttribute( "id", (nid = expando) );
+                       if ( !nonnativeSelectorCache[ selector + " " ] &&
+                               ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) {
+
+                               newSelector = selector;
+                               newContext = context;
+
+                               // qSA considers elements outside a scoping root when evaluating child or
+                               // descendant combinators, which is not what we want.
+                               // In such cases, we work around the behavior by prefixing every selector in the
+                               // list with an ID selector referencing the scope context.
+                               // The technique has to be used as well when a leading combinator is used
+                               // as such selectors are not recognized by querySelectorAll.
+                               // Thanks to Andrew Dupont for this technique.
+                               if ( nodeType === 1 &&
+                                       ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) {
+
+                                       // Expand context for sibling selectors
+                                       newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+                                               context;
+
+                                       // We can use :scope instead of the ID hack if the browser
+                                       // supports it & if we're not changing the context.
+                                       // Support: IE 11+, Edge 17 - 18+
+                                       // IE/Edge sometimes throw a "Permission denied" error when
+                                       // strict-comparing two documents; shallow comparisons work.
+                                       // eslint-disable-next-line eqeqeq
+                                       if ( newContext != context || !support.scope ) {
+
+                                               // Capture the context ID, setting it first if necessary
+                                               if ( ( nid = context.getAttribute( "id" ) ) ) {
+                                                       nid = jQuery.escapeSelector( nid );
+                                               } else {
+                                                       context.setAttribute( "id", ( nid = expando ) );
+                                               }
                                        }
 
                                        // Prefix every selector in the list
                                        groups = tokenize( selector );
                                        i = groups.length;
-                                       nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
                                        while ( i-- ) {
-                                               groups[i] = nidselect + " " + toSelector( groups[i] );
+                                               groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
+                                                       toSelector( groups[ i ] );
                                        }
                                        newSelector = groups.join( "," );
-
-                                       // Expand context for sibling selectors
-                                       newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
-                                               context;
                                }
 
-                               if ( newSelector ) {
-                                       try {
-                                               push.apply( results,
-                                                       newContext.querySelectorAll( newSelector )
-                                               );
-                                               return results;
-                                       } catch ( qsaError ) {
-                                       } finally {
-                                               if ( nid === expando ) {
-                                                       context.removeAttribute( "id" );
-                                               }
+                               try {
+                                       push.apply( results,
+                                               newContext.querySelectorAll( newSelector )
+                                       );
+                                       return results;
+                               } catch ( qsaError ) {
+                                       nonnativeSelectorCache( selector, true );
+                               } finally {
+                                       if ( nid === expando ) {
+                                               context.removeAttribute( "id" );
                                        }
                                }
                        }
@@ -900,7 +936,7 @@ function Sizzle( selector, context, results, seed ) {
        }
 
        // All others
-       return select( selector.replace( rtrim, "$1" ), context, results, seed );
+       return select( selector.replace( rtrimCSS, "$1" ), context, results, seed );
 }
 
 /**
@@ -913,18 +949,21 @@ function createCache() {
        var keys = [];
 
        function cache( key, value ) {
-               // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+
+               // Use (key + " ") to avoid collision with native prototype properties
+               // (see https://github.com/jquery/sizzle/issues/157)
                if ( keys.push( key + " " ) > Expr.cacheLength ) {
+
                        // Only keep the most recent entries
                        delete cache[ keys.shift() ];
                }
-               return (cache[ key + " " ] = value);
+               return ( cache[ key + " " ] = value );
        }
        return cache;
 }
 
 /**
- * Mark a function for special use by Sizzle
+ * Mark a function for special use by jQuery selector module
  * @param {Function} fn The function to mark
  */
 function markFunction( fn ) {
@@ -934,66 +973,25 @@ function markFunction( fn ) {
 
 /**
  * Support testing using an element
- * @param {Function} fn Passed the created div and expects a boolean result
+ * @param {Function} fn Passed the created element and returns a boolean result
  */
 function assert( fn ) {
-       var div = document.createElement("div");
+       var el = document.createElement( "fieldset" );
 
        try {
-               return !!fn( div );
-       } catch (e) {
+               return !!fn( el );
+       } catch ( e ) {
                return false;
        } finally {
+
                // Remove from its parent by default
-               if ( div.parentNode ) {
-                       div.parentNode.removeChild( div );
+               if ( el.parentNode ) {
+                       el.parentNode.removeChild( el );
                }
-               // release memory in IE
-               div = null;
-       }
-}
-
-/**
- * Adds the same handler for all of the specified attrs
- * @param {String} attrs Pipe-separated list of attributes
- * @param {Function} handler The method that will be applied
- */
-function addHandle( attrs, handler ) {
-       var arr = attrs.split("|"),
-               i = arr.length;
-
-       while ( i-- ) {
-               Expr.attrHandle[ arr[i] ] = handler;
-       }
-}
-
-/**
- * Checks document order of two siblings
- * @param {Element} a
- * @param {Element} b
- * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
- */
-function siblingCheck( a, b ) {
-       var cur = b && a,
-               diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
-                       ( ~b.sourceIndex || MAX_NEGATIVE ) -
-                       ( ~a.sourceIndex || MAX_NEGATIVE );
-
-       // Use IE sourceIndex if available on both nodes
-       if ( diff ) {
-               return diff;
-       }
 
-       // Check if b follows a
-       if ( cur ) {
-               while ( (cur = cur.nextSibling) ) {
-                       if ( cur === b ) {
-                               return -1;
-                       }
-               }
+               // release memory in IE
+               el = null;
        }
-
-       return a ? 1 : -1;
 }
 
 /**
@@ -1002,8 +1000,7 @@ function siblingCheck( a, b ) {
  */
 function createInputPseudo( type ) {
        return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return name === "input" && elem.type === type;
+               return nodeName( elem, "input" ) && elem.type === type;
        };
 }
 
@@ -1013,8 +1010,63 @@ function createInputPseudo( type ) {
  */
 function createButtonPseudo( type ) {
        return function( elem ) {
-               var name = elem.nodeName.toLowerCase();
-               return (name === "input" || name === "button") && elem.type === type;
+               return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) &&
+                       elem.type === type;
+       };
+}
+
+/**
+ * Returns a function to use in pseudos for :enabled/:disabled
+ * @param {Boolean} disabled true for :disabled; false for :enabled
+ */
+function createDisabledPseudo( disabled ) {
+
+       // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
+       return function( elem ) {
+
+               // Only certain elements can match :enabled or :disabled
+               // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
+               // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
+               if ( "form" in elem ) {
+
+                       // Check for inherited disabledness on relevant non-disabled elements:
+                       // * listed form-associated elements in a disabled fieldset
+                       //   https://html.spec.whatwg.org/multipage/forms.html#category-listed
+                       //   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
+                       // * option elements in a disabled optgroup
+                       //   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
+                       // All such elements have a "form" property.
+                       if ( elem.parentNode && elem.disabled === false ) {
+
+                               // Option elements defer to a parent optgroup if present
+                               if ( "label" in elem ) {
+                                       if ( "label" in elem.parentNode ) {
+                                               return elem.parentNode.disabled === disabled;
+                                       } else {
+                                               return elem.disabled === disabled;
+                                       }
+                               }
+
+                               // Support: IE 6 - 11+
+                               // Use the isDisabled shortcut property to check for disabled fieldset ancestors
+                               return elem.isDisabled === disabled ||
+
+                                       // Where there is no isDisabled, check manually
+                                       elem.isDisabled !== !disabled &&
+                                               inDisabledFieldset( elem ) === disabled;
+                       }
+
+                       return elem.disabled === disabled;
+
+               // Try to winnow out elements that can't be disabled before trusting the disabled property.
+               // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
+               // even exist on them, let alone have a boolean value.
+               } else if ( "label" in elem ) {
+                       return elem.disabled === disabled;
+               }
+
+               // Remaining elements are neither :enabled nor :disabled
+               return false;
        };
 }
 
@@ -1023,25 +1075,25 @@ function createButtonPseudo( type ) {
  * @param {Function} fn
  */
 function createPositionalPseudo( fn ) {
-       return markFunction(function( argument ) {
+       return markFunction( function( argument ) {
                argument = +argument;
-               return markFunction(function( seed, matches ) {
+               return markFunction( function( seed, matches ) {
                        var j,
                                matchIndexes = fn( [], seed.length, argument ),
                                i = matchIndexes.length;
 
                        // Match elements found at the specified indexes
                        while ( i-- ) {
-                               if ( seed[ (j = matchIndexes[i]) ] ) {
-                                       seed[j] = !(matches[j] = seed[j]);
+                               if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
+                                       seed[ j ] = !( matches[ j ] = seed[ j ] );
                                }
                        }
-               });
-       });
+               } );
+       } );
 }
 
 /**
- * Checks a node for validity as a Sizzle context
+ * Checks a node for validity as a jQuery selector context
  * @param {Element|Object=} context
  * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  */
@@ -1049,148 +1101,162 @@ function testContext( context ) {
        return context && typeof context.getElementsByTagName !== "undefined" && context;
 }
 
-// Expose support vars for convenience
-support = Sizzle.support = {};
-
-/**
- * Detects XML nodes
- * @param {Element|Object} elem An element or a document
- * @returns {Boolean} True iff elem is a non-HTML XML node
- */
-isXML = Sizzle.isXML = function( elem ) {
-       // documentElement is verified for cases where it doesn't yet exist
-       // (such as loading iframes in IE - #4833)
-       var documentElement = elem && (elem.ownerDocument || elem).documentElement;
-       return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
 /**
  * Sets document-related variables once based on the current document
- * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @param {Element|Object} [node] An element or document object to use to set the document
  * @returns {Object} Returns the current document
  */
-setDocument = Sizzle.setDocument = function( node ) {
-       var hasCompare, parent,
+function setDocument( node ) {
+       var subWindow,
                doc = node ? node.ownerDocument || node : preferredDoc;
 
        // Return early if doc is invalid or already selected
-       if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+       // Support: IE 11+, Edge 17 - 18+
+       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+       // two documents; shallow comparisons work.
+       // eslint-disable-next-line eqeqeq
+       if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
                return document;
        }
 
        // Update global variables
        document = doc;
-       docElem = document.documentElement;
-       documentIsHTML = !isXML( document );
-
-       // Support: IE 9-11, Edge
-       // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
-       if ( (parent = document.defaultView) && parent.top !== parent ) {
-               // Support: IE 11
-               if ( parent.addEventListener ) {
-                       parent.addEventListener( "unload", unloadHandler, false );
-
-               // Support: IE 9 - 10 only
-               } else if ( parent.attachEvent ) {
-                       parent.attachEvent( "onunload", unloadHandler );
-               }
-       }
-
-       /* Attributes
-       ---------------------------------------------------------------------- */
-
-       // Support: IE<8
-       // Verify that getAttribute really returns attributes and not properties
-       // (excepting IE8 booleans)
-       support.attributes = assert(function( div ) {
-               div.className = "i";
-               return !div.getAttribute("className");
-       });
-
-       /* getElement(s)By*
-       ---------------------------------------------------------------------- */
+       documentElement = document.documentElement;
+       documentIsHTML = !jQuery.isXMLDoc( document );
+
+       // Support: iOS 7 only, IE 9 - 11+
+       // Older browsers didn't support unprefixed `matches`.
+       matches = documentElement.matches ||
+               documentElement.webkitMatchesSelector ||
+               documentElement.msMatchesSelector;
+
+       // Support: IE 9 - 11+, Edge 12 - 18+
+       // Accessing iframe documents after unload throws "permission denied" errors
+       // (see trac-13936).
+       // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,
+       // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.
+       if ( documentElement.msMatchesSelector &&
+
+               // Support: IE 11+, Edge 17 - 18+
+               // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+               // two documents; shallow comparisons work.
+               // eslint-disable-next-line eqeqeq
+               preferredDoc != document &&
+               ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
+
+               // Support: IE 9 - 11+, Edge 12 - 18+
+               subWindow.addEventListener( "unload", unloadHandler );
+       }
+
+       // Support: IE <10
+       // Check if getElementById returns elements by name
+       // The broken getElementById methods don't pick up programmatically-set names,
+       // so use a roundabout getElementsByName test
+       support.getById = assert( function( el ) {
+               documentElement.appendChild( el ).id = jQuery.expando;
+               return !document.getElementsByName ||
+                       !document.getElementsByName( jQuery.expando ).length;
+       } );
 
-       // Check if getElementsByTagName("*") returns only elements
-       support.getElementsByTagName = assert(function( div ) {
-               div.appendChild( document.createComment("") );
-               return !div.getElementsByTagName("*").length;
-       });
+       // Support: IE 9 only
+       // Check to see if it's possible to do matchesSelector
+       // on a disconnected node.
+       support.disconnectedMatch = assert( function( el ) {
+               return matches.call( el, "*" );
+       } );
 
-       // Support: IE<9
-       support.getElementsByClassName = rnative.test( document.getElementsByClassName );
+       // Support: IE 9 - 11+, Edge 12 - 18+
+       // IE/Edge don't support the :scope pseudo-class.
+       support.scope = assert( function() {
+               return document.querySelectorAll( ":scope" );
+       } );
 
-       // Support: IE<10
-       // Check if getElementById returns elements by name
-       // The broken getElementById methods don't pick up programatically-set names,
-       // so use a roundabout getElementsByName test
-       support.getById = assert(function( div ) {
-               docElem.appendChild( div ).id = expando;
-               return !document.getElementsByName || !document.getElementsByName( expando ).length;
-       });
+       // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
+       // Make sure the `:has()` argument is parsed unforgivingly.
+       // We include `*` in the test to detect buggy implementations that are
+       // _selectively_ forgiving (specifically when the list includes at least
+       // one valid selector).
+       // Note that we treat complete lack of support for `:has()` as if it were
+       // spec-compliant support, which is fine because use of `:has()` in such
+       // environments will fail in the qSA path and fall back to jQuery traversal
+       // anyway.
+       support.cssHas = assert( function() {
+               try {
+                       document.querySelector( ":has(*,:jqfake)" );
+                       return false;
+               } catch ( e ) {
+                       return true;
+               }
+       } );
 
-       // ID find and filter
+       // ID filter and find
        if ( support.getById ) {
-               Expr.find["ID"] = function( id, context ) {
-                       if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
-                               var m = context.getElementById( id );
-                               return m ? [ m ] : [];
-                       }
-               };
-               Expr.filter["ID"] = function( id ) {
+               Expr.filter.ID = function( id ) {
                        var attrId = id.replace( runescape, funescape );
                        return function( elem ) {
-                               return elem.getAttribute("id") === attrId;
+                               return elem.getAttribute( "id" ) === attrId;
                        };
                };
+               Expr.find.ID = function( id, context ) {
+                       if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+                               var elem = context.getElementById( id );
+                               return elem ? [ elem ] : [];
+                       }
+               };
        } else {
-               // Support: IE6/7
-               // getElementById is not reliable as a find shortcut
-               delete Expr.find["ID"];
-
-               Expr.filter["ID"] =  function( id ) {
+               Expr.filter.ID =  function( id ) {
                        var attrId = id.replace( runescape, funescape );
                        return function( elem ) {
                                var node = typeof elem.getAttributeNode !== "undefined" &&
-                                       elem.getAttributeNode("id");
+                                       elem.getAttributeNode( "id" );
                                return node && node.value === attrId;
                        };
                };
-       }
 
-       // Tag
-       Expr.find["TAG"] = support.getElementsByTagName ?
-               function( tag, context ) {
-                       if ( typeof context.getElementsByTagName !== "undefined" ) {
-                               return context.getElementsByTagName( tag );
+               // Support: IE 6 - 7 only
+               // getElementById is not reliable as a find shortcut
+               Expr.find.ID = function( id, context ) {
+                       if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+                               var node, i, elems,
+                                       elem = context.getElementById( id );
 
-                       // DocumentFragment nodes don't have gEBTN
-                       } else if ( support.qsa ) {
-                               return context.querySelectorAll( tag );
-                       }
-               } :
+                               if ( elem ) {
 
-               function( tag, context ) {
-                       var elem,
-                               tmp = [],
-                               i = 0,
-                               // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
-                               results = context.getElementsByTagName( tag );
-
-                       // Filter out possible comments
-                       if ( tag === "*" ) {
-                               while ( (elem = results[i++]) ) {
-                                       if ( elem.nodeType === 1 ) {
-                                               tmp.push( elem );
+                                       // Verify the id attribute
+                                       node = elem.getAttributeNode( "id" );
+                                       if ( node && node.value === id ) {
+                                               return [ elem ];
+                                       }
+
+                                       // Fall back on getElementsByName
+                                       elems = context.getElementsByName( id );
+                                       i = 0;
+                                       while ( ( elem = elems[ i++ ] ) ) {
+                                               node = elem.getAttributeNode( "id" );
+                                               if ( node && node.value === id ) {
+                                                       return [ elem ];
+                                               }
                                        }
                                }
 
-                               return tmp;
+                               return [];
                        }
-                       return results;
                };
+       }
+
+       // Tag
+       Expr.find.TAG = function( tag, context ) {
+               if ( typeof context.getElementsByTagName !== "undefined" ) {
+                       return context.getElementsByTagName( tag );
+
+               // DocumentFragment nodes don't have gEBTN
+               } else {
+                       return context.querySelectorAll( tag );
+               }
+       };
 
        // Class
-       Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+       Expr.find.CLASS = function( className, context ) {
                if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
                        return context.getElementsByClassName( className );
                }
@@ -1201,143 +1267,94 @@ setDocument = Sizzle.setDocument = function( node ) {
 
        // QSA and matchesSelector support
 
-       // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-       rbuggyMatches = [];
-
-       // qSa(:focus) reports false when true (Chrome 21)
-       // We allow this because of a bug in IE8/9 that throws an error
-       // whenever `document.activeElement` is accessed on an iframe
-       // So, we allow :focus to pass through QSA all the time to avoid the IE error
-       // See http://bugs.jquery.com/ticket/13378
        rbuggyQSA = [];
 
-       if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
-               // Build QSA regex
-               // Regex strategy adopted from Diego Perini
-               assert(function( div ) {
-                       // Select is set to empty string on purpose
-                       // This is to test IE's treatment of not explicitly
-                       // setting a boolean content attribute,
-                       // since its presence should be enough
-                       // http://bugs.jquery.com/ticket/12359
-                       docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
-                               "<select id='" + expando + "-\r\\' msallowcapture=''>" +
-                               "<option selected=''></option></select>";
-
-                       // Support: IE8, Opera 11-12.16
-                       // Nothing should be selected when empty strings follow ^= or $= or *=
-                       // The test attribute must be unknown in Opera but "safe" for WinRT
-                       // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
-                       if ( div.querySelectorAll("[msallowcapture^='']").length ) {
-                               rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
-                       }
-
-                       // Support: IE8
-                       // Boolean attributes and "value" are not treated correctly
-                       if ( !div.querySelectorAll("[selected]").length ) {
-                               rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
-                       }
-
-                       // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
-                       if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
-                               rbuggyQSA.push("~=");
-                       }
+       // Build QSA regex
+       // Regex strategy adopted from Diego Perini
+       assert( function( el ) {
 
-                       // Webkit/Opera - :checked should return selected option elements
-                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-                       // IE8 throws error here and will not see later tests
-                       if ( !div.querySelectorAll(":checked").length ) {
-                               rbuggyQSA.push(":checked");
-                       }
+               var input;
 
-                       // Support: Safari 8+, iOS 8+
-                       // https://bugs.webkit.org/show_bug.cgi?id=136851
-                       // In-page `selector#id sibing-combinator selector` fails
-                       if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
-                               rbuggyQSA.push(".#.+[+~]");
-                       }
-               });
+               documentElement.appendChild( el ).innerHTML =
+                       "<a id='" + expando + "' href='' disabled='disabled'></a>" +
+                       "<select id='" + expando + "-\r\\' disabled='disabled'>" +
+                       "<option selected=''></option></select>";
 
-               assert(function( div ) {
-                       // Support: Windows 8 Native Apps
-                       // The type and name attributes are restricted during .innerHTML assignment
-                       var input = document.createElement("input");
-                       input.setAttribute( "type", "hidden" );
-                       div.appendChild( input ).setAttribute( "name", "D" );
+               // Support: iOS <=7 - 8 only
+               // Boolean attributes and "value" are not treated correctly in some XML documents
+               if ( !el.querySelectorAll( "[selected]" ).length ) {
+                       rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+               }
 
-                       // Support: IE8
-                       // Enforce case-sensitivity of name attribute
-                       if ( div.querySelectorAll("[name=d]").length ) {
-                               rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
-                       }
+               // Support: iOS <=7 - 8 only
+               if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+                       rbuggyQSA.push( "~=" );
+               }
 
-                       // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-                       // IE8 throws error here and will not see later tests
-                       if ( !div.querySelectorAll(":enabled").length ) {
-                               rbuggyQSA.push( ":enabled", ":disabled" );
-                       }
+               // Support: iOS 8 only
+               // https://bugs.webkit.org/show_bug.cgi?id=136851
+               // In-page `selector#id sibling-combinator selector` fails
+               if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
+                       rbuggyQSA.push( ".#.+[+~]" );
+               }
 
-                       // Opera 10-11 does not throw on post-comma invalid pseudos
-                       div.querySelectorAll("*,:x");
-                       rbuggyQSA.push(",.*:");
-               });
-       }
+               // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
+               // In some of the document kinds, these selectors wouldn't work natively.
+               // This is probably OK but for backwards compatibility we want to maintain
+               // handling them through jQuery traversal in jQuery 3.x.
+               if ( !el.querySelectorAll( ":checked" ).length ) {
+                       rbuggyQSA.push( ":checked" );
+               }
 
-       if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
-               docElem.webkitMatchesSelector ||
-               docElem.mozMatchesSelector ||
-               docElem.oMatchesSelector ||
-               docElem.msMatchesSelector) )) ) {
+               // Support: Windows 8 Native Apps
+               // The type and name attributes are restricted during .innerHTML assignment
+               input = document.createElement( "input" );
+               input.setAttribute( "type", "hidden" );
+               el.appendChild( input ).setAttribute( "name", "D" );
+
+               // Support: IE 9 - 11+
+               // IE's :disabled selector does not pick up the children of disabled fieldsets
+               // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+
+               // In some of the document kinds, these selectors wouldn't work natively.
+               // This is probably OK but for backwards compatibility we want to maintain
+               // handling them through jQuery traversal in jQuery 3.x.
+               documentElement.appendChild( el ).disabled = true;
+               if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
+                       rbuggyQSA.push( ":enabled", ":disabled" );
+               }
+
+               // Support: IE 11+, Edge 15 - 18+
+               // IE 11/Edge don't find elements on a `[name='']` query in some cases.
+               // Adding a temporary attribute to the document before the selection works
+               // around the issue.
+               // Interestingly, IE 10 & older don't seem to have the issue.
+               input = document.createElement( "input" );
+               input.setAttribute( "name", "" );
+               el.appendChild( input );
+               if ( !el.querySelectorAll( "[name='']" ).length ) {
+                       rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
+                               whitespace + "*(?:''|\"\")" );
+               }
+       } );
 
-               assert(function( div ) {
-                       // Check to see if it's possible to do matchesSelector
-                       // on a disconnected node (IE 9)
-                       support.disconnectedMatch = matches.call( div, "div" );
+       if ( !support.cssHas ) {
 
-                       // This should fail with an exception
-                       // Gecko does not error, returns false instead
-                       matches.call( div, "[s!='']:x" );
-                       rbuggyMatches.push( "!=", pseudos );
-               });
+               // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
+               // Our regular `try-catch` mechanism fails to detect natively-unsupported
+               // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
+               // in browsers that parse the `:has()` argument as a forgiving selector list.
+               // https://drafts.csswg.org/selectors/#relational now requires the argument
+               // to be parsed unforgivingly, but browsers have not yet fully adjusted.
+               rbuggyQSA.push( ":has" );
        }
 
-       rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
-       rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
-
-       /* Contains
-       ---------------------------------------------------------------------- */
-       hasCompare = rnative.test( docElem.compareDocumentPosition );
-
-       // Element contains another
-       // Purposefully self-exclusive
-       // As in, an element does not contain itself
-       contains = hasCompare || rnative.test( docElem.contains ) ?
-               function( a, b ) {
-                       var adown = a.nodeType === 9 ? a.documentElement : a,
-                               bup = b && b.parentNode;
-                       return a === bup || !!( bup && bup.nodeType === 1 && (
-                               adown.contains ?
-                                       adown.contains( bup ) :
-                                       a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
-                       ));
-               } :
-               function( a, b ) {
-                       if ( b ) {
-                               while ( (b = b.parentNode) ) {
-                                       if ( b === a ) {
-                                               return true;
-                                       }
-                               }
-                       }
-                       return false;
-               };
+       rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
 
        /* Sorting
        ---------------------------------------------------------------------- */
 
        // Document order sorting
-       sortOrder = hasCompare ?
-       function( a, b ) {
+       sortOrder = function( a, b ) {
 
                // Flag for duplicate removal
                if ( a === b ) {
@@ -1352,7 +1369,11 @@ setDocument = Sizzle.setDocument = function( node ) {
                }
 
                // Calculate position if both inputs belong to the same document
-               compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+               // Support: IE 11+, Edge 17 - 18+
+               // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+               // two documents; shallow comparisons work.
+               // eslint-disable-next-line eqeqeq
+               compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
                        a.compareDocumentPosition( b ) :
 
                        // Otherwise we know they are disconnected
@@ -1360,145 +1381,109 @@ setDocument = Sizzle.setDocument = function( node ) {
 
                // Disconnected nodes
                if ( compare & 1 ||
-                       (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+                       ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
 
                        // Choose the first element that is related to our preferred document
-                       if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+                       // Support: IE 11+, Edge 17 - 18+
+                       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+                       // two documents; shallow comparisons work.
+                       // eslint-disable-next-line eqeqeq
+                       if ( a === document || a.ownerDocument == preferredDoc &&
+                               find.contains( preferredDoc, a ) ) {
                                return -1;
                        }
-                       if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+
+                       // Support: IE 11+, Edge 17 - 18+
+                       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+                       // two documents; shallow comparisons work.
+                       // eslint-disable-next-line eqeqeq
+                       if ( b === document || b.ownerDocument == preferredDoc &&
+                               find.contains( preferredDoc, b ) ) {
                                return 1;
                        }
 
                        // Maintain original order
                        return sortInput ?
-                               ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+                               ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
                                0;
                }
 
                return compare & 4 ? -1 : 1;
-       } :
-       function( a, b ) {
-               // Exit early if the nodes are identical
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-               }
-
-               var cur,
-                       i = 0,
-                       aup = a.parentNode,
-                       bup = b.parentNode,
-                       ap = [ a ],
-                       bp = [ b ];
-
-               // Parentless nodes are either documents or disconnected
-               if ( !aup || !bup ) {
-                       return a === document ? -1 :
-                               b === document ? 1 :
-                               aup ? -1 :
-                               bup ? 1 :
-                               sortInput ?
-                               ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
-                               0;
-
-               // If the nodes are siblings, we can do a quick check
-               } else if ( aup === bup ) {
-                       return siblingCheck( a, b );
-               }
-
-               // Otherwise we need full lists of their ancestors for comparison
-               cur = a;
-               while ( (cur = cur.parentNode) ) {
-                       ap.unshift( cur );
-               }
-               cur = b;
-               while ( (cur = cur.parentNode) ) {
-                       bp.unshift( cur );
-               }
-
-               // Walk down the tree looking for a discrepancy
-               while ( ap[i] === bp[i] ) {
-                       i++;
-               }
-
-               return i ?
-                       // Do a sibling check if the nodes have a common ancestor
-                       siblingCheck( ap[i], bp[i] ) :
-
-                       // Otherwise nodes in our document sort first
-                       ap[i] === preferredDoc ? -1 :
-                       bp[i] === preferredDoc ? 1 :
-                       0;
        };
 
        return document;
-};
+}
 
-Sizzle.matches = function( expr, elements ) {
-       return Sizzle( expr, null, null, elements );
+find.matches = function( expr, elements ) {
+       return find( expr, null, null, elements );
 };
 
-Sizzle.matchesSelector = function( elem, expr ) {
-       // Set document vars if needed
-       if ( ( elem.ownerDocument || elem ) !== document ) {
-               setDocument( elem );
-       }
-
-       // Make sure that attribute selectors are quoted
-       expr = expr.replace( rattributeQuotes, "='$1']" );
+find.matchesSelector = function( elem, expr ) {
+       setDocument( elem );
 
-       if ( support.matchesSelector && documentIsHTML &&
-               !compilerCache[ expr + " " ] &&
-               ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
-               ( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {
+       if ( documentIsHTML &&
+               !nonnativeSelectorCache[ expr + " " ] &&
+               ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
 
                try {
                        var ret = matches.call( elem, expr );
 
                        // IE 9's matchesSelector returns false on disconnected nodes
                        if ( ret || support.disconnectedMatch ||
+
                                        // As well, disconnected nodes are said to be in a document
                                        // fragment in IE 9
                                        elem.document && elem.document.nodeType !== 11 ) {
                                return ret;
                        }
-               } catch (e) {}
+               } catch ( e ) {
+                       nonnativeSelectorCache( expr, true );
+               }
        }
 
-       return Sizzle( expr, document, null, [ elem ] ).length > 0;
+       return find( expr, document, null, [ elem ] ).length > 0;
 };
 
-Sizzle.contains = function( context, elem ) {
+find.contains = function( context, elem ) {
+
        // Set document vars if needed
-       if ( ( context.ownerDocument || context ) !== document ) {
+       // Support: IE 11+, Edge 17 - 18+
+       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+       // two documents; shallow comparisons work.
+       // eslint-disable-next-line eqeqeq
+       if ( ( context.ownerDocument || context ) != document ) {
                setDocument( context );
        }
-       return contains( context, elem );
+       return jQuery.contains( context, elem );
 };
 
-Sizzle.attr = function( elem, name ) {
+
+find.attr = function( elem, name ) {
+
        // Set document vars if needed
-       if ( ( elem.ownerDocument || elem ) !== document ) {
+       // Support: IE 11+, Edge 17 - 18+
+       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+       // two documents; shallow comparisons work.
+       // eslint-disable-next-line eqeqeq
+       if ( ( elem.ownerDocument || elem ) != document ) {
                setDocument( elem );
        }
 
        var fn = Expr.attrHandle[ name.toLowerCase() ],
-               // Don't get fooled by Object.prototype properties (jQuery #13807)
+
+               // Don't get fooled by Object.prototype properties (see trac-13807)
                val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
                        fn( elem, name, !documentIsHTML ) :
                        undefined;
 
-       return val !== undefined ?
-               val :
-               support.attributes || !documentIsHTML ?
-                       elem.getAttribute( name ) :
-                       (val = elem.getAttributeNode(name)) && val.specified ?
-                               val.value :
-                               null;
+       if ( val !== undefined ) {
+               return val;
+       }
+
+       return elem.getAttribute( name );
 };
 
-Sizzle.error = function( msg ) {
+find.error = function( msg ) {
        throw new Error( "Syntax error, unrecognized expression: " + msg );
 };
 
@@ -1506,25 +1491,29 @@ Sizzle.error = function( msg ) {
  * Document sorting and removing duplicates
  * @param {ArrayLike} results
  */
-Sizzle.uniqueSort = function( results ) {
+jQuery.uniqueSort = function( results ) {
        var elem,
                duplicates = [],
                j = 0,
                i = 0;
 
        // Unless we *know* we can detect duplicates, assume their presence
-       hasDuplicate = !support.detectDuplicates;
-       sortInput = !support.sortStable && results.slice( 0 );
-       results.sort( sortOrder );
+       //
+       // Support: Android <=4.0+
+       // Testing for detecting duplicates is unpredictable so instead assume we can't
+       // depend on duplicate detection in all browsers without a stable sort.
+       hasDuplicate = !support.sortStable;
+       sortInput = !support.sortStable && slice.call( results, 0 );
+       sort.call( results, sortOrder );
 
        if ( hasDuplicate ) {
-               while ( (elem = results[i++]) ) {
+               while ( ( elem = results[ i++ ] ) ) {
                        if ( elem === results[ i ] ) {
                                j = duplicates.push( i );
                        }
                }
                while ( j-- ) {
-                       results.splice( duplicates[ j ], 1 );
+                       splice.call( results, duplicates[ j ], 1 );
                }
        }
 
@@ -1535,42 +1524,11 @@ Sizzle.uniqueSort = function( results ) {
        return results;
 };
 
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
-       var node,
-               ret = "",
-               i = 0,
-               nodeType = elem.nodeType;
-
-       if ( !nodeType ) {
-               // If no nodeType, this is expected to be an array
-               while ( (node = elem[i++]) ) {
-                       // Do not traverse comment nodes
-                       ret += getText( node );
-               }
-       } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-               // Use textContent for elements
-               // innerText usage removed for consistency of new lines (jQuery #11153)
-               if ( typeof elem.textContent === "string" ) {
-                       return elem.textContent;
-               } else {
-                       // Traverse its children
-                       for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-                               ret += getText( elem );
-                       }
-               }
-       } else if ( nodeType === 3 || nodeType === 4 ) {
-               return elem.nodeValue;
-       }
-       // Do not include comment or processing instruction nodes
-
-       return ret;
+jQuery.fn.uniqueSort = function() {
+       return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) );
 };
 
-Expr = Sizzle.selectors = {
+Expr = jQuery.expr = {
 
        // Can be adjusted by the user
        cacheLength: 50,
@@ -1591,20 +1549,22 @@ Expr = Sizzle.selectors = {
        },
 
        preFilter: {
-               "ATTR": function( match ) {
-                       match[1] = match[1].replace( runescape, funescape );
+               ATTR: function( match ) {
+                       match[ 1 ] = match[ 1 ].replace( runescape, funescape );
 
                        // Move the given value to match[3] whether quoted or unquoted
-                       match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+                       match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" )
+                               .replace( runescape, funescape );
 
-                       if ( match[2] === "~=" ) {
-                               match[3] = " " + match[3] + " ";
+                       if ( match[ 2 ] === "~=" ) {
+                               match[ 3 ] = " " + match[ 3 ] + " ";
                        }
 
                        return match.slice( 0, 4 );
                },
 
-               "CHILD": function( match ) {
+               CHILD: function( match ) {
+
                        /* matches from matchExpr["CHILD"]
                                1 type (only|nth|...)
                                2 what (child|of-type)
@@ -1615,49 +1575,55 @@ Expr = Sizzle.selectors = {
                                7 sign of y-component
                                8 y of y-component
                        */
-                       match[1] = match[1].toLowerCase();
+                       match[ 1 ] = match[ 1 ].toLowerCase();
+
+                       if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
 
-                       if ( match[1].slice( 0, 3 ) === "nth" ) {
                                // nth-* requires argument
-                               if ( !match[3] ) {
-                                       Sizzle.error( match[0] );
+                               if ( !match[ 3 ] ) {
+                                       find.error( match[ 0 ] );
                                }
 
                                // numeric x and y parameters for Expr.filter.CHILD
                                // remember that false/true cast respectively to 0/1
-                               match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
-                               match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+                               match[ 4 ] = +( match[ 4 ] ?
+                                       match[ 5 ] + ( match[ 6 ] || 1 ) :
+                                       2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" )
+                               );
+                               match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
 
                        // other types prohibit arguments
-                       } else if ( match[3] ) {
-                               Sizzle.error( match[0] );
+                       } else if ( match[ 3 ] ) {
+                               find.error( match[ 0 ] );
                        }
 
                        return match;
                },
 
-               "PSEUDO": function( match ) {
+               PSEUDO: function( match ) {
                        var excess,
-                               unquoted = !match[6] && match[2];
+                               unquoted = !match[ 6 ] && match[ 2 ];
 
-                       if ( matchExpr["CHILD"].test( match[0] ) ) {
+                       if ( matchExpr.CHILD.test( match[ 0 ] ) ) {
                                return null;
                        }
 
                        // Accept quoted arguments as-is
-                       if ( match[3] ) {
-                               match[2] = match[4] || match[5] || "";
+                       if ( match[ 3 ] ) {
+                               match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
 
                        // Strip excess characters from unquoted arguments
                        } else if ( unquoted && rpseudo.test( unquoted ) &&
+
                                // Get excess from tokenize (recursively)
-                               (excess = tokenize( unquoted, true )) &&
+                               ( excess = tokenize( unquoted, true ) ) &&
+
                                // advance to the next closing parenthesis
-                               (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+                               ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
 
                                // excess is a negative index
-                               match[0] = match[0].slice( 0, excess );
-                               match[2] = unquoted.slice( 0, excess );
+                               match[ 0 ] = match[ 0 ].slice( 0, excess );
+                               match[ 2 ] = unquoted.slice( 0, excess );
                        }
 
                        // Return only captures needed by the pseudo filter method (type and argument)
@@ -1667,28 +1633,36 @@ Expr = Sizzle.selectors = {
 
        filter: {
 
-               "TAG": function( nodeNameSelector ) {
-                       var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+               TAG: function( nodeNameSelector ) {
+                       var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
                        return nodeNameSelector === "*" ?
-                               function() { return true; } :
+                               function() {
+                                       return true;
+                               } :
                                function( elem ) {
-                                       return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+                                       return nodeName( elem, expectedNodeName );
                                };
                },
 
-               "CLASS": function( className ) {
+               CLASS: function( className ) {
                        var pattern = classCache[ className + " " ];
 
                        return pattern ||
-                               (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+                               ( pattern = new RegExp( "(^|" + whitespace + ")" + className +
+                                       "(" + whitespace + "|$)" ) ) &&
                                classCache( className, function( elem ) {
-                                       return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
-                               });
+                                       return pattern.test(
+                                               typeof elem.className === "string" && elem.className ||
+                                                       typeof elem.getAttribute !== "undefined" &&
+                                                               elem.getAttribute( "class" ) ||
+                                                       ""
+                                       );
+                               } );
                },
 
-               "ATTR": function( name, operator, check ) {
+               ATTR: function( name, operator, check ) {
                        return function( elem ) {
-                               var result = Sizzle.attr( elem, name );
+                               var result = find.attr( elem, name );
 
                                if ( result == null ) {
                                        return operator === "!=";
@@ -1699,18 +1673,34 @@ Expr = Sizzle.selectors = {
 
                                result += "";
 
-                               return operator === "=" ? result === check :
-                                       operator === "!=" ? result !== check :
-                                       operator === "^=" ? check && result.indexOf( check ) === 0 :
-                                       operator === "*=" ? check && result.indexOf( check ) > -1 :
-                                       operator === "$=" ? check && result.slice( -check.length ) === check :
-                                       operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
-                                       operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
-                                       false;
+                               if ( operator === "=" ) {
+                                       return result === check;
+                               }
+                               if ( operator === "!=" ) {
+                                       return result !== check;
+                               }
+                               if ( operator === "^=" ) {
+                                       return check && result.indexOf( check ) === 0;
+                               }
+                               if ( operator === "*=" ) {
+                                       return check && result.indexOf( check ) > -1;
+                               }
+                               if ( operator === "$=" ) {
+                                       return check && result.slice( -check.length ) === check;
+                               }
+                               if ( operator === "~=" ) {
+                                       return ( " " + result.replace( rwhitespace, " " ) + " " )
+                                               .indexOf( check ) > -1;
+                               }
+                               if ( operator === "|=" ) {
+                                       return result === check || result.slice( 0, check.length + 1 ) === check + "-";
+                               }
+
+                               return false;
                        };
                },
 
-               "CHILD": function( type, what, argument, first, last ) {
+               CHILD: function( type, what, _argument, first, last ) {
                        var simple = type.slice( 0, 3 ) !== "nth",
                                forward = type.slice( -4 ) !== "last",
                                ofType = what === "of-type";
@@ -1722,8 +1712,8 @@ Expr = Sizzle.selectors = {
                                        return !!elem.parentNode;
                                } :
 
-                               function( elem, context, xml ) {
-                                       var cache, uniqueCache, outerCache, node, nodeIndex, start,
+                               function( elem, _context, xml ) {
+                                       var cache, outerCache, node, nodeIndex, start,
                                                dir = simple !== forward ? "nextSibling" : "previousSibling",
                                                parent = elem.parentNode,
                                                name = ofType && elem.nodeName.toLowerCase(),
@@ -1736,14 +1726,15 @@ Expr = Sizzle.selectors = {
                                                if ( simple ) {
                                                        while ( dir ) {
                                                                node = elem;
-                                                               while ( (node = node[ dir ]) ) {
+                                                               while ( ( node = node[ dir ] ) ) {
                                                                        if ( ofType ?
-                                                                               node.nodeName.toLowerCase() === name :
+                                                                               nodeName( node, name ) :
                                                                                node.nodeType === 1 ) {
 
                                                                                return false;
                                                                        }
                                                                }
+
                                                                // Reverse direction for :only-* (if we haven't yet done so)
                                                                start = dir = type === "only" && !start && "nextSibling";
                                                        }
@@ -1756,46 +1747,30 @@ Expr = Sizzle.selectors = {
                                                if ( forward && useCache ) {
 
                                                        // Seek `elem` from a previously-cached index
-
-                                                       // ...in a gzip-friendly way
-                                                       node = parent;
-                                                       outerCache = node[ expando ] || (node[ expando ] = {});
-
-                                                       // Support: IE <9 only
-                                                       // Defend against cloned attroperties (jQuery gh-1709)
-                                                       uniqueCache = outerCache[ node.uniqueID ] ||
-                                                               (outerCache[ node.uniqueID ] = {});
-
-                                                       cache = uniqueCache[ type ] || [];
+                                                       outerCache = parent[ expando ] || ( parent[ expando ] = {} );
+                                                       cache = outerCache[ type ] || [];
                                                        nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
                                                        diff = nodeIndex && cache[ 2 ];
                                                        node = nodeIndex && parent.childNodes[ nodeIndex ];
 
-                                                       while ( (node = ++nodeIndex && node && node[ dir ] ||
+                                                       while ( ( node = ++nodeIndex && node && node[ dir ] ||
 
                                                                // Fallback to seeking `elem` from the start
-                                                               (diff = nodeIndex = 0) || start.pop()) ) {
+                                                               ( diff = nodeIndex = 0 ) || start.pop() ) ) {
 
                                                                // When found, cache indexes on `parent` and break
                                                                if ( node.nodeType === 1 && ++diff && node === elem ) {
-                                                                       uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+                                                                       outerCache[ type ] = [ dirruns, nodeIndex, diff ];
                                                                        break;
                                                                }
                                                        }
 
                                                } else {
+
                                                        // Use previously-cached element index if available
                                                        if ( useCache ) {
-                                                               // ...in a gzip-friendly way
-                                                               node = elem;
-                                                               outerCache = node[ expando ] || (node[ expando ] = {});
-
-                                                               // Support: IE <9 only
-                                                               // Defend against cloned attroperties (jQuery gh-1709)
-                                                               uniqueCache = outerCache[ node.uniqueID ] ||
-                                                                       (outerCache[ node.uniqueID ] = {});
-
-                                                               cache = uniqueCache[ type ] || [];
+                                                               outerCache = elem[ expando ] || ( elem[ expando ] = {} );
+                                                               cache = outerCache[ type ] || [];
                                                                nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
                                                                diff = nodeIndex;
                                                        }
@@ -1803,25 +1778,21 @@ Expr = Sizzle.selectors = {
                                                        // xml :nth-child(...)
                                                        // or :nth-last-child(...) or :nth(-last)?-of-type(...)
                                                        if ( diff === false ) {
+
                                                                // Use the same loop as above to seek `elem` from the start
-                                                               while ( (node = ++nodeIndex && node && node[ dir ] ||
-                                                                       (diff = nodeIndex = 0) || start.pop()) ) {
+                                                               while ( ( node = ++nodeIndex && node && node[ dir ] ||
+                                                                       ( diff = nodeIndex = 0 ) || start.pop() ) ) {
 
                                                                        if ( ( ofType ?
-                                                                               node.nodeName.toLowerCase() === name :
+                                                                               nodeName( node, name ) :
                                                                                node.nodeType === 1 ) &&
                                                                                ++diff ) {
 
                                                                                // Cache the index of each encountered element
                                                                                if ( useCache ) {
-                                                                                       outerCache = node[ expando ] || (node[ expando ] = {});
-
-                                                                                       // Support: IE <9 only
-                                                                                       // Defend against cloned attroperties (jQuery gh-1709)
-                                                                                       uniqueCache = outerCache[ node.uniqueID ] ||
-                                                                                               (outerCache[ node.uniqueID ] = {});
-
-                                                                                       uniqueCache[ type ] = [ dirruns, diff ];
+                                                                                       outerCache = node[ expando ] ||
+                                                                                               ( node[ expando ] = {} );
+                                                                                       outerCache[ type ] = [ dirruns, diff ];
                                                                                }
 
                                                                                if ( node === elem ) {
@@ -1839,18 +1810,19 @@ Expr = Sizzle.selectors = {
                                };
                },
 
-               "PSEUDO": function( pseudo, argument ) {
+               PSEUDO: function( pseudo, argument ) {
+
                        // pseudo-class names are case-insensitive
-                       // http://www.w3.org/TR/selectors/#pseudo-classes
+                       // https://www.w3.org/TR/selectors/#pseudo-classes
                        // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
                        // Remember that setFilters inherits from pseudos
                        var args,
                                fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
-                                       Sizzle.error( "unsupported pseudo: " + pseudo );
+                                       find.error( "unsupported pseudo: " + pseudo );
 
                        // The user may use createPseudo to indicate that
                        // arguments are needed to create the filter function
-                       // just as Sizzle does
+                       // just as jQuery does
                        if ( fn[ expando ] ) {
                                return fn( argument );
                        }
@@ -1859,15 +1831,15 @@ Expr = Sizzle.selectors = {
                        if ( fn.length > 1 ) {
                                args = [ pseudo, pseudo, "", argument ];
                                return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
-                                       markFunction(function( seed, matches ) {
+                                       markFunction( function( seed, matches ) {
                                                var idx,
                                                        matched = fn( seed, argument ),
                                                        i = matched.length;
                                                while ( i-- ) {
-                                                       idx = indexOf( seed, matched[i] );
-                                                       seed[ idx ] = !( matches[ idx ] = matched[i] );
+                                                       idx = indexOf.call( seed, matched[ i ] );
+                                                       seed[ idx ] = !( matches[ idx ] = matched[ i ] );
                                                }
-                                       }) :
+                                       } ) :
                                        function( elem ) {
                                                return fn( elem, 0, args );
                                        };
@@ -1878,49 +1850,53 @@ Expr = Sizzle.selectors = {
        },
 
        pseudos: {
+
                // Potentially complex pseudos
-               "not": markFunction(function( selector ) {
+               not: markFunction( function( selector ) {
+
                        // Trim the selector passed to compile
                        // to avoid treating leading and trailing
                        // spaces as combinators
                        var input = [],
                                results = [],
-                               matcher = compile( selector.replace( rtrim, "$1" ) );
+                               matcher = compile( selector.replace( rtrimCSS, "$1" ) );
 
                        return matcher[ expando ] ?
-                               markFunction(function( seed, matches, context, xml ) {
+                               markFunction( function( seed, matches, _context, xml ) {
                                        var elem,
                                                unmatched = matcher( seed, null, xml, [] ),
                                                i = seed.length;
 
                                        // Match elements unmatched by `matcher`
                                        while ( i-- ) {
-                                               if ( (elem = unmatched[i]) ) {
-                                                       seed[i] = !(matches[i] = elem);
+                                               if ( ( elem = unmatched[ i ] ) ) {
+                                                       seed[ i ] = !( matches[ i ] = elem );
                                                }
                                        }
-                               }) :
-                               function( elem, context, xml ) {
-                                       input[0] = elem;
+                               } ) :
+                               function( elem, _context, xml ) {
+                                       input[ 0 ] = elem;
                                        matcher( input, null, xml, results );
-                                       // Don't keep the element (issue #299)
-                                       input[0] = null;
+
+                                       // Don't keep the element
+                                       // (see https://github.com/jquery/sizzle/issues/299)
+                                       input[ 0 ] = null;
                                        return !results.pop();
                                };
-               }),
+               } ),
 
-               "has": markFunction(function( selector ) {
+               has: markFunction( function( selector ) {
                        return function( elem ) {
-                               return Sizzle( selector, elem ).length > 0;
+                               return find( selector, elem ).length > 0;
                        };
-               }),
+               } ),
 
-               "contains": markFunction(function( text ) {
+               contains: markFunction( function( text ) {
                        text = text.replace( runescape, funescape );
                        return function( elem ) {
-                               return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+                               return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1;
                        };
-               }),
+               } ),
 
                // "Whether an element is represented by a :lang() selector
                // is based solely on the element's language value
@@ -1928,62 +1904,65 @@ Expr = Sizzle.selectors = {
                // or beginning with the identifier C immediately followed by "-".
                // The matching of C against the element's language value is performed case-insensitively.
                // The identifier C does not have to be a valid language name."
-               // http://www.w3.org/TR/selectors/#lang-pseudo
-               "lang": markFunction( function( lang ) {
+               // https://www.w3.org/TR/selectors/#lang-pseudo
+               lang: markFunction( function( lang ) {
+
                        // lang value must be a valid identifier
-                       if ( !ridentifier.test(lang || "") ) {
-                               Sizzle.error( "unsupported lang: " + lang );
+                       if ( !ridentifier.test( lang || "" ) ) {
+                               find.error( "unsupported lang: " + lang );
                        }
                        lang = lang.replace( runescape, funescape ).toLowerCase();
                        return function( elem ) {
                                var elemLang;
                                do {
-                                       if ( (elemLang = documentIsHTML ?
+                                       if ( ( elemLang = documentIsHTML ?
                                                elem.lang :
-                                               elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+                                               elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
 
                                                elemLang = elemLang.toLowerCase();
                                                return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
                                        }
-                               } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+                               } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
                                return false;
                        };
-               }),
+               } ),
 
                // Miscellaneous
-               "target": function( elem ) {
+               target: function( elem ) {
                        var hash = window.location && window.location.hash;
                        return hash && hash.slice( 1 ) === elem.id;
                },
 
-               "root": function( elem ) {
-                       return elem === docElem;
+               root: function( elem ) {
+                       return elem === documentElement;
                },
 
-               "focus": function( elem ) {
-                       return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+               focus: function( elem ) {
+                       return elem === safeActiveElement() &&
+                               document.hasFocus() &&
+                               !!( elem.type || elem.href || ~elem.tabIndex );
                },
 
                // Boolean properties
-               "enabled": function( elem ) {
-                       return elem.disabled === false;
-               },
+               enabled: createDisabledPseudo( false ),
+               disabled: createDisabledPseudo( true ),
 
-               "disabled": function( elem ) {
-                       return elem.disabled === true;
-               },
+               checked: function( elem ) {
 
-               "checked": function( elem ) {
                        // In CSS3, :checked should return both checked and selected elements
-                       // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-                       var nodeName = elem.nodeName.toLowerCase();
-                       return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+                       // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+                       return ( nodeName( elem, "input" ) && !!elem.checked ) ||
+                               ( nodeName( elem, "option" ) && !!elem.selected );
                },
 
-               "selected": function( elem ) {
-                       // Accessing this property makes selected-by-default
-                       // options in Safari work properly
+               selected: function( elem ) {
+
+                       // Support: IE <=11+
+                       // Accessing the selectedIndex property
+                       // forces the browser to treat the default option as
+                       // selected when in an optgroup.
                        if ( elem.parentNode ) {
+                               // eslint-disable-next-line no-unused-expressions
                                elem.parentNode.selectedIndex;
                        }
 
@@ -1991,8 +1970,9 @@ Expr = Sizzle.selectors = {
                },
 
                // Contents
-               "empty": function( elem ) {
-                       // http://www.w3.org/TR/selectors/#empty-pseudo
+               empty: function( elem ) {
+
+                       // https://www.w3.org/TR/selectors/#empty-pseudo
                        // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
                        //   but not by others (comment: 8; processing instruction: 7; etc.)
                        // nodeType < 6 works because attributes (2) do not appear as children
@@ -2004,82 +1984,92 @@ Expr = Sizzle.selectors = {
                        return true;
                },
 
-               "parent": function( elem ) {
-                       return !Expr.pseudos["empty"]( elem );
+               parent: function( elem ) {
+                       return !Expr.pseudos.empty( elem );
                },
 
                // Element/input types
-               "header": function( elem ) {
+               header: function( elem ) {
                        return rheader.test( elem.nodeName );
                },
 
-               "input": function( elem ) {
+               input: function( elem ) {
                        return rinputs.test( elem.nodeName );
                },
 
-               "button": function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return name === "input" && elem.type === "button" || name === "button";
+               button: function( elem ) {
+                       return nodeName( elem, "input" ) && elem.type === "button" ||
+                               nodeName( elem, "button" );
                },
 
-               "text": function( elem ) {
+               text: function( elem ) {
                        var attr;
-                       return elem.nodeName.toLowerCase() === "input" &&
-                               elem.type === "text" &&
+                       return nodeName( elem, "input" ) && elem.type === "text" &&
 
-                               // Support: IE<8
-                               // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
-                               ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+                               // Support: IE <10 only
+                               // New HTML5 attribute values (e.g., "search") appear
+                               // with elem.type === "text"
+                               ( ( attr = elem.getAttribute( "type" ) ) == null ||
+                                       attr.toLowerCase() === "text" );
                },
 
                // Position-in-collection
-               "first": createPositionalPseudo(function() {
+               first: createPositionalPseudo( function() {
                        return [ 0 ];
-               }),
+               } ),
 
-               "last": createPositionalPseudo(function( matchIndexes, length ) {
+               last: createPositionalPseudo( function( _matchIndexes, length ) {
                        return [ length - 1 ];
-               }),
+               } ),
 
-               "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+               eq: createPositionalPseudo( function( _matchIndexes, length, argument ) {
                        return [ argument < 0 ? argument + length : argument ];
-               }),
+               } ),
 
-               "even": createPositionalPseudo(function( matchIndexes, length ) {
+               even: createPositionalPseudo( function( matchIndexes, length ) {
                        var i = 0;
                        for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                        }
                        return matchIndexes;
-               }),
+               } ),
 
-               "odd": createPositionalPseudo(function( matchIndexes, length ) {
+               odd: createPositionalPseudo( function( matchIndexes, length ) {
                        var i = 1;
                        for ( ; i < length; i += 2 ) {
                                matchIndexes.push( i );
                        }
                        return matchIndexes;
-               }),
+               } ),
+
+               lt: createPositionalPseudo( function( matchIndexes, length, argument ) {
+                       var i;
+
+                       if ( argument < 0 ) {
+                               i = argument + length;
+                       } else if ( argument > length ) {
+                               i = length;
+                       } else {
+                               i = argument;
+                       }
 
-               "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-                       var i = argument < 0 ? argument + length : argument;
                        for ( ; --i >= 0; ) {
                                matchIndexes.push( i );
                        }
                        return matchIndexes;
-               }),
+               } ),
 
-               "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+               gt: createPositionalPseudo( function( matchIndexes, length, argument ) {
                        var i = argument < 0 ? argument + length : argument;
                        for ( ; ++i < length; ) {
                                matchIndexes.push( i );
                        }
                        return matchIndexes;
-               })
+               } )
        }
 };
 
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
+Expr.pseudos.nth = Expr.pseudos.eq;
 
 // Add button/input type pseudos
 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
@@ -2094,7 +2084,7 @@ function setFilters() {}
 setFilters.prototype = Expr.filters = Expr.pseudos;
 Expr.setFilters = new setFilters();
 
-tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+function tokenize( selector, parseOnly ) {
        var matched, match, tokens, type,
                soFar, groups, preFilters,
                cached = tokenCache[ selector + " " ];
@@ -2110,37 +2100,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
        while ( soFar ) {
 
                // Comma and first run
-               if ( !matched || (match = rcomma.exec( soFar )) ) {
+               if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
                        if ( match ) {
+
                                // Don't consume trailing commas as valid
-                               soFar = soFar.slice( match[0].length ) || soFar;
+                               soFar = soFar.slice( match[ 0 ].length ) || soFar;
                        }
-                       groups.push( (tokens = []) );
+                       groups.push( ( tokens = [] ) );
                }
 
                matched = false;
 
                // Combinators
-               if ( (match = rcombinators.exec( soFar )) ) {
+               if ( ( match = rleadingCombinator.exec( soFar ) ) ) {
                        matched = match.shift();
-                       tokens.push({
+                       tokens.push( {
                                value: matched,
+
                                // Cast descendant combinators to space
-                               type: match[0].replace( rtrim, " " )
-                       });
+                               type: match[ 0 ].replace( rtrimCSS, " " )
+                       } );
                        soFar = soFar.slice( matched.length );
                }
 
                // Filters
                for ( type in Expr.filter ) {
-                       if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-                               (match = preFilters[ type ]( match ))) ) {
+                       if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
+                               ( match = preFilters[ type ]( match ) ) ) ) {
                                matched = match.shift();
-                               tokens.push({
+                               tokens.push( {
                                        value: matched,
                                        type: type,
                                        matches: match
-                               });
+                               } );
                                soFar = soFar.slice( matched.length );
                        }
                }
@@ -2153,47 +2145,54 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
        // Return the length of the invalid excess
        // if we're just parsing
        // Otherwise, throw an error or return tokens
-       return parseOnly ?
-               soFar.length :
-               soFar ?
-                       Sizzle.error( selector ) :
-                       // Cache the tokens
-                       tokenCache( selector, groups ).slice( 0 );
-};
+       if ( parseOnly ) {
+               return soFar.length;
+       }
+
+       return soFar ?
+               find.error( selector ) :
+
+               // Cache the tokens
+               tokenCache( selector, groups ).slice( 0 );
+}
 
 function toSelector( tokens ) {
        var i = 0,
                len = tokens.length,
                selector = "";
        for ( ; i < len; i++ ) {
-               selector += tokens[i].value;
+               selector += tokens[ i ].value;
        }
        return selector;
 }
 
 function addCombinator( matcher, combinator, base ) {
        var dir = combinator.dir,
-               checkNonElements = base && dir === "parentNode",
+               skip = combinator.next,
+               key = skip || dir,
+               checkNonElements = base && key === "parentNode",
                doneName = done++;
 
        return combinator.first ?
+
                // Check against closest ancestor/preceding element
                function( elem, context, xml ) {
-                       while ( (elem = elem[ dir ]) ) {
+                       while ( ( elem = elem[ dir ] ) ) {
                                if ( elem.nodeType === 1 || checkNonElements ) {
                                        return matcher( elem, context, xml );
                                }
                        }
+                       return false;
                } :
 
                // Check against all ancestor/preceding elements
                function( elem, context, xml ) {
-                       var oldCache, uniqueCache, outerCache,
+                       var oldCache, outerCache,
                                newCache = [ dirruns, doneName ];
 
                        // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
                        if ( xml ) {
-                               while ( (elem = elem[ dir ]) ) {
+                               while ( ( elem = elem[ dir ] ) ) {
                                        if ( elem.nodeType === 1 || checkNonElements ) {
                                                if ( matcher( elem, context, xml ) ) {
                                                        return true;
@@ -2201,31 +2200,31 @@ function addCombinator( matcher, combinator, base ) {
                                        }
                                }
                        } else {
-                               while ( (elem = elem[ dir ]) ) {
+                               while ( ( elem = elem[ dir ] ) ) {
                                        if ( elem.nodeType === 1 || checkNonElements ) {
-                                               outerCache = elem[ expando ] || (elem[ expando ] = {});
+                                               outerCache = elem[ expando ] || ( elem[ expando ] = {} );
 
-                                               // Support: IE <9 only
-                                               // Defend against cloned attroperties (jQuery gh-1709)
-                                               uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
-
-                                               if ( (oldCache = uniqueCache[ dir ]) &&
+                                               if ( skip && nodeName( elem, skip ) ) {
+                                                       elem = elem[ dir ] || elem;
+                                               } else if ( ( oldCache = outerCache[ key ] ) &&
                                                        oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
 
                                                        // Assign to newCache so results back-propagate to previous elements
-                                                       return (newCache[ 2 ] = oldCache[ 2 ]);
+                                                       return ( newCache[ 2 ] = oldCache[ 2 ] );
                                                } else {
+
                                                        // Reuse newcache so results back-propagate to previous elements
-                                                       uniqueCache[ dir ] = newCache;
+                                                       outerCache[ key ] = newCache;
 
                                                        // A match means we're done; a fail means we have to keep checking
-                                                       if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+                                                       if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
                                                                return true;
                                                        }
                                                }
                                        }
                                }
                        }
+                       return false;
                };
 }
 
@@ -2234,20 +2233,20 @@ function elementMatcher( matchers ) {
                function( elem, context, xml ) {
                        var i = matchers.length;
                        while ( i-- ) {
-                               if ( !matchers[i]( elem, context, xml ) ) {
+                               if ( !matchers[ i ]( elem, context, xml ) ) {
                                        return false;
                                }
                        }
                        return true;
                } :
-               matchers[0];
+               matchers[ 0 ];
 }
 
 function multipleContexts( selector, contexts, results ) {
        var i = 0,
                len = contexts.length;
        for ( ; i < len; i++ ) {
-               Sizzle( selector, contexts[i], results );
+               find( selector, contexts[ i ], results );
        }
        return results;
 }
@@ -2260,7 +2259,7 @@ function condense( unmatched, map, filter, context, xml ) {
                mapped = map != null;
 
        for ( ; i < len; i++ ) {
-               if ( (elem = unmatched[i]) ) {
+               if ( ( elem = unmatched[ i ] ) ) {
                        if ( !filter || filter( elem, context, xml ) ) {
                                newUnmatched.push( elem );
                                if ( mapped ) {
@@ -2280,34 +2279,38 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
        if ( postFinder && !postFinder[ expando ] ) {
                postFinder = setMatcher( postFinder, postSelector );
        }
-       return markFunction(function( seed, results, context, xml ) {
-               var temp, i, elem,
+       return markFunction( function( seed, results, context, xml ) {
+               var temp, i, elem, matcherOut,
                        preMap = [],
                        postMap = [],
                        preexisting = results.length,
 
                        // Get initial elements from seed or context
-                       elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+                       elems = seed ||
+                               multipleContexts( selector || "*",
+                                       context.nodeType ? [ context ] : context, [] ),
 
                        // Prefilter to get matcher input, preserving a map for seed-results synchronization
                        matcherIn = preFilter && ( seed || !selector ) ?
                                condense( elems, preMap, preFilter, context, xml ) :
-                               elems,
+                               elems;
+
+               if ( matcher ) {
 
-                       matcherOut = matcher ?
-                               // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
-                               postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+                       // If we have a postFinder, or filtered seed, or non-seed postFilter
+                       // or preexisting results,
+                       matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
 
-                                       // ...intermediate processing is necessary
-                                       [] :
+                               // ...intermediate processing is necessary
+                               [] :
 
-                                       // ...otherwise use results directly
-                                       results :
-                               matcherIn;
+                               // ...otherwise use results directly
+                               results;
 
-               // Find primary matches
-               if ( matcher ) {
+                       // Find primary matches
                        matcher( matcherIn, matcherOut, context, xml );
+               } else {
+                       matcherOut = matcherIn;
                }
 
                // Apply postFilter
@@ -2318,8 +2321,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
                        // Un-match failing elements by moving them back to matcherIn
                        i = temp.length;
                        while ( i-- ) {
-                               if ( (elem = temp[i]) ) {
-                                       matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+                               if ( ( elem = temp[ i ] ) ) {
+                                       matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
                                }
                        }
                }
@@ -2327,25 +2330,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
                if ( seed ) {
                        if ( postFinder || preFilter ) {
                                if ( postFinder ) {
+
                                        // Get the final matcherOut by condensing this intermediate into postFinder contexts
                                        temp = [];
                                        i = matcherOut.length;
                                        while ( i-- ) {
-                                               if ( (elem = matcherOut[i]) ) {
+                                               if ( ( elem = matcherOut[ i ] ) ) {
+
                                                        // Restore matcherIn since elem is not yet a final match
-                                                       temp.push( (matcherIn[i] = elem) );
+                                                       temp.push( ( matcherIn[ i ] = elem ) );
                                                }
                                        }
-                                       postFinder( null, (matcherOut = []), temp, xml );
+                                       postFinder( null, ( matcherOut = [] ), temp, xml );
                                }
 
                                // Move matched elements from seed to results to keep them synchronized
                                i = matcherOut.length;
                                while ( i-- ) {
-                                       if ( (elem = matcherOut[i]) &&
-                                               (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+                                       if ( ( elem = matcherOut[ i ] ) &&
+                                               ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) {
 
-                                               seed[temp] = !(results[temp] = elem);
+                                               seed[ temp ] = !( results[ temp ] = elem );
                                        }
                                }
                        }
@@ -2363,14 +2368,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS
                                push.apply( results, matcherOut );
                        }
                }
-       });
+       } );
 }
 
 function matcherFromTokens( tokens ) {
        var checkContext, matcher, j,
                len = tokens.length,
-               leadingRelative = Expr.relative[ tokens[0].type ],
-               implicitRelative = leadingRelative || Expr.relative[" "],
+               leadingRelative = Expr.relative[ tokens[ 0 ].type ],
+               implicitRelative = leadingRelative || Expr.relative[ " " ],
                i = leadingRelative ? 1 : 0,
 
                // The foundational matcher ensures that elements are reachable from top-level context(s)
@@ -2378,42 +2383,52 @@ function matcherFromTokens( tokens ) {
                        return elem === checkContext;
                }, implicitRelative, true ),
                matchAnyContext = addCombinator( function( elem ) {
-                       return indexOf( checkContext, elem ) > -1;
+                       return indexOf.call( checkContext, elem ) > -1;
                }, implicitRelative, true ),
                matchers = [ function( elem, context, xml ) {
-                       var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
-                               (checkContext = context).nodeType ?
+
+                       // Support: IE 11+, Edge 17 - 18+
+                       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+                       // two documents; shallow comparisons work.
+                       // eslint-disable-next-line eqeqeq
+                       var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
+                               ( checkContext = context ).nodeType ?
                                        matchContext( elem, context, xml ) :
                                        matchAnyContext( elem, context, xml ) );
-                       // Avoid hanging onto element (issue #299)
+
+                       // Avoid hanging onto element
+                       // (see https://github.com/jquery/sizzle/issues/299)
                        checkContext = null;
                        return ret;
                } ];
 
        for ( ; i < len; i++ ) {
-               if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
-                       matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+               if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
+                       matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
                } else {
-                       matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+                       matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
 
                        // Return special upon seeing a positional matcher
                        if ( matcher[ expando ] ) {
+
                                // Find the next relative operator (if any) for proper handling
                                j = ++i;
                                for ( ; j < len; j++ ) {
-                                       if ( Expr.relative[ tokens[j].type ] ) {
+                                       if ( Expr.relative[ tokens[ j ].type ] ) {
                                                break;
                                        }
                                }
                                return setMatcher(
                                        i > 1 && elementMatcher( matchers ),
                                        i > 1 && toSelector(
+
                                                // If the preceding token was a descendant combinator, insert an implicit any-element `*`
-                                               tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
-                                       ).replace( rtrim, "$1" ),
+                                               tokens.slice( 0, i - 1 )
+                                                       .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
+                                       ).replace( rtrimCSS, "$1" ),
                                        matcher,
                                        i < j && matcherFromTokens( tokens.slice( i, j ) ),
-                                       j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+                                       j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
                                        j < len && toSelector( tokens )
                                );
                        }
@@ -2434,29 +2449,42 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                                unmatched = seed && [],
                                setMatched = [],
                                contextBackup = outermostContext,
+
                                // We must always have either seed elements or outermost context
-                               elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+                               elems = seed || byElement && Expr.find.TAG( "*", outermost ),
+
                                // Use integer dirruns iff this is the outermost matcher
-                               dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+                               dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
                                len = elems.length;
 
                        if ( outermost ) {
-                               outermostContext = context === document || context || outermost;
+
+                               // Support: IE 11+, Edge 17 - 18+
+                               // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+                               // two documents; shallow comparisons work.
+                               // eslint-disable-next-line eqeqeq
+                               outermostContext = context == document || context || outermost;
                        }
 
                        // Add elements passing elementMatchers directly to results
-                       // Support: IE<9, Safari
-                       // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
-                       for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+                       // Support: iOS <=7 - 9 only
+                       // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching
+                       // elements by id. (see trac-14142)
+                       for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
                                if ( byElement && elem ) {
                                        j = 0;
-                                       if ( !context && elem.ownerDocument !== document ) {
+
+                                       // Support: IE 11+, Edge 17 - 18+
+                                       // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
+                                       // two documents; shallow comparisons work.
+                                       // eslint-disable-next-line eqeqeq
+                                       if ( !context && elem.ownerDocument != document ) {
                                                setDocument( elem );
                                                xml = !documentIsHTML;
                                        }
-                                       while ( (matcher = elementMatchers[j++]) ) {
-                                               if ( matcher( elem, context || document, xml) ) {
-                                                       results.push( elem );
+                                       while ( ( matcher = elementMatchers[ j++ ] ) ) {
+                                               if ( matcher( elem, context || document, xml ) ) {
+                                                       push.call( results, elem );
                                                        break;
                                                }
                                        }
@@ -2467,8 +2495,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
 
                                // Track unmatched elements for set filters
                                if ( bySet ) {
+
                                        // They will have gone through all possible matchers
-                                       if ( (elem = !matcher && elem) ) {
+                                       if ( ( elem = !matcher && elem ) ) {
                                                matchedCount--;
                                        }
 
@@ -2492,16 +2521,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                        // numerically zero.
                        if ( bySet && i !== matchedCount ) {
                                j = 0;
-                               while ( (matcher = setMatchers[j++]) ) {
+                               while ( ( matcher = setMatchers[ j++ ] ) ) {
                                        matcher( unmatched, setMatched, context, xml );
                                }
 
                                if ( seed ) {
+
                                        // Reintegrate element matches to eliminate the need for sorting
                                        if ( matchedCount > 0 ) {
                                                while ( i-- ) {
-                                                       if ( !(unmatched[i] || setMatched[i]) ) {
-                                                               setMatched[i] = pop.call( results );
+                                                       if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
+                                                               setMatched[ i ] = pop.call( results );
                                                        }
                                                }
                                        }
@@ -2517,7 +2547,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                                if ( outermost && !seed && setMatched.length > 0 &&
                                        ( matchedCount + setMatchers.length ) > 1 ) {
 
-                                       Sizzle.uniqueSort( results );
+                                       jQuery.uniqueSort( results );
                                }
                        }
 
@@ -2535,20 +2565,21 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                superMatcher;
 }
 
-compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+function compile( selector, match /* Internal Use Only */ ) {
        var i,
                setMatchers = [],
                elementMatchers = [],
                cached = compilerCache[ selector + " " ];
 
        if ( !cached ) {
+
                // Generate a function of recursive functions that can be used to check each element
                if ( !match ) {
                        match = tokenize( selector );
                }
                i = match.length;
                while ( i-- ) {
-                       cached = matcherFromTokens( match[i] );
+                       cached = matcherFromTokens( match[ i ] );
                        if ( cached[ expando ] ) {
                                setMatchers.push( cached );
                        } else {
@@ -2557,27 +2588,28 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
                }
 
                // Cache the compiled function
-               cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+               cached = compilerCache( selector,
+                       matcherFromGroupMatchers( elementMatchers, setMatchers ) );
 
                // Save selector and tokenization
                cached.selector = selector;
        }
        return cached;
-};
+}
 
 /**
- * A low-level selection function that works with Sizzle's compiled
+ * A low-level selection function that works with jQuery's compiled
  *  selector functions
  * @param {String|Function} selector A selector or a pre-compiled
- *  selector function built with Sizzle.compile
+ *  selector function built with jQuery selector compile
  * @param {Element} context
  * @param {Array} [results]
  * @param {Array} [seed] A set of elements to match against
  */
-select = Sizzle.select = function( selector, context, results, seed ) {
+function select( selector, context, results, seed ) {
        var i, tokens, token, type, find,
                compiled = typeof selector === "function" && selector,
-               match = !seed && tokenize( (selector = compiled.selector || selector) );
+               match = !seed && tokenize( ( selector = compiled.selector || selector ) );
 
        results = results || [];
 
@@ -2586,12 +2618,14 @@ select = Sizzle.select = function( selector, context, results, seed ) {
        if ( match.length === 1 ) {
 
                // Reduce context if the leading compound selector is an ID
-               tokens = match[0] = match[0].slice( 0 );
-               if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-                               support.getById && context.nodeType === 9 && documentIsHTML &&
-                               Expr.relative[ tokens[1].type ] ) {
-
-                       context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+               tokens = match[ 0 ] = match[ 0 ].slice( 0 );
+               if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
+                               context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
+
+                       context = ( Expr.find.ID(
+                               token.matches[ 0 ].replace( runescape, funescape ),
+                               context
+                       ) || [] )[ 0 ];
                        if ( !context ) {
                                return results;
 
@@ -2604,20 +2638,22 @@ select = Sizzle.select = function( selector, context, results, seed ) {
                }
 
                // Fetch a seed set for right-to-left matching
-               i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+               i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length;
                while ( i-- ) {
-                       token = tokens[i];
+                       token = tokens[ i ];
 
                        // Abort if we hit a combinator
-                       if ( Expr.relative[ (type = token.type) ] ) {
+                       if ( Expr.relative[ ( type = token.type ) ] ) {
                                break;
                        }
-                       if ( (find = Expr.find[ type ]) ) {
+                       if ( ( find = Expr.find[ type ] ) ) {
+
                                // Search, expanding context for leading sibling combinators
-                               if ( (seed = find(
-                                       token.matches[0].replace( runescape, funescape ),
-                                       rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
-                               )) ) {
+                               if ( ( seed = find(
+                                       token.matches[ 0 ].replace( runescape, funescape ),
+                                       rsibling.test( tokens[ 0 ].type ) &&
+                                               testContext( context.parentNode ) || context
+                               ) ) ) {
 
                                        // If seed is empty or no tokens remain, we can return early
                                        tokens.splice( i, 1 );
@@ -2643,85 +2679,48 @@ select = Sizzle.select = function( selector, context, results, seed ) {
                !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
        );
        return results;
-};
+}
 
 // One-time assignments
 
+// Support: Android <=4.0 - 4.1+
 // Sort stability
-support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
-
-// Support: Chrome 14-35+
-// Always assume duplicates if they aren't passed to the comparison function
-support.detectDuplicates = !!hasDuplicate;
+support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
 
 // Initialize against the default document
 setDocument();
 
-// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Support: Android <=4.0 - 4.1+
 // Detached nodes confoundingly follow *each other*
-support.sortDetached = assert(function( div1 ) {
+support.sortDetached = assert( function( el ) {
+
        // Should return 1, but returns 4 (following)
-       return div1.compareDocumentPosition( document.createElement("div") ) & 1;
-});
-
-// Support: IE<8
-// Prevent attribute/property "interpolation"
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !assert(function( div ) {
-       div.innerHTML = "<a href='#'></a>";
-       return div.firstChild.getAttribute("href") === "#" ;
-}) ) {
-       addHandle( "type|href|height|width", function( elem, name, isXML ) {
-               if ( !isXML ) {
-                       return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
-               }
-       });
-}
+       return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
+} );
 
-// Support: IE<9
-// Use defaultValue in place of getAttribute("value")
-if ( !support.attributes || !assert(function( div ) {
-       div.innerHTML = "<input/>";
-       div.firstChild.setAttribute( "value", "" );
-       return div.firstChild.getAttribute( "value" ) === "";
-}) ) {
-       addHandle( "value", function( elem, name, isXML ) {
-               if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
-                       return elem.defaultValue;
-               }
-       });
-}
+jQuery.find = find;
 
-// Support: IE<9
-// Use getAttributeNode to fetch booleans when getAttribute lies
-if ( !assert(function( div ) {
-       return div.getAttribute("disabled") == null;
-}) ) {
-       addHandle( booleans, function( elem, name, isXML ) {
-               var val;
-               if ( !isXML ) {
-                       return elem[ name ] === true ? name.toLowerCase() :
-                                       (val = elem.getAttributeNode( name )) && val.specified ?
-                                       val.value :
-                               null;
-               }
-       });
-}
+// Deprecated
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;
+jQuery.unique = jQuery.uniqueSort;
 
-return Sizzle;
+// These have always been private, but they used to be documented as part of
+// Sizzle so let's maintain them for now for backwards compatibility purposes.
+find.compile = compile;
+find.select = select;
+find.setDocument = setDocument;
+find.tokenize = tokenize;
 
-})( window );
+find.escape = jQuery.escapeSelector;
+find.getText = jQuery.text;
+find.isXML = jQuery.isXMLDoc;
+find.selectors = jQuery.expr;
+find.support = jQuery.support;
+find.uniqueSort = jQuery.uniqueSort;
 
+       /* eslint-enable */
 
-
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[ ":" ] = jQuery.expr.pseudos;
-jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
+} )();
 
 
 var dir = function( elem, dir, until ) {
@@ -2755,40 +2754,34 @@ var siblings = function( n, elem ) {
 
 var rneedsContext = jQuery.expr.match.needsContext;
 
-var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
-
+var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
 
 
-var risSimple = /^.[^:#\[\.,]*$/;
 
 // Implement the identical functionality for filter and not
 function winnow( elements, qualifier, not ) {
-       if ( jQuery.isFunction( qualifier ) ) {
+       if ( isFunction( qualifier ) ) {
                return jQuery.grep( elements, function( elem, i ) {
-                       /* jshint -W018 */
                        return !!qualifier.call( elem, i, elem ) !== not;
                } );
-
        }
 
+       // Single element
        if ( qualifier.nodeType ) {
                return jQuery.grep( elements, function( elem ) {
                        return ( elem === qualifier ) !== not;
                } );
-
        }
 
-       if ( typeof qualifier === "string" ) {
-               if ( risSimple.test( qualifier ) ) {
-                       return jQuery.filter( qualifier, elements, not );
-               }
-
-               qualifier = jQuery.filter( qualifier, elements );
+       // Arraylike of elements (jQuery, arguments, Array)
+       if ( typeof qualifier !== "string" ) {
+               return jQuery.grep( elements, function( elem ) {
+                       return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
+               } );
        }
 
-       return jQuery.grep( elements, function( elem ) {
-               return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not;
-       } );
+       // Filtered directly for both simple and complex selectors
+       return jQuery.filter( qualifier, elements, not );
 }
 
 jQuery.filter = function( expr, elems, not ) {
@@ -2798,19 +2791,20 @@ jQuery.filter = function( expr, elems, not ) {
                expr = ":not(" + expr + ")";
        }
 
-       return elems.length === 1 && elem.nodeType === 1 ?
-               jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
-               jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
-                       return elem.nodeType === 1;
-               } ) );
+       if ( elems.length === 1 && elem.nodeType === 1 ) {
+               return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
+       }
+
+       return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+               return elem.nodeType === 1;
+       } ) );
 };
 
 jQuery.fn.extend( {
        find: function( selector ) {
-               var i,
-                       ret = [],
-                       self = this,
-                       len = self.length;
+               var i, ret,
+                       len = this.length,
+                       self = this;
 
                if ( typeof selector !== "string" ) {
                        return this.pushStack( jQuery( selector ).filter( function() {
@@ -2822,14 +2816,13 @@ jQuery.fn.extend( {
                        } ) );
                }
 
+               ret = this.pushStack( [] );
+
                for ( i = 0; i < len; i++ ) {
                        jQuery.find( selector, self[ i ], ret );
                }
 
-               // Needed because $( selector, context ) becomes $( context ).find( selector )
-               ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
-               ret.selector = this.selector ? this.selector + " " + selector : selector;
-               return ret;
+               return len > 1 ? jQuery.uniqueSort( ret ) : ret;
        },
        filter: function( selector ) {
                return this.pushStack( winnow( this, selector || [], false ) );
@@ -2859,9 +2852,10 @@ jQuery.fn.extend( {
 var rootjQuery,
 
        // A simple way to check for HTML strings
-       // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-       // Strict HTML recognition (#11290: must start with <)
-       rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+       // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)
+       // Strict HTML recognition (trac-11290: must start with <)
+       // Shortcut simple #id case for speed
+       rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
 
        init = jQuery.fn.init = function( selector, context, root ) {
                var match, elem;
@@ -2871,14 +2865,14 @@ var rootjQuery,
                        return this;
                }
 
-               // init accepts an alternate rootjQuery
+               // Method init() accepts an alternate rootjQuery
                // so migrate can support jQuery.sub (gh-2101)
                root = root || rootjQuery;
 
                // Handle HTML strings
                if ( typeof selector === "string" ) {
-                       if ( selector.charAt( 0 ) === "<" &&
-                               selector.charAt( selector.length - 1 ) === ">" &&
+                       if ( selector[ 0 ] === "<" &&
+                               selector[ selector.length - 1 ] === ">" &&
                                selector.length >= 3 ) {
 
                                // Assume that strings that start and end with <> are HTML and skip the regex check
@@ -2895,7 +2889,7 @@ var rootjQuery,
                                if ( match[ 1 ] ) {
                                        context = context instanceof jQuery ? context[ 0 ] : context;
 
-                                       // scripts is true for back-compat
+                                       // Option to run scripts is true for back-compat
                                        // Intentionally let the error be thrown if parseHTML is not present
                                        jQuery.merge( this, jQuery.parseHTML(
                                                match[ 1 ],
@@ -2908,7 +2902,7 @@ var rootjQuery,
                                                for ( match in context ) {
 
                                                        // Properties of context are called as methods if possible
-                                                       if ( jQuery.isFunction( this[ match ] ) ) {
+                                                       if ( isFunction( this[ match ] ) ) {
                                                                this[ match ]( context[ match ] );
 
                                                        // ...and otherwise set as attributes
@@ -2924,23 +2918,12 @@ var rootjQuery,
                                } else {
                                        elem = document.getElementById( match[ 2 ] );
 
-                                       // Check parentNode to catch when Blackberry 4.6 returns
-                                       // nodes that are no longer in the document #6963
-                                       if ( elem && elem.parentNode ) {
-
-                                               // Handle the case where IE and Opera return items
-                                               // by name instead of ID
-                                               if ( elem.id !== match[ 2 ] ) {
-                                                       return rootjQuery.find( selector );
-                                               }
+                                       if ( elem ) {
 
-                                               // Otherwise, we inject the element directly into the jQuery object
-                                               this.length = 1;
+                                               // Inject the element directly into the jQuery object
                                                this[ 0 ] = elem;
+                                               this.length = 1;
                                        }
-
-                                       this.context = document;
-                                       this.selector = selector;
                                        return this;
                                }
 
@@ -2956,25 +2939,20 @@ var rootjQuery,
 
                // HANDLE: $(DOMElement)
                } else if ( selector.nodeType ) {
-                       this.context = this[ 0 ] = selector;
+                       this[ 0 ] = selector;
                        this.length = 1;
                        return this;
 
                // HANDLE: $(function)
                // Shortcut for document ready
-               } else if ( jQuery.isFunction( selector ) ) {
-                       return typeof root.ready !== "undefined" ?
+               } else if ( isFunction( selector ) ) {
+                       return root.ready !== undefined ?
                                root.ready( selector ) :
 
                                // Execute immediately if ready is not present
                                selector( jQuery );
                }
 
-               if ( selector.selector !== undefined ) {
-                       this.selector = selector.selector;
-                       this.context = selector.context;
-               }
-
                return jQuery.makeArray( selector, this );
        };
 
@@ -2987,7 +2965,7 @@ rootjQuery = jQuery( document );
 
 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
 
-       // methods guaranteed to produce a unique set when starting from a unique set
+       // Methods guaranteed to produce a unique set when starting from a unique set
        guaranteedUnique = {
                children: true,
                contents: true,
@@ -2997,12 +2975,12 @@ var rparentsprev = /^(?:parents|prev(?:Until|All))/,
 
 jQuery.fn.extend( {
        has: function( target ) {
-               var i,
-                       targets = jQuery( target, this ),
-                       len = targets.length;
+               var targets = jQuery( target, this ),
+                       l = targets.length;
 
                return this.filter( function() {
-                       for ( i = 0; i < len; i++ ) {
+                       var i = 0;
+                       for ( ; i < l; i++ ) {
                                if ( jQuery.contains( this, targets[ i ] ) ) {
                                        return true;
                                }
@@ -3015,23 +2993,24 @@ jQuery.fn.extend( {
                        i = 0,
                        l = this.length,
                        matched = [],
-                       pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-                               jQuery( selectors, context || this.context ) :
-                               0;
+                       targets = typeof selectors !== "string" && jQuery( selectors );
 
-               for ( ; i < l; i++ ) {
-                       for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
+               // Positional selectors never match, since there's no _selection_ context
+               if ( !rneedsContext.test( selectors ) ) {
+                       for ( ; i < l; i++ ) {
+                               for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
 
-                               // Always skip document fragments
-                               if ( cur.nodeType < 11 && ( pos ?
-                                       pos.index( cur ) > -1 :
+                                       // Always skip document fragments
+                                       if ( cur.nodeType < 11 && ( targets ?
+                                               targets.index( cur ) > -1 :
 
-                                       // Don't pass non-elements to Sizzle
-                                       cur.nodeType === 1 &&
-                                               jQuery.find.matchesSelector( cur, selectors ) ) ) {
+                                               // Don't pass non-elements to jQuery#find
+                                               cur.nodeType === 1 &&
+                                                       jQuery.find.matchesSelector( cur, selectors ) ) ) {
 
-                                       matched.push( cur );
-                                       break;
+                                               matched.push( cur );
+                                               break;
+                                       }
                                }
                        }
                }
@@ -3039,8 +3018,7 @@ jQuery.fn.extend( {
                return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
        },
 
-       // Determine the position of an element within
-       // the matched set of elements
+       // Determine the position of an element within the set
        index: function( elem ) {
 
                // No argument, return index in parent
@@ -3048,16 +3026,17 @@ jQuery.fn.extend( {
                        return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
                }
 
-               // index in selector
+               // Index in selector
                if ( typeof elem === "string" ) {
-                       return jQuery.inArray( this[ 0 ], jQuery( elem ) );
+                       return indexOf.call( jQuery( elem ), this[ 0 ] );
                }
 
                // Locate the position of the desired element
-               return jQuery.inArray(
+               return indexOf.call( this,
 
                        // If it receives a jQuery object, the first element is used
-                       elem.jquery ? elem[ 0 ] : elem, this );
+                       elem.jquery ? elem[ 0 ] : elem
+               );
        },
 
        add: function( selector, context ) {
@@ -3076,10 +3055,7 @@ jQuery.fn.extend( {
 } );
 
 function sibling( cur, dir ) {
-       do {
-               cur = cur[ dir ];
-       } while ( cur && cur.nodeType !== 1 );
-
+       while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
        return cur;
 }
 
@@ -3091,7 +3067,7 @@ jQuery.each( {
        parents: function( elem ) {
                return dir( elem, "parentNode" );
        },
-       parentsUntil: function( elem, i, until ) {
+       parentsUntil: function( elem, _i, until ) {
                return dir( elem, "parentNode", until );
        },
        next: function( elem ) {
@@ -3106,10 +3082,10 @@ jQuery.each( {
        prevAll: function( elem ) {
                return dir( elem, "previousSibling" );
        },
-       nextUntil: function( elem, i, until ) {
+       nextUntil: function( elem, _i, until ) {
                return dir( elem, "nextSibling", until );
        },
-       prevUntil: function( elem, i, until ) {
+       prevUntil: function( elem, _i, until ) {
                return dir( elem, "previousSibling", until );
        },
        siblings: function( elem ) {
@@ -3119,46 +3095,61 @@ jQuery.each( {
                return siblings( elem.firstChild );
        },
        contents: function( elem ) {
-               return jQuery.nodeName( elem, "iframe" ) ?
-                       elem.contentDocument || elem.contentWindow.document :
-                       jQuery.merge( [], elem.childNodes );
+               if ( elem.contentDocument != null &&
+
+                       // Support: IE 11+
+                       // <object> elements with no `data` attribute has an object
+                       // `contentDocument` with a `null` prototype.
+                       getProto( elem.contentDocument ) ) {
+
+                       return elem.contentDocument;
+               }
+
+               // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
+               // Treat the template element as a regular one in browsers that
+               // don't support it.
+               if ( nodeName( elem, "template" ) ) {
+                       elem = elem.content || elem;
+               }
+
+               return jQuery.merge( [], elem.childNodes );
        }
 }, function( name, fn ) {
        jQuery.fn[ name ] = function( until, selector ) {
-               var ret = jQuery.map( this, fn, until );
+               var matched = jQuery.map( this, fn, until );
 
                if ( name.slice( -5 ) !== "Until" ) {
                        selector = until;
                }
 
                if ( selector && typeof selector === "string" ) {
-                       ret = jQuery.filter( selector, ret );
+                       matched = jQuery.filter( selector, matched );
                }
 
                if ( this.length > 1 ) {
 
                        // Remove duplicates
                        if ( !guaranteedUnique[ name ] ) {
-                               ret = jQuery.uniqueSort( ret );
+                               jQuery.uniqueSort( matched );
                        }
 
                        // Reverse order for parents* and prev-derivatives
                        if ( rparentsprev.test( name ) ) {
-                               ret = ret.reverse();
+                               matched.reverse();
                        }
                }
 
-               return this.pushStack( ret );
+               return this.pushStack( matched );
        };
 } );
-var rnotwhite = ( /\S+/g );
+var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
 
 
 
 // Convert String-formatted options into Object-formatted ones
 function createOptions( options ) {
        var object = {};
-       jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+       jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
                object[ flag ] = true;
        } );
        return object;
@@ -3219,7 +3210,7 @@ jQuery.Callbacks = function( options ) {
                fire = function() {
 
                        // Enforce single-firing
-                       locked = options.once;
+                       locked = locked || options.once;
 
                        // Execute callbacks for all pending executions,
                        // respecting firingIndex overrides and runtime changes
@@ -3275,11 +3266,11 @@ jQuery.Callbacks = function( options ) {
 
                                        ( function add( args ) {
                                                jQuery.each( args, function( _, arg ) {
-                                                       if ( jQuery.isFunction( arg ) ) {
+                                                       if ( isFunction( arg ) ) {
                                                                if ( !options.unique || !self.has( arg ) ) {
                                                                        list.push( arg );
                                                                }
-                                                       } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
+                                                       } else if ( arg && arg.length && toType( arg ) !== "string" ) {
 
                                                                // Inspect recursively
                                                                add( arg );
@@ -3342,9 +3333,9 @@ jQuery.Callbacks = function( options ) {
                        // Also disable .add unless we have memory (since it would have no effect)
                        // Abort any pending executions
                        lock: function() {
-                               locked = true;
-                               if ( !memory ) {
-                                       self.disable();
+                               locked = queue = [];
+                               if ( !memory && !firing ) {
+                                       list = memory = "";
                                }
                                return this;
                        },
@@ -3381,15 +3372,59 @@ jQuery.Callbacks = function( options ) {
 };
 
 
+function Identity( v ) {
+       return v;
+}
+function Thrower( ex ) {
+       throw ex;
+}
+
+function adoptValue( value, resolve, reject, noValue ) {
+       var method;
+
+       try {
+
+               // Check for promise aspect first to privilege synchronous behavior
+               if ( value && isFunction( ( method = value.promise ) ) ) {
+                       method.call( value ).done( resolve ).fail( reject );
+
+               // Other thenables
+               } else if ( value && isFunction( ( method = value.then ) ) ) {
+                       method.call( value, resolve, reject );
+
+               // Other non-thenables
+               } else {
+
+                       // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
+                       // * false: [ value ].slice( 0 ) => resolve( value )
+                       // * true: [ value ].slice( 1 ) => resolve()
+                       resolve.apply( undefined, [ value ].slice( noValue ) );
+               }
+
+       // For Promises/A+, convert exceptions into rejections
+       // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
+       // Deferred#then to conditionally suppress rejection.
+       } catch ( value ) {
+
+               // Support: Android 4.0 only
+               // Strict mode functions invoked without .call/.apply get global-object context
+               reject.apply( undefined, [ value ] );
+       }
+}
+
 jQuery.extend( {
 
        Deferred: function( func ) {
                var tuples = [
 
-                               // action, add listener, listener list, final state
-                               [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
-                               [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
-                               [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
+                               // action, add listener, callbacks,
+                               // ... .then handlers, argument index, [final state]
+                               [ "notify", "progress", jQuery.Callbacks( "memory" ),
+                                       jQuery.Callbacks( "memory" ), 2 ],
+                               [ "resolve", "done", jQuery.Callbacks( "once memory" ),
+                                       jQuery.Callbacks( "once memory" ), 0, "resolved" ],
+                               [ "reject", "fail", jQuery.Callbacks( "once memory" ),
+                                       jQuery.Callbacks( "once memory" ), 1, "rejected" ]
                        ],
                        state = "pending",
                        promise = {
@@ -3400,23 +3435,33 @@ jQuery.extend( {
                                        deferred.done( arguments ).fail( arguments );
                                        return this;
                                },
-                               then: function( /* fnDone, fnFail, fnProgress */ ) {
+                               "catch": function( fn ) {
+                                       return promise.then( null, fn );
+                               },
+
+                               // Keep pipe for back-compat
+                               pipe: function( /* fnDone, fnFail, fnProgress */ ) {
                                        var fns = arguments;
+
                                        return jQuery.Deferred( function( newDefer ) {
-                                               jQuery.each( tuples, function( i, tuple ) {
-                                                       var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+                                               jQuery.each( tuples, function( _i, tuple ) {
 
-                                                       // deferred[ done | fail | progress ] for forwarding actions to newDefer
+                                                       // Map tuples (progress, done, fail) to arguments (done, fail, progress)
+                                                       var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
+
+                                                       // deferred.progress(function() { bind to newDefer or newDefer.notify })
+                                                       // deferred.done(function() { bind to newDefer or newDefer.resolve })
+                                                       // deferred.fail(function() { bind to newDefer or newDefer.reject })
                                                        deferred[ tuple[ 1 ] ]( function() {
                                                                var returned = fn && fn.apply( this, arguments );
-                                                               if ( returned && jQuery.isFunction( returned.promise ) ) {
+                                                               if ( returned && isFunction( returned.promise ) ) {
                                                                        returned.promise()
                                                                                .progress( newDefer.notify )
                                                                                .done( newDefer.resolve )
                                                                                .fail( newDefer.reject );
                                                                } else {
                                                                        newDefer[ tuple[ 0 ] + "With" ](
-                                                                               this === promise ? newDefer.promise() : this,
+                                                                               this,
                                                                                fn ? [ returned ] : arguments
                                                                        );
                                                                }
@@ -3425,6 +3470,177 @@ jQuery.extend( {
                                                fns = null;
                                        } ).promise();
                                },
+                               then: function( onFulfilled, onRejected, onProgress ) {
+                                       var maxDepth = 0;
+                                       function resolve( depth, deferred, handler, special ) {
+                                               return function() {
+                                                       var that = this,
+                                                               args = arguments,
+                                                               mightThrow = function() {
+                                                                       var returned, then;
+
+                                                                       // Support: Promises/A+ section 2.3.3.3.3
+                                                                       // https://promisesaplus.com/#point-59
+                                                                       // Ignore double-resolution attempts
+                                                                       if ( depth < maxDepth ) {
+                                                                               return;
+                                                                       }
+
+                                                                       returned = handler.apply( that, args );
+
+                                                                       // Support: Promises/A+ section 2.3.1
+                                                                       // https://promisesaplus.com/#point-48
+                                                                       if ( returned === deferred.promise() ) {
+                                                                               throw new TypeError( "Thenable self-resolution" );
+                                                                       }
+
+                                                                       // Support: Promises/A+ sections 2.3.3.1, 3.5
+                                                                       // https://promisesaplus.com/#point-54
+                                                                       // https://promisesaplus.com/#point-75
+                                                                       // Retrieve `then` only once
+                                                                       then = returned &&
+
+                                                                               // Support: Promises/A+ section 2.3.4
+                                                                               // https://promisesaplus.com/#point-64
+                                                                               // Only check objects and functions for thenability
+                                                                               ( typeof returned === "object" ||
+                                                                                       typeof returned === "function" ) &&
+                                                                               returned.then;
+
+                                                                       // Handle a returned thenable
+                                                                       if ( isFunction( then ) ) {
+
+                                                                               // Special processors (notify) just wait for resolution
+                                                                               if ( special ) {
+                                                                                       then.call(
+                                                                                               returned,
+                                                                                               resolve( maxDepth, deferred, Identity, special ),
+                                                                                               resolve( maxDepth, deferred, Thrower, special )
+                                                                                       );
+
+                                                                               // Normal processors (resolve) also hook into progress
+                                                                               } else {
+
+                                                                                       // ...and disregard older resolution values
+                                                                                       maxDepth++;
+
+                                                                                       then.call(
+                                                                                               returned,
+                                                                                               resolve( maxDepth, deferred, Identity, special ),
+                                                                                               resolve( maxDepth, deferred, Thrower, special ),
+                                                                                               resolve( maxDepth, deferred, Identity,
+                                                                                                       deferred.notifyWith )
+                                                                                       );
+                                                                               }
+
+                                                                       // Handle all other returned values
+                                                                       } else {
+
+                                                                               // Only substitute handlers pass on context
+                                                                               // and multiple values (non-spec behavior)
+                                                                               if ( handler !== Identity ) {
+                                                                                       that = undefined;
+                                                                                       args = [ returned ];
+                                                                               }
+
+                                                                               // Process the value(s)
+                                                                               // Default process is resolve
+                                                                               ( special || deferred.resolveWith )( that, args );
+                                                                       }
+                                                               },
+
+                                                               // Only normal processors (resolve) catch and reject exceptions
+                                                               process = special ?
+                                                                       mightThrow :
+                                                                       function() {
+                                                                               try {
+                                                                                       mightThrow();
+                                                                               } catch ( e ) {
+
+                                                                                       if ( jQuery.Deferred.exceptionHook ) {
+                                                                                               jQuery.Deferred.exceptionHook( e,
+                                                                                                       process.error );
+                                                                                       }
+
+                                                                                       // Support: Promises/A+ section 2.3.3.3.4.1
+                                                                                       // https://promisesaplus.com/#point-61
+                                                                                       // Ignore post-resolution exceptions
+                                                                                       if ( depth + 1 >= maxDepth ) {
+
+                                                                                               // Only substitute handlers pass on context
+                                                                                               // and multiple values (non-spec behavior)
+                                                                                               if ( handler !== Thrower ) {
+                                                                                                       that = undefined;
+                                                                                                       args = [ e ];
+                                                                                               }
+
+                                                                                               deferred.rejectWith( that, args );
+                                                                                       }
+                                                                               }
+                                                                       };
+
+                                                       // Support: Promises/A+ section 2.3.3.3.1
+                                                       // https://promisesaplus.com/#point-57
+                                                       // Re-resolve promises immediately to dodge false rejection from
+                                                       // subsequent errors
+                                                       if ( depth ) {
+                                                               process();
+                                                       } else {
+
+                                                               // Call an optional hook to record the error, in case of exception
+                                                               // since it's otherwise lost when execution goes async
+                                                               if ( jQuery.Deferred.getErrorHook ) {
+                                                                       process.error = jQuery.Deferred.getErrorHook();
+
+                                                               // The deprecated alias of the above. While the name suggests
+                                                               // returning the stack, not an error instance, jQuery just passes
+                                                               // it directly to `console.warn` so both will work; an instance
+                                                               // just better cooperates with source maps.
+                                                               } else if ( jQuery.Deferred.getStackHook ) {
+                                                                       process.error = jQuery.Deferred.getStackHook();
+                                                               }
+                                                               window.setTimeout( process );
+                                                       }
+                                               };
+                                       }
+
+                                       return jQuery.Deferred( function( newDefer ) {
+
+                                               // progress_handlers.add( ... )
+                                               tuples[ 0 ][ 3 ].add(
+                                                       resolve(
+                                                               0,
+                                                               newDefer,
+                                                               isFunction( onProgress ) ?
+                                                                       onProgress :
+                                                                       Identity,
+                                                               newDefer.notifyWith
+                                                       )
+                                               );
+
+                                               // fulfilled_handlers.add( ... )
+                                               tuples[ 1 ][ 3 ].add(
+                                                       resolve(
+                                                               0,
+                                                               newDefer,
+                                                               isFunction( onFulfilled ) ?
+                                                                       onFulfilled :
+                                                                       Identity
+                                                       )
+                                               );
+
+                                               // rejected_handlers.add( ... )
+                                               tuples[ 2 ][ 3 ].add(
+                                                       resolve(
+                                                               0,
+                                                               newDefer,
+                                                               isFunction( onRejected ) ?
+                                                                       onRejected :
+                                                                       Thrower
+                                                       )
+                                               );
+                                       } ).promise();
+                               },
 
                                // Get a promise for this deferred
                                // If obj is provided, the promise aspect is added to the object
@@ -3434,33 +3650,58 @@ jQuery.extend( {
                        },
                        deferred = {};
 
-               // Keep pipe for back-compat
-               promise.pipe = promise.then;
-
                // Add list-specific methods
                jQuery.each( tuples, function( i, tuple ) {
                        var list = tuple[ 2 ],
-                               stateString = tuple[ 3 ];
+                               stateString = tuple[ 5 ];
 
-                       // promise[ done | fail | progress ] = list.add
+                       // promise.progress = list.add
+                       // promise.done = list.add
+                       // promise.fail = list.add
                        promise[ tuple[ 1 ] ] = list.add;
 
                        // Handle state
                        if ( stateString ) {
-                               list.add( function() {
+                               list.add(
+                                       function() {
+
+                                               // state = "resolved" (i.e., fulfilled)
+                                               // state = "rejected"
+                                               state = stateString;
+                                       },
 
-                                       // state = [ resolved | rejected ]
-                                       state = stateString;
+                                       // rejected_callbacks.disable
+                                       // fulfilled_callbacks.disable
+                                       tuples[ 3 - i ][ 2 ].disable,
 
-                               // [ reject_list | resolve_list ].disable; progress_list.lock
-                               }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+                                       // rejected_handlers.disable
+                                       // fulfilled_handlers.disable
+                                       tuples[ 3 - i ][ 3 ].disable,
+
+                                       // progress_callbacks.lock
+                                       tuples[ 0 ][ 2 ].lock,
+
+                                       // progress_handlers.lock
+                                       tuples[ 0 ][ 3 ].lock
+                               );
                        }
 
-                       // deferred[ resolve | reject | notify ]
+                       // progress_handlers.fire
+                       // fulfilled_handlers.fire
+                       // rejected_handlers.fire
+                       list.add( tuple[ 3 ].fire );
+
+                       // deferred.notify = function() { deferred.notifyWith(...) }
+                       // deferred.resolve = function() { deferred.resolveWith(...) }
+                       // deferred.reject = function() { deferred.rejectWith(...) }
                        deferred[ tuple[ 0 ] ] = function() {
-                               deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
+                               deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
                                return this;
                        };
+
+                       // deferred.notifyWith = list.fireWith
+                       // deferred.resolveWith = list.fireWith
+                       // deferred.rejectWith = list.fireWith
                        deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
                } );
 
@@ -3477,69 +3718,99 @@ jQuery.extend( {
        },
 
        // Deferred helper
-       when: function( subordinate /* , ..., subordinateN */ ) {
-               var i = 0,
-                       resolveValues = slice.call( arguments ),
-                       length = resolveValues.length,
+       when: function( singleValue ) {
+               var
 
-                       // the count of uncompleted subordinates
-                       remaining = length !== 1 ||
-                               ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+                       // count of uncompleted subordinates
+                       remaining = arguments.length,
 
-                       // the master Deferred.
-                       // If resolveValues consist of only a single Deferred, just use that.
-                       deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+                       // count of unprocessed arguments
+                       i = remaining,
 
-                       // Update function for both resolve and progress values
-                       updateFunc = function( i, contexts, values ) {
-                               return function( value ) {
-                                       contexts[ i ] = this;
-                                       values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
-                                       if ( values === progressValues ) {
-                                               deferred.notifyWith( contexts, values );
+                       // subordinate fulfillment data
+                       resolveContexts = Array( i ),
+                       resolveValues = slice.call( arguments ),
+
+                       // the primary Deferred
+                       primary = jQuery.Deferred(),
 
-                                       } else if ( !( --remaining ) ) {
-                                               deferred.resolveWith( contexts, values );
+                       // subordinate callback factory
+                       updateFunc = function( i ) {
+                               return function( value ) {
+                                       resolveContexts[ i ] = this;
+                                       resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+                                       if ( !( --remaining ) ) {
+                                               primary.resolveWith( resolveContexts, resolveValues );
                                        }
                                };
-                       },
+                       };
 
-                       progressValues, progressContexts, resolveContexts;
+               // Single- and empty arguments are adopted like Promise.resolve
+               if ( remaining <= 1 ) {
+                       adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,
+                               !remaining );
 
-               // add listeners to Deferred subordinates; treat others as resolved
-               if ( length > 1 ) {
-                       progressValues = new Array( length );
-                       progressContexts = new Array( length );
-                       resolveContexts = new Array( length );
-                       for ( ; i < length; i++ ) {
-                               if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-                                       resolveValues[ i ].promise()
-                                               .progress( updateFunc( i, progressContexts, progressValues ) )
-                                               .done( updateFunc( i, resolveContexts, resolveValues ) )
-                                               .fail( deferred.reject );
-                               } else {
-                                       --remaining;
-                               }
+                       // Use .then() to unwrap secondary thenables (cf. gh-3000)
+                       if ( primary.state() === "pending" ||
+                               isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
+
+                               return primary.then();
                        }
                }
 
-               // if we're not waiting on anything, resolve the master
-               if ( !remaining ) {
-                       deferred.resolveWith( resolveContexts, resolveValues );
+               // Multiple arguments are aggregated like Promise.all array elements
+               while ( i-- ) {
+                       adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );
                }
 
-               return deferred.promise();
+               return primary.promise();
        }
 } );
 
 
+// These usually indicate a programmer mistake during development,
+// warn about them ASAP rather than swallowing them by default.
+var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
+
+// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error
+// captured before the async barrier to get the original error cause
+// which may otherwise be hidden.
+jQuery.Deferred.exceptionHook = function( error, asyncError ) {
+
+       // Support: IE 8 - 9 only
+       // Console exists when dev tools are open, which can happen at any time
+       if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
+               window.console.warn( "jQuery.Deferred exception: " + error.message,
+                       error.stack, asyncError );
+       }
+};
+
+
+
+
+jQuery.readyException = function( error ) {
+       window.setTimeout( function() {
+               throw error;
+       } );
+};
+
+
+
+
 // The deferred used on DOM ready
-var readyList;
+var readyList = jQuery.Deferred();
 
 jQuery.fn.ready = function( fn ) {
 
-       // Add the callback
-       jQuery.ready.promise().done( fn );
+       readyList
+               .then( fn )
+
+               // Wrap jQuery.readyException in a function so that the lookup
+               // happens at the time of error handling instead of callback
+               // registration.
+               .catch( function( error ) {
+                       jQuery.readyException( error );
+               } );
 
        return this;
 };
@@ -3550,18 +3821,9 @@ jQuery.extend( {
        isReady: false,
 
        // A counter to track how many items to wait for before
-       // the ready event fires. See #6781
+       // the ready event fires. See trac-6781
        readyWait: 1,
 
-       // Hold (or release) the ready event
-       holdReady: function( hold ) {
-               if ( hold ) {
-                       jQuery.readyWait++;
-               } else {
-                       jQuery.ready( true );
-               }
-       },
-
        // Handle when the DOM is ready
        ready: function( wait ) {
 
@@ -3580,469 +3842,369 @@ jQuery.extend( {
 
                // If there are functions bound, to execute
                readyList.resolveWith( document, [ jQuery ] );
-
-               // Trigger any bound ready events
-               if ( jQuery.fn.triggerHandler ) {
-                       jQuery( document ).triggerHandler( "ready" );
-                       jQuery( document ).off( "ready" );
-               }
        }
 } );
 
-/**
- * Clean-up method for dom ready events
- */
-function detach() {
-       if ( document.addEventListener ) {
-               document.removeEventListener( "DOMContentLoaded", completed );
-               window.removeEventListener( "load", completed );
-
-       } else {
-               document.detachEvent( "onreadystatechange", completed );
-               window.detachEvent( "onload", completed );
-       }
-}
+jQuery.ready.then = readyList.then;
 
-/**
- * The ready event handler and self cleanup method
- */
+// The ready event handler and self cleanup method
 function completed() {
-
-       // readyState === "complete" is good enough for us to call the dom ready in oldIE
-       if ( document.addEventListener ||
-               window.event.type === "load" ||
-               document.readyState === "complete" ) {
-
-               detach();
-               jQuery.ready();
-       }
+       document.removeEventListener( "DOMContentLoaded", completed );
+       window.removeEventListener( "load", completed );
+       jQuery.ready();
 }
 
-jQuery.ready.promise = function( obj ) {
-       if ( !readyList ) {
+// Catch cases where $(document).ready() is called
+// after the browser event has already occurred.
+// Support: IE <=9 - 10 only
+// Older IE sometimes signals "interactive" too soon
+if ( document.readyState === "complete" ||
+       ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
 
-               readyList = jQuery.Deferred();
+       // Handle it asynchronously to allow scripts the opportunity to delay ready
+       window.setTimeout( jQuery.ready );
 
-               // Catch cases where $(document).ready() is called
-               // after the browser event has already occurred.
-               // we once tried to use readyState "interactive" here,
-               // but it caused issues like the one
-               // discovered by ChrisS here:
-               // http://bugs.jquery.com/ticket/12282#comment:15
-               if ( document.readyState === "complete" ) {
+} else {
 
-                       // Handle it asynchronously to allow scripts the opportunity to delay ready
-                       window.setTimeout( jQuery.ready );
+       // Use the handy event callback
+       document.addEventListener( "DOMContentLoaded", completed );
 
-               // Standards-based browsers support DOMContentLoaded
-               } else if ( document.addEventListener ) {
-
-                       // Use the handy event callback
-                       document.addEventListener( "DOMContentLoaded", completed );
+       // A fallback to window.onload, that will always work
+       window.addEventListener( "load", completed );
+}
 
-                       // A fallback to window.onload, that will always work
-                       window.addEventListener( "load", completed );
 
-               // If IE event model is used
-               } else {
 
-                       // Ensure firing before onload, maybe late but safe also for iframes
-                       document.attachEvent( "onreadystatechange", completed );
 
-                       // A fallback to window.onload, that will always work
-                       window.attachEvent( "onload", completed );
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+       var i = 0,
+               len = elems.length,
+               bulk = key == null;
 
-                       // If IE and not a frame
-                       // continually check to see if the document is ready
-                       var top = false;
+       // Sets many values
+       if ( toType( key ) === "object" ) {
+               chainable = true;
+               for ( i in key ) {
+                       access( elems, fn, i, key[ i ], true, emptyGet, raw );
+               }
 
-                       try {
-                               top = window.frameElement == null && document.documentElement;
-                       } catch ( e ) {}
+       // Sets one value
+       } else if ( value !== undefined ) {
+               chainable = true;
 
-                       if ( top && top.doScroll ) {
-                               ( function doScrollCheck() {
-                                       if ( !jQuery.isReady ) {
+               if ( !isFunction( value ) ) {
+                       raw = true;
+               }
 
-                                               try {
+               if ( bulk ) {
 
-                                                       // Use the trick by Diego Perini
-                                                       // http://javascript.nwbox.com/IEContentLoaded/
-                                                       top.doScroll( "left" );
-                                               } catch ( e ) {
-                                                       return window.setTimeout( doScrollCheck, 50 );
-                                               }
+                       // Bulk operations run against the entire set
+                       if ( raw ) {
+                               fn.call( elems, value );
+                               fn = null;
 
-                                               // detach all dom ready events
-                                               detach();
+                       // ...except when executing function values
+                       } else {
+                               bulk = fn;
+                               fn = function( elem, _key, value ) {
+                                       return bulk.call( jQuery( elem ), value );
+                               };
+                       }
+               }
 
-                                               // and execute any waiting functions
-                                               jQuery.ready();
-                                       }
-                               } )();
+               if ( fn ) {
+                       for ( ; i < len; i++ ) {
+                               fn(
+                                       elems[ i ], key, raw ?
+                                               value :
+                                               value.call( elems[ i ], i, fn( elems[ i ], key ) )
+                               );
                        }
                }
        }
-       return readyList.promise( obj );
-};
 
-// Kick off the DOM ready check even if the user does not
-jQuery.ready.promise();
+       if ( chainable ) {
+               return elems;
+       }
+
+       // Gets
+       if ( bulk ) {
+               return fn.call( elems );
+       }
 
+       return len ? fn( elems[ 0 ], key ) : emptyGet;
+};
 
 
+// Matches dashed string for camelizing
+var rmsPrefix = /^-ms-/,
+       rdashAlpha = /-([a-z])/g;
 
-// Support: IE<9
-// Iteration over object's inherited properties before its own
-var i;
-for ( i in jQuery( support ) ) {
-       break;
+// Used by camelCase as callback to replace()
+function fcamelCase( _all, letter ) {
+       return letter.toUpperCase();
 }
-support.ownFirst = i === "0";
 
-// Note: most support tests are defined in their respective modules.
-// false until the test is run
-support.inlineBlockNeedsLayout = false;
+// Convert dashed to camelCase; used by the css and data modules
+// Support: IE <=9 - 11, Edge 12 - 15
+// Microsoft forgot to hump their vendor prefix (trac-9572)
+function camelCase( string ) {
+       return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+}
+var acceptData = function( owner ) {
+
+       // Accepts only:
+       //  - Node
+       //    - Node.ELEMENT_NODE
+       //    - Node.DOCUMENT_NODE
+       //  - Object
+       //    - Any
+       return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
+};
 
-// Execute ASAP in case we need to set body.style.zoom
-jQuery( function() {
 
-       // Minified: var a,b,c,d
-       var val, div, body, container;
 
-       body = document.getElementsByTagName( "body" )[ 0 ];
-       if ( !body || !body.style ) {
 
-               // Return for frameset docs that don't have a body
-               return;
-       }
+function Data() {
+       this.expando = jQuery.expando + Data.uid++;
+}
 
-       // Setup
-       div = document.createElement( "div" );
-       container = document.createElement( "div" );
-       container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
-       body.appendChild( container ).appendChild( div );
+Data.uid = 1;
 
-       if ( typeof div.style.zoom !== "undefined" ) {
+Data.prototype = {
 
-               // Support: IE<8
-               // Check if natively block-level elements act like inline-block
-               // elements when setting their display to 'inline' and giving
-               // them layout
-               div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
+       cache: function( owner ) {
 
-               support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
-               if ( val ) {
+               // Check if the owner object already has a cache
+               var value = owner[ this.expando ];
 
-                       // Prevent IE 6 from affecting layout for positioned elements #11048
-                       // Prevent IE from shrinking the body in IE 7 mode #12869
-                       // Support: IE<8
-                       body.style.zoom = 1;
-               }
-       }
+               // If not, create one
+               if ( !value ) {
+                       value = {};
 
-       body.removeChild( container );
-} );
+                       // We can accept data for non-element nodes in modern browsers,
+                       // but we should not, see trac-8335.
+                       // Always return an empty object.
+                       if ( acceptData( owner ) ) {
 
+                               // If it is a node unlikely to be stringify-ed or looped over
+                               // use plain assignment
+                               if ( owner.nodeType ) {
+                                       owner[ this.expando ] = value;
 
-( function() {
-       var div = document.createElement( "div" );
+                               // Otherwise secure it in a non-enumerable property
+                               // configurable must be true to allow the property to be
+                               // deleted when data is removed
+                               } else {
+                                       Object.defineProperty( owner, this.expando, {
+                                               value: value,
+                                               configurable: true
+                                       } );
+                               }
+                       }
+               }
 
-       // Support: IE<9
-       support.deleteExpando = true;
-       try {
-               delete div.test;
-       } catch ( e ) {
-               support.deleteExpando = false;
-       }
+               return value;
+       },
+       set: function( owner, data, value ) {
+               var prop,
+                       cache = this.cache( owner );
 
-       // Null elements to avoid leaks in IE.
-       div = null;
-} )();
-var acceptData = function( elem ) {
-       var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
-               nodeType = +elem.nodeType || 1;
+               // Handle: [ owner, key, value ] args
+               // Always use camelCase key (gh-2257)
+               if ( typeof data === "string" ) {
+                       cache[ camelCase( data ) ] = value;
 
-       // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
-       return nodeType !== 1 && nodeType !== 9 ?
-               false :
+               // Handle: [ owner, { properties } ] args
+               } else {
 
-               // Nodes accept data unless otherwise specified; rejection can be conditional
-               !noData || noData !== true && elem.getAttribute( "classid" ) === noData;
-};
+                       // Copy the properties one-by-one to the cache object
+                       for ( prop in data ) {
+                               cache[ camelCase( prop ) ] = data[ prop ];
+                       }
+               }
+               return cache;
+       },
+       get: function( owner, key ) {
+               return key === undefined ?
+                       this.cache( owner ) :
 
+                       // Always use camelCase key (gh-2257)
+                       owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
+       },
+       access: function( owner, key, value ) {
 
+               // In cases where either:
+               //
+               //   1. No key was specified
+               //   2. A string key was specified, but no value provided
+               //
+               // Take the "read" path and allow the get method to determine
+               // which value to return, respectively either:
+               //
+               //   1. The entire cache object
+               //   2. The data stored at the key
+               //
+               if ( key === undefined ||
+                               ( ( key && typeof key === "string" ) && value === undefined ) ) {
 
+                       return this.get( owner, key );
+               }
 
-var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
-       rmultiDash = /([A-Z])/g;
+               // When the key is not a string, or both a key and value
+               // are specified, set or extend (existing objects) with either:
+               //
+               //   1. An object of properties
+               //   2. A key and value
+               //
+               this.set( owner, key, value );
 
-function dataAttr( elem, key, data ) {
+               // Since the "set" path can have two possible entry points
+               // return the expected data based on which path was taken[*]
+               return value !== undefined ? value : key;
+       },
+       remove: function( owner, key ) {
+               var i,
+                       cache = owner[ this.expando ];
 
-       // If nothing was found internally, try to fetch any
-       // data from the HTML5 data-* attribute
-       if ( data === undefined && elem.nodeType === 1 ) {
+               if ( cache === undefined ) {
+                       return;
+               }
 
-               var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+               if ( key !== undefined ) {
 
-               data = elem.getAttribute( name );
+                       // Support array or space separated string of keys
+                       if ( Array.isArray( key ) ) {
 
-               if ( typeof data === "string" ) {
-                       try {
-                               data = data === "true" ? true :
-                                       data === "false" ? false :
-                                       data === "null" ? null :
-
-                                       // Only convert to a number if it doesn't change the string
-                                       +data + "" === data ? +data :
-                                       rbrace.test( data ) ? jQuery.parseJSON( data ) :
-                                       data;
-                       } catch ( e ) {}
+                               // If key is an array of keys...
+                               // We always set camelCase keys, so remove that.
+                               key = key.map( camelCase );
+                       } else {
+                               key = camelCase( key );
 
-                       // Make sure we set the data so it isn't changed later
-                       jQuery.data( elem, key, data );
+                               // If a key with the spaces exists, use it.
+                               // Otherwise, create an array by matching non-whitespace
+                               key = key in cache ?
+                                       [ key ] :
+                                       ( key.match( rnothtmlwhite ) || [] );
+                       }
 
-               } else {
-                       data = undefined;
-               }
-       }
+                       i = key.length;
 
-       return data;
-}
+                       while ( i-- ) {
+                               delete cache[ key[ i ] ];
+                       }
+               }
 
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-       var name;
-       for ( name in obj ) {
+               // Remove the expando if there's no more data
+               if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
 
-               // if the public data object is empty, the private is still empty
-               if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) {
-                       continue;
-               }
-               if ( name !== "toJSON" ) {
-                       return false;
+                       // Support: Chrome <=35 - 45
+                       // Webkit & Blink performance suffers when deleting properties
+                       // from DOM nodes, so set to undefined instead
+                       // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
+                       if ( owner.nodeType ) {
+                               owner[ this.expando ] = undefined;
+                       } else {
+                               delete owner[ this.expando ];
+                       }
                }
+       },
+       hasData: function( owner ) {
+               var cache = owner[ this.expando ];
+               return cache !== undefined && !jQuery.isEmptyObject( cache );
        }
+};
+var dataPriv = new Data();
 
-       return true;
-}
-
-function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
-       if ( !acceptData( elem ) ) {
-               return;
-       }
-
-       var ret, thisCache,
-               internalKey = jQuery.expando,
-
-               // We have to handle DOM nodes and JS objects differently because IE6-7
-               // can't GC object references properly across the DOM-JS boundary
-               isNode = elem.nodeType,
-
-               // Only DOM nodes need the global jQuery cache; JS object data is
-               // attached directly to the object so GC can occur automatically
-               cache = isNode ? jQuery.cache : elem,
+var dataUser = new Data();
 
-               // Only defining an ID for JS objects if its cache already exists allows
-               // the code to shortcut on the same path as a DOM node with no cache
-               id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
 
-       // Avoid doing any more work than we need to when trying to get data on an
-       // object that has no data at all
-       if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) &&
-               data === undefined && typeof name === "string" ) {
-               return;
-       }
 
-       if ( !id ) {
-
-               // Only DOM nodes need a new unique ID for each element since their data
-               // ends up in the global cache
-               if ( isNode ) {
-                       id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
-               } else {
-                       id = internalKey;
-               }
-       }
+//     Implementation Summary
+//
+//     1. Enforce API surface and semantic compatibility with 1.9.x branch
+//     2. Improve the module's maintainability by reducing the storage
+//             paths to a single mechanism.
+//     3. Use the same single mechanism to support "private" and "user" data.
+//     4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+//     5. Avoid exposing implementation details on user objects (eg. expando properties)
+//     6. Provide a clear path for implementation upgrade to WeakMap in 2014
 
-       if ( !cache[ id ] ) {
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+       rmultiDash = /[A-Z]/g;
 
-               // Avoid exposing jQuery metadata on plain JS objects when the object
-               // is serialized using JSON.stringify
-               cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+function getData( data ) {
+       if ( data === "true" ) {
+               return true;
        }
 
-       // An object can be passed to jQuery.data instead of a key/value pair; this gets
-       // shallow copied over onto the existing cache
-       if ( typeof name === "object" || typeof name === "function" ) {
-               if ( pvt ) {
-                       cache[ id ] = jQuery.extend( cache[ id ], name );
-               } else {
-                       cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-               }
+       if ( data === "false" ) {
+               return false;
        }
 
-       thisCache = cache[ id ];
-
-       // jQuery data() is stored in a separate object inside the object's internal data
-       // cache in order to avoid key collisions between internal data and user-defined
-       // data.
-       if ( !pvt ) {
-               if ( !thisCache.data ) {
-                       thisCache.data = {};
-               }
-
-               thisCache = thisCache.data;
+       if ( data === "null" ) {
+               return null;
        }
 
-       if ( data !== undefined ) {
-               thisCache[ jQuery.camelCase( name ) ] = data;
+       // Only convert to a number if it doesn't change the string
+       if ( data === +data + "" ) {
+               return +data;
        }
 
-       // Check for both converted-to-camel and non-converted data property names
-       // If a data property was specified
-       if ( typeof name === "string" ) {
-
-               // First Try to find as-is property data
-               ret = thisCache[ name ];
-
-               // Test for null|undefined property data
-               if ( ret == null ) {
-
-                       // Try to find the camelCased property
-                       ret = thisCache[ jQuery.camelCase( name ) ];
-               }
-       } else {
-               ret = thisCache;
+       if ( rbrace.test( data ) ) {
+               return JSON.parse( data );
        }
 
-       return ret;
+       return data;
 }
 
-function internalRemoveData( elem, name, pvt ) {
-       if ( !acceptData( elem ) ) {
-               return;
-       }
-
-       var thisCache, i,
-               isNode = elem.nodeType,
-
-               // See jQuery.data for more information
-               cache = isNode ? jQuery.cache : elem,
-               id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
-       // If there is already no cache entry for this object, there is no
-       // purpose in continuing
-       if ( !cache[ id ] ) {
-               return;
-       }
-
-       if ( name ) {
-
-               thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-               if ( thisCache ) {
-
-                       // Support array or space separated string names for data keys
-                       if ( !jQuery.isArray( name ) ) {
-
-                               // try the string as a key before any manipulation
-                               if ( name in thisCache ) {
-                                       name = [ name ];
-                               } else {
-
-                                       // split the camel cased version by spaces unless a key with the spaces exists
-                                       name = jQuery.camelCase( name );
-                                       if ( name in thisCache ) {
-                                               name = [ name ];
-                                       } else {
-                                               name = name.split( " " );
-                                       }
-                               }
-                       } else {
-
-                               // If "name" is an array of keys...
-                               // When data is initially created, via ("key", "val") signature,
-                               // keys will be converted to camelCase.
-                               // Since there is no way to tell _how_ a key was added, remove
-                               // both plain key and camelCase key. #12786
-                               // This will only penalize the array argument path.
-                               name = name.concat( jQuery.map( name, jQuery.camelCase ) );
-                       }
-
-                       i = name.length;
-                       while ( i-- ) {
-                               delete thisCache[ name[ i ] ];
-                       }
+function dataAttr( elem, key, data ) {
+       var name;
 
-                       // If there is no data left in the cache, we want to continue
-                       // and let the cache object itself get destroyed
-                       if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) {
-                               return;
-                       }
-               }
-       }
+       // If nothing was found internally, try to fetch any
+       // data from the HTML5 data-* attribute
+       if ( data === undefined && elem.nodeType === 1 ) {
+               name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
+               data = elem.getAttribute( name );
 
-       // See jQuery.data for more information
-       if ( !pvt ) {
-               delete cache[ id ].data;
+               if ( typeof data === "string" ) {
+                       try {
+                               data = getData( data );
+                       } catch ( e ) {}
 
-               // Don't destroy the parent cache unless the internal data object
-               // had been the only thing left in it
-               if ( !isEmptyDataObject( cache[ id ] ) ) {
-                       return;
+                       // Make sure we set the data so it isn't changed later
+                       dataUser.set( elem, key, data );
+               } else {
+                       data = undefined;
                }
        }
-
-       // Destroy the cache
-       if ( isNode ) {
-               jQuery.cleanData( [ elem ], true );
-
-       // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
-       /* jshint eqeqeq: false */
-       } else if ( support.deleteExpando || cache != cache.window ) {
-               /* jshint eqeqeq: true */
-               delete cache[ id ];
-
-       // When all else fails, undefined
-       } else {
-               cache[ id ] = undefined;
-       }
+       return data;
 }
 
 jQuery.extend( {
-       cache: {},
-
-       // The following elements (space-suffixed to avoid Object.prototype collisions)
-       // throw uncatchable exceptions if you attempt to set expando properties
-       noData: {
-               "applet ": true,
-               "embed ": true,
-
-               // ...but Flash objects (which have this classid) *can* handle expandos
-               "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
-       },
-
        hasData: function( elem ) {
-               elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ];
-               return !!elem && !isEmptyDataObject( elem );
+               return dataUser.hasData( elem ) || dataPriv.hasData( elem );
        },
 
        data: function( elem, name, data ) {
-               return internalData( elem, name, data );
+               return dataUser.access( elem, name, data );
        },
 
        removeData: function( elem, name ) {
-               return internalRemoveData( elem, name );
+               dataUser.remove( elem, name );
        },
 
-       // For internal use only.
+       // TODO: Now that all calls to _data and _removeData have been replaced
+       // with direct calls to dataPriv methods, these can be deprecated.
        _data: function( elem, name, data ) {
-               return internalData( elem, name, data, true );
+               return dataPriv.access( elem, name, data );
        },
 
        _removeData: function( elem, name ) {
-               return internalRemoveData( elem, name, true );
+               dataPriv.remove( elem, name );
        }
 } );
 
@@ -4052,29 +4214,26 @@ jQuery.fn.extend( {
                        elem = this[ 0 ],
                        attrs = elem && elem.attributes;
 
-               // Special expections of .data basically thwart jQuery.access,
-               // so implement the relevant behavior ourselves
-
                // Gets all values
                if ( key === undefined ) {
                        if ( this.length ) {
-                               data = jQuery.data( elem );
+                               data = dataUser.get( elem );
 
-                               if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+                               if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
                                        i = attrs.length;
                                        while ( i-- ) {
 
-                                               // Support: IE11+
-                                               // The attrs elements can be null (#14894)
+                                               // Support: IE 11 only
+                                               // The attrs elements can be null (trac-14894)
                                                if ( attrs[ i ] ) {
                                                        name = attrs[ i ].name;
                                                        if ( name.indexOf( "data-" ) === 0 ) {
-                                                               name = jQuery.camelCase( name.slice( 5 ) );
+                                                               name = camelCase( name.slice( 5 ) );
                                                                dataAttr( elem, name, data[ name ] );
                                                        }
                                                }
                                        }
-                                       jQuery._data( elem, "parsedAttrs", true );
+                                       dataPriv.set( elem, "hasDataAttrs", true );
                                }
                        }
 
@@ -4084,25 +4243,50 @@ jQuery.fn.extend( {
                // Sets multiple values
                if ( typeof key === "object" ) {
                        return this.each( function() {
-                               jQuery.data( this, key );
+                               dataUser.set( this, key );
                        } );
                }
 
-               return arguments.length > 1 ?
+               return access( this, function( value ) {
+                       var data;
+
+                       // The calling jQuery object (element matches) is not empty
+                       // (and therefore has an element appears at this[ 0 ]) and the
+                       // `value` parameter was not undefined. An empty jQuery object
+                       // will result in `undefined` for elem = this[ 0 ] which will
+                       // throw an exception if an attempt to read a data cache is made.
+                       if ( elem && value === undefined ) {
+
+                               // Attempt to get data from the cache
+                               // The key will always be camelCased in Data
+                               data = dataUser.get( elem, key );
+                               if ( data !== undefined ) {
+                                       return data;
+                               }
+
+                               // Attempt to "discover" the data in
+                               // HTML5 custom data-* attrs
+                               data = dataAttr( elem, key );
+                               if ( data !== undefined ) {
+                                       return data;
+                               }
+
+                               // We tried really hard, but the data doesn't exist.
+                               return;
+                       }
 
-                       // Sets one value
+                       // Set the data...
                        this.each( function() {
-                               jQuery.data( this, key, value );
-                       } ) :
 
-                       // Gets one value
-                       // Try to fetch any internally stored data first
-                       elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
+                               // We always store the camelCased key
+                               dataUser.set( this, key, value );
+                       } );
+               }, null, value, arguments.length > 1, null, true );
        },
 
        removeData: function( key ) {
                return this.each( function() {
-                       jQuery.removeData( this, key );
+                       dataUser.remove( this, key );
                } );
        }
 } );
@@ -4114,12 +4298,12 @@ jQuery.extend( {
 
                if ( elem ) {
                        type = ( type || "fx" ) + "queue";
-                       queue = jQuery._data( elem, type );
+                       queue = dataPriv.get( elem, type );
 
                        // Speed up dequeue by getting out quickly if this is just a lookup
                        if ( data ) {
-                               if ( !queue || jQuery.isArray( data ) ) {
-                                       queue = jQuery._data( elem, type, jQuery.makeArray( data ) );
+                               if ( !queue || Array.isArray( data ) ) {
+                                       queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
                                } else {
                                        queue.push( data );
                                }
@@ -4153,7 +4337,7 @@ jQuery.extend( {
                                queue.unshift( "inprogress" );
                        }
 
-                       // clear up the last queue stop function
+                       // Clear up the last queue stop function
                        delete hooks.stop;
                        fn.call( elem, next, hooks );
                }
@@ -4163,14 +4347,12 @@ jQuery.extend( {
                }
        },
 
-       // not intended for public consumption - generates a queueHooks object,
-       // or returns the current one
+       // Not public - generate a queueHooks object, or return the current one
        _queueHooks: function( elem, type ) {
                var key = type + "queueHooks";
-               return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+               return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
                        empty: jQuery.Callbacks( "once memory" ).add( function() {
-                               jQuery._removeData( elem, type + "queue" );
-                               jQuery._removeData( elem, key );
+                               dataPriv.remove( elem, [ type + "queue", key ] );
                        } )
                } );
        }
@@ -4195,7 +4377,7 @@ jQuery.fn.extend( {
                        this.each( function() {
                                var queue = jQuery.queue( this, type, data );
 
-                               // ensure a hooks for this queue
+                               // Ensure a hooks for this queue
                                jQuery._queueHooks( this, type );
 
                                if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
@@ -4233,7 +4415,7 @@ jQuery.fn.extend( {
                type = type || "fx";
 
                while ( i-- ) {
-                       tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+                       tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
                        if ( tmp && tmp.empty ) {
                                count++;
                                tmp.empty.add( resolve );
@@ -4243,115 +4425,101 @@ jQuery.fn.extend( {
                return defer.promise( obj );
        }
 } );
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
 
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
 
-( function() {
-       var shrinkWrapBlocksVal;
-
-       support.shrinkWrapBlocks = function() {
-               if ( shrinkWrapBlocksVal != null ) {
-                       return shrinkWrapBlocksVal;
-               }
-
-               // Will be changed later if needed.
-               shrinkWrapBlocksVal = false;
-
-               // Minified: var b,c,d
-               var div, body, container;
-
-               body = document.getElementsByTagName( "body" )[ 0 ];
-               if ( !body || !body.style ) {
-
-                       // Test fired too early or in an unsupported environment, exit.
-                       return;
-               }
-
-               // Setup
-               div = document.createElement( "div" );
-               container = document.createElement( "div" );
-               container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
-               body.appendChild( container ).appendChild( div );
-
-               // Support: IE6
-               // Check if elements with layout shrink-wrap their children
-               if ( typeof div.style.zoom !== "undefined" ) {
-
-                       // Reset CSS: box-sizing; display; margin; border
-                       div.style.cssText =
 
-                               // Support: Firefox<29, Android 2.3
-                               // Vendor-prefix box-sizing
-                               "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
-                               "box-sizing:content-box;display:block;margin:0;border:0;" +
-                               "padding:1px;width:1px;zoom:1";
-                       div.appendChild( document.createElement( "div" ) ).style.width = "5px";
-                       shrinkWrapBlocksVal = div.offsetWidth !== 3;
-               }
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
 
-               body.removeChild( container );
+var documentElement = document.documentElement;
 
-               return shrinkWrapBlocksVal;
-       };
 
-} )();
-var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
 
-var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
+       var isAttached = function( elem ) {
+                       return jQuery.contains( elem.ownerDocument, elem );
+               },
+               composed = { composed: true };
+
+       // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
+       // Check attachment across shadow DOM boundaries when possible (gh-3504)
+       // Support: iOS 10.0-10.2 only
+       // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
+       // leading to errors. We need to check for `getRootNode`.
+       if ( documentElement.getRootNode ) {
+               isAttached = function( elem ) {
+                       return jQuery.contains( elem.ownerDocument, elem ) ||
+                               elem.getRootNode( composed ) === elem.ownerDocument;
+               };
+       }
+var isHiddenWithinTree = function( elem, el ) {
 
+               // isHiddenWithinTree might be called from jQuery#filter function;
+               // in that case, element will be second argument
+               elem = el || elem;
 
-var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+               // Inline style trumps all
+               return elem.style.display === "none" ||
+                       elem.style.display === "" &&
 
-var isHidden = function( elem, el ) {
+                       // Otherwise, check computed style
+                       // Support: Firefox <=43 - 45
+                       // Disconnected elements can have computed display: none, so first confirm that elem is
+                       // in the document.
+                       isAttached( elem ) &&
 
-               // isHidden might be called from jQuery#filter function;
-               // in that case, element will be second argument
-               elem = el || elem;
-               return jQuery.css( elem, "display" ) === "none" ||
-                       !jQuery.contains( elem.ownerDocument, elem );
+                       jQuery.css( elem, "display" ) === "none";
        };
 
 
 
 function adjustCSS( elem, prop, valueParts, tween ) {
-       var adjusted,
-               scale = 1,
+       var adjusted, scale,
                maxIterations = 20,
                currentValue = tween ?
-                       function() { return tween.cur(); } :
-                       function() { return jQuery.css( elem, prop, "" ); },
+                       function() {
+                               return tween.cur();
+                       } :
+                       function() {
+                               return jQuery.css( elem, prop, "" );
+                       },
                initial = currentValue(),
                unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
 
                // Starting value computation is required for potential unit mismatches
-               initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+               initialInUnit = elem.nodeType &&
+                       ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
                        rcssNum.exec( jQuery.css( elem, prop ) );
 
        if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
 
+               // Support: Firefox <=54
+               // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
+               initial = initial / 2;
+
                // Trust units reported by jQuery.css
                unit = unit || initialInUnit[ 3 ];
 
-               // Make sure we update the tween properties later on
-               valueParts = valueParts || [];
-
                // Iteratively approximate from a nonzero starting point
                initialInUnit = +initial || 1;
 
-               do {
+               while ( maxIterations-- ) {
 
-                       // If previous iteration zeroed out, double until we get *something*.
-                       // Use string for doubling so we don't accidentally see scale as unchanged below
-                       scale = scale || ".5";
-
-                       // Adjust and apply
-                       initialInUnit = initialInUnit / scale;
+                       // Evaluate and update our best guess (doubling guesses that zero out).
+                       // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
                        jQuery.style( elem, prop, initialInUnit + unit );
+                       if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
+                               maxIterations = 0;
+                       }
+                       initialInUnit = initialInUnit / scale;
 
-               // Update scale, tolerating zero or NaN from tween.cur()
-               // Break the loop if scale is unchanged or perfect, or if we've just had enough.
-               } while (
-                       scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
-               );
+               }
+
+               initialInUnit = initialInUnit * 2;
+               jQuery.style( elem, prop, initialInUnit + unit );
+
+               // Make sure we update the tween properties later on
+               valueParts = valueParts || [];
        }
 
        if ( valueParts ) {
@@ -4371,242 +4539,210 @@ function adjustCSS( elem, prop, valueParts, tween ) {
 }
 
 
-// Multifunctional method to get and set values of a collection
-// The value/s can optionally be executed if it's a function
-var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
-       var i = 0,
-               length = elems.length,
-               bulk = key == null;
-
-       // Sets many values
-       if ( jQuery.type( key ) === "object" ) {
-               chainable = true;
-               for ( i in key ) {
-                       access( elems, fn, i, key[ i ], true, emptyGet, raw );
-               }
-
-       // Sets one value
-       } else if ( value !== undefined ) {
-               chainable = true;
-
-               if ( !jQuery.isFunction( value ) ) {
-                       raw = true;
-               }
-
-               if ( bulk ) {
-
-                       // Bulk operations run against the entire set
-                       if ( raw ) {
-                               fn.call( elems, value );
-                               fn = null;
+var defaultDisplayMap = {};
 
-                       // ...except when executing function values
-                       } else {
-                               bulk = fn;
-                               fn = function( elem, key, value ) {
-                                       return bulk.call( jQuery( elem ), value );
-                               };
-                       }
-               }
+function getDefaultDisplay( elem ) {
+       var temp,
+               doc = elem.ownerDocument,
+               nodeName = elem.nodeName,
+               display = defaultDisplayMap[ nodeName ];
 
-               if ( fn ) {
-                       for ( ; i < length; i++ ) {
-                               fn(
-                                       elems[ i ],
-                                       key,
-                                       raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
-                               );
-                       }
-               }
+       if ( display ) {
+               return display;
        }
 
-       return chainable ?
-               elems :
-
-               // Gets
-               bulk ?
-                       fn.call( elems ) :
-                       length ? fn( elems[ 0 ], key ) : emptyGet;
-};
-var rcheckableType = ( /^(?:checkbox|radio)$/i );
+       temp = doc.body.appendChild( doc.createElement( nodeName ) );
+       display = jQuery.css( temp, "display" );
 
-var rtagName = ( /<([\w:-]+)/ );
+       temp.parentNode.removeChild( temp );
 
-var rscriptType = ( /^$|\/(?:java|ecma)script/i );
+       if ( display === "none" ) {
+               display = "block";
+       }
+       defaultDisplayMap[ nodeName ] = display;
 
-var rleadingWhitespace = ( /^\s+/ );
+       return display;
+}
 
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
-               "details|dialog|figcaption|figure|footer|header|hgroup|main|" +
-               "mark|meter|nav|output|picture|progress|section|summary|template|time|video";
+function showHide( elements, show ) {
+       var display, elem,
+               values = [],
+               index = 0,
+               length = elements.length;
 
+       // Determine new display value for elements that need to change
+       for ( ; index < length; index++ ) {
+               elem = elements[ index ];
+               if ( !elem.style ) {
+                       continue;
+               }
 
+               display = elem.style.display;
+               if ( show ) {
 
-function createSafeFragment( document ) {
-       var list = nodeNames.split( "|" ),
-               safeFrag = document.createDocumentFragment();
+                       // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
+                       // check is required in this first loop unless we have a nonempty display value (either
+                       // inline or about-to-be-restored)
+                       if ( display === "none" ) {
+                               values[ index ] = dataPriv.get( elem, "display" ) || null;
+                               if ( !values[ index ] ) {
+                                       elem.style.display = "";
+                               }
+                       }
+                       if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
+                               values[ index ] = getDefaultDisplay( elem );
+                       }
+               } else {
+                       if ( display !== "none" ) {
+                               values[ index ] = "none";
 
-       if ( safeFrag.createElement ) {
-               while ( list.length ) {
-                       safeFrag.createElement(
-                               list.pop()
-                       );
+                               // Remember what we're overwriting
+                               dataPriv.set( elem, "display", display );
+                       }
                }
        }
-       return safeFrag;
-}
 
+       // Set the display of the elements in a second loop to avoid constant reflow
+       for ( index = 0; index < length; index++ ) {
+               if ( values[ index ] != null ) {
+                       elements[ index ].style.display = values[ index ];
+               }
+       }
 
-( function() {
-       var div = document.createElement( "div" ),
-               fragment = document.createDocumentFragment(),
-               input = document.createElement( "input" );
-
-       // Setup
-       div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+       return elements;
+}
 
-       // IE strips leading whitespace when .innerHTML is used
-       support.leadingWhitespace = div.firstChild.nodeType === 3;
+jQuery.fn.extend( {
+       show: function() {
+               return showHide( this, true );
+       },
+       hide: function() {
+               return showHide( this );
+       },
+       toggle: function( state ) {
+               if ( typeof state === "boolean" ) {
+                       return state ? this.show() : this.hide();
+               }
 
-       // Make sure that tbody elements aren't automatically inserted
-       // IE will insert them into empty tables
-       support.tbody = !div.getElementsByTagName( "tbody" ).length;
+               return this.each( function() {
+                       if ( isHiddenWithinTree( this ) ) {
+                               jQuery( this ).show();
+                       } else {
+                               jQuery( this ).hide();
+                       }
+               } );
+       }
+} );
+var rcheckableType = ( /^(?:checkbox|radio)$/i );
 
-       // Make sure that link elements get serialized correctly by innerHTML
-       // This requires a wrapper element in IE
-       support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
 
-       // Makes sure cloning an html5 element does not cause problems
-       // Where outerHTML is undefined, this still works
-       support.html5Clone =
-               document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
+var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
 
-       // Check if a disconnected checkbox will retain its checked
-       // value of true after appended to the DOM (IE6/7)
-       input.type = "checkbox";
-       input.checked = true;
-       fragment.appendChild( input );
-       support.appendChecked = input.checked;
 
-       // Make sure textarea (and checkbox) defaultValue is properly cloned
-       // Support: IE6-IE11+
-       div.innerHTML = "<textarea>x</textarea>";
-       support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
 
-       // #11217 - WebKit loses check when the name is after the checked attribute
-       fragment.appendChild( div );
+( function() {
+       var fragment = document.createDocumentFragment(),
+               div = fragment.appendChild( document.createElement( "div" ) ),
+               input = document.createElement( "input" );
 
+       // Support: Android 4.0 - 4.3 only
+       // Check state lost if the name is set (trac-11217)
        // Support: Windows Web Apps (WWA)
-       // `name` and `type` must use .setAttribute for WWA (#14901)
-       input = document.createElement( "input" );
+       // `name` and `type` must use .setAttribute for WWA (trac-14901)
        input.setAttribute( "type", "radio" );
        input.setAttribute( "checked", "checked" );
        input.setAttribute( "name", "t" );
 
        div.appendChild( input );
 
-       // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
-       // old WebKit doesn't clone checked state correctly in fragments
+       // Support: Android <=4.1 only
+       // Older WebKit doesn't clone checked state correctly in fragments
        support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
 
-       // Support: IE<9
-       // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+
-       support.noCloneEvent = !!div.addEventListener;
+       // Support: IE <=11 only
+       // Make sure textarea (and checkbox) defaultValue is properly cloned
+       div.innerHTML = "<textarea>x</textarea>";
+       support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
 
-       // Support: IE<9
-       // Since attributes and properties are the same in IE,
-       // cleanData must set properties to undefined rather than use removeAttribute
-       div[ jQuery.expando ] = 1;
-       support.attributes = !div.getAttribute( jQuery.expando );
+       // Support: IE <=9 only
+       // IE <=9 replaces <option> tags with their contents when inserted outside of
+       // the select element.
+       div.innerHTML = "<option></option>";
+       support.option = !!div.lastChild;
 } )();
 
 
-// We have to close these tags to support XHTML (#13200)
+// We have to close these tags to support XHTML (trac-13200)
 var wrapMap = {
-       option: [ 1, "<select multiple='multiple'>", "</select>" ],
-       legend: [ 1, "<fieldset>", "</fieldset>" ],
-       area: [ 1, "<map>", "</map>" ],
 
-       // Support: IE8
-       param: [ 1, "<object>", "</object>" ],
+       // XHTML parsers do not magically insert elements in the
+       // same way that tag soup parsers do. So we cannot shorten
+       // this by omitting <tbody> or other required elements.
        thead: [ 1, "<table>", "</table>" ],
+       col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
        tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-       col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
        td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
 
-       // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
-       // unless wrapped in a div with non-breaking characters in front of it.
-       _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
+       _default: [ 0, "", "" ]
 };
 
-// Support: IE8-IE9
-wrapMap.optgroup = wrapMap.option;
-
 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
 wrapMap.th = wrapMap.td;
 
+// Support: IE <=9 only
+if ( !support.option ) {
+       wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
+}
+
 
 function getAll( context, tag ) {
-       var elems, elem,
-               i = 0,
-               found = typeof context.getElementsByTagName !== "undefined" ?
-                       context.getElementsByTagName( tag || "*" ) :
-                       typeof context.querySelectorAll !== "undefined" ?
-                               context.querySelectorAll( tag || "*" ) :
-                               undefined;
-
-       if ( !found ) {
-               for ( found = [], elems = context.childNodes || context;
-                       ( elem = elems[ i ] ) != null;
-                       i++
-               ) {
-                       if ( !tag || jQuery.nodeName( elem, tag ) ) {
-                               found.push( elem );
-                       } else {
-                               jQuery.merge( found, getAll( elem, tag ) );
-                       }
-               }
+
+       // Support: IE <=9 - 11 only
+       // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
+       var ret;
+
+       if ( typeof context.getElementsByTagName !== "undefined" ) {
+               ret = context.getElementsByTagName( tag || "*" );
+
+       } else if ( typeof context.querySelectorAll !== "undefined" ) {
+               ret = context.querySelectorAll( tag || "*" );
+
+       } else {
+               ret = [];
        }
 
-       return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
-               jQuery.merge( [ context ], found ) :
-               found;
+       if ( tag === undefined || tag && nodeName( context, tag ) ) {
+               return jQuery.merge( [ context ], ret );
+       }
+
+       return ret;
 }
 
 
 // Mark scripts as having already been evaluated
 function setGlobalEval( elems, refElements ) {
-       var elem,
-               i = 0;
-       for ( ; ( elem = elems[ i ] ) != null; i++ ) {
-               jQuery._data(
-                       elem,
-                       "globalEval",
-                       !refElements || jQuery._data( refElements[ i ], "globalEval" )
-               );
-       }
-}
-
-
-var rhtml = /<|&#?\w+;/,
-       rtbody = /<tbody/i;
+       var i = 0,
+               l = elems.length;
 
-function fixDefaultChecked( elem ) {
-       if ( rcheckableType.test( elem.type ) ) {
-               elem.defaultChecked = elem.checked;
+       for ( ; i < l; i++ ) {
+               dataPriv.set(
+                       elems[ i ],
+                       "globalEval",
+                       !refElements || dataPriv.get( refElements[ i ], "globalEval" )
+               );
        }
 }
 
-function buildFragment( elems, context, scripts, selection, ignored ) {
-       var j, elem, contains,
-               tmp, tag, tbody, wrap,
-               l = elems.length,
 
-               // Ensure a safe fragment
-               safe = createSafeFragment( context ),
+var rhtml = /<|&#?\w+;/;
 
+function buildFragment( elems, context, scripts, selection, ignored ) {
+       var elem, tmp, tag, wrap, attached, j,
+               fragment = context.createDocumentFragment(),
                nodes = [],
-               i = 0;
+               i = 0,
+               l = elems.length;
 
        for ( ; i < l; i++ ) {
                elem = elems[ i ];
@@ -4614,7 +4750,10 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
                if ( elem || elem === 0 ) {
 
                        // Add nodes directly
-                       if ( jQuery.type( elem ) === "object" ) {
+                       if ( toType( elem ) === "object" ) {
+
+                               // Support: Android <=4.0 only, PhantomJS 1 only
+                               // push.apply(_, arraylike) throws on ancient WebKit
                                jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
 
                        // Convert non-html into a text node
@@ -4623,12 +4762,11 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
 
                        // Convert html into DOM nodes
                        } else {
-                               tmp = tmp || safe.appendChild( context.createElement( "div" ) );
+                               tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
 
                                // Deserialize a standard representation
                                tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
                                wrap = wrapMap[ tag ] || wrapMap._default;
-
                                tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
 
                                // Descend through wrappers to the right content
@@ -4637,59 +4775,21 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
                                        tmp = tmp.lastChild;
                                }
 
-                               // Manually add leading whitespace removed by IE
-                               if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-                                       nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) );
-                               }
-
-                               // Remove IE's autoinserted <tbody> from table fragments
-                               if ( !support.tbody ) {
-
-                                       // String was a <table>, *may* have spurious <tbody>
-                                       elem = tag === "table" && !rtbody.test( elem ) ?
-                                               tmp.firstChild :
-
-                                               // String was a bare <thead> or <tfoot>
-                                               wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ?
-                                                       tmp :
-                                                       0;
-
-                                       j = elem && elem.childNodes.length;
-                                       while ( j-- ) {
-                                               if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) &&
-                                                       !tbody.childNodes.length ) {
-
-                                                       elem.removeChild( tbody );
-                                               }
-                                       }
-                               }
-
+                               // Support: Android <=4.0 only, PhantomJS 1 only
+                               // push.apply(_, arraylike) throws on ancient WebKit
                                jQuery.merge( nodes, tmp.childNodes );
 
-                               // Fix #12392 for WebKit and IE > 9
-                               tmp.textContent = "";
-
-                               // Fix #12392 for oldIE
-                               while ( tmp.firstChild ) {
-                                       tmp.removeChild( tmp.firstChild );
-                               }
+                               // Remember the top-level container
+                               tmp = fragment.firstChild;
 
-                               // Remember the top-level container for proper cleanup
-                               tmp = safe.lastChild;
+                               // Ensure the created nodes are orphaned (trac-12392)
+                               tmp.textContent = "";
                        }
                }
        }
 
-       // Fix #11356: Clear elements from fragment
-       if ( tmp ) {
-               safe.removeChild( tmp );
-       }
-
-       // Reset defaultChecked for any radios and checkboxes
-       // about to be appended to the DOM in IE 6/7 (#8060)
-       if ( !support.appendChecked ) {
-               jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
-       }
+       // Remove wrapper from fragment
+       fragment.textContent = "";
 
        i = 0;
        while ( ( elem = nodes[ i++ ] ) ) {
@@ -4699,17 +4799,16 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
                        if ( ignored ) {
                                ignored.push( elem );
                        }
-
                        continue;
                }
 
-               contains = jQuery.contains( elem.ownerDocument, elem );
+               attached = isAttached( elem );
 
                // Append to fragment
-               tmp = getAll( safe.appendChild( elem ), "script" );
+               tmp = getAll( fragment.appendChild( elem ), "script" );
 
                // Preserve script evaluation history
-               if ( contains ) {
+               if ( attached ) {
                        setGlobalEval( tmp );
                }
 
@@ -4724,38 +4823,11 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
                }
        }
 
-       tmp = null;
-
-       return safe;
+       return fragment;
 }
 
 
-( function() {
-       var i, eventName,
-               div = document.createElement( "div" );
-
-       // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
-       for ( i in { submit: true, change: true, focusin: true } ) {
-               eventName = "on" + i;
-
-               if ( !( support[ i ] = eventName in window ) ) {
-
-                       // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
-                       div.setAttribute( eventName, "t" );
-                       support[ i ] = div.attributes[ eventName ].expando === false;
-               }
-       }
-
-       // Null elements to avoid leaks in IE.
-       div = null;
-} )();
-
-
-var rformElems = /^(?:input|select|textarea)$/i,
-       rkeyEvent = /^key/,
-       rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
-       rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-       rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
 
 function returnTrue() {
        return true;
@@ -4765,14 +4837,6 @@ function returnFalse() {
        return false;
 }
 
-// Support: IE9
-// See #13393 for more info
-function safeActiveElement() {
-       try {
-               return document.activeElement;
-       } catch ( err ) { }
-}
-
 function on( elem, types, selector, data, fn, one ) {
        var origFn, type;
 
@@ -4843,13 +4907,14 @@ jQuery.event = {
        global: {},
 
        add: function( elem, types, handler, data, selector ) {
-               var tmp, events, t, handleObjIn,
-                       special, eventHandle, handleObj,
-                       handlers, type, namespaces, origType,
-                       elemData = jQuery._data( elem );
 
-               // Don't attach events to noData or text/comment nodes (but allow plain objects)
-               if ( !elemData ) {
+               var handleObjIn, eventHandle, tmp,
+                       events, t, handleObj,
+                       special, handlers, type, namespaces, origType,
+                       elemData = dataPriv.get( elem );
+
+               // Only attach events to objects that accept data
+               if ( !acceptData( elem ) ) {
                        return;
                }
 
@@ -4860,6 +4925,12 @@ jQuery.event = {
                        selector = handleObjIn.selector;
                }
 
+               // Ensure that invalid selectors throw exceptions at attach time
+               // Evaluate against documentElement in case elem is a non-element node (e.g., document)
+               if ( selector ) {
+                       jQuery.find.matchesSelector( documentElement, selector );
+               }
+
                // Make sure that the handler has a unique ID, used to find/remove it later
                if ( !handler.guid ) {
                        handler.guid = jQuery.guid++;
@@ -4867,26 +4938,20 @@ jQuery.event = {
 
                // Init the element's event structure and main handler, if this is the first
                if ( !( events = elemData.events ) ) {
-                       events = elemData.events = {};
+                       events = elemData.events = Object.create( null );
                }
                if ( !( eventHandle = elemData.handle ) ) {
                        eventHandle = elemData.handle = function( e ) {
 
                                // Discard the second event of a jQuery.event.trigger() and
                                // when an event is called after a page has unloaded
-                               return typeof jQuery !== "undefined" &&
-                                       ( !e || jQuery.event.triggered !== e.type ) ?
-                                       jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-                                       undefined;
+                               return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
+                                       jQuery.event.dispatch.apply( elem, arguments ) : undefined;
                        };
-
-                       // Add elem as a property of the handle fn to prevent a memory leak
-                       // with IE non-native events
-                       eventHandle.elem = elem;
                }
 
                // Handle multiple events separated by a space
-               types = ( types || "" ).match( rnotwhite ) || [ "" ];
+               types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
                t = types.length;
                while ( t-- ) {
                        tmp = rtypenamespace.exec( types[ t ] ) || [];
@@ -4924,16 +4989,12 @@ jQuery.event = {
                                handlers = events[ type ] = [];
                                handlers.delegateCount = 0;
 
-                               // Only use addEventListener/attachEvent if the special events handler returns false
+                               // Only use addEventListener if the special events handler returns false
                                if ( !special.setup ||
                                        special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
 
-                                       // Bind the global event handler to the element
                                        if ( elem.addEventListener ) {
-                                               elem.addEventListener( type, eventHandle, false );
-
-                                       } else if ( elem.attachEvent ) {
-                                               elem.attachEvent( "on" + type, eventHandle );
+                                               elem.addEventListener( type, eventHandle );
                                        }
                                }
                        }
@@ -4957,24 +5018,22 @@ jQuery.event = {
                        jQuery.event.global[ type ] = true;
                }
 
-               // Nullify elem to prevent memory leaks in IE
-               elem = null;
        },
 
        // Detach an event or set of events from an element
        remove: function( elem, types, handler, selector, mappedTypes ) {
-               var j, handleObj, tmp,
-                       origCount, t, events,
-                       special, handlers, type,
-                       namespaces, origType,
-                       elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+               var j, origCount, tmp,
+                       events, t, handleObj,
+                       special, handlers, type, namespaces, origType,
+                       elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
 
                if ( !elemData || !( events = elemData.events ) ) {
                        return;
                }
 
                // Once for each type.namespace in types; type may be omitted
-               types = ( types || "" ).match( rnotwhite ) || [ "" ];
+               types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
                t = types.length;
                while ( t-- ) {
                        tmp = rtypenamespace.exec( types[ t ] ) || [];
@@ -5029,174 +5088,32 @@ jQuery.event = {
                        }
                }
 
-               // Remove the expando if it's no longer used
+               // Remove data and the expando if it's no longer used
                if ( jQuery.isEmptyObject( events ) ) {
-                       delete elemData.handle;
-
-                       // removeData also checks for emptiness and clears the expando if empty
-                       // so use it instead of delete
-                       jQuery._removeData( elem, "events" );
+                       dataPriv.remove( elem, "handle events" );
                }
        },
 
-       trigger: function( event, data, elem, onlyHandlers ) {
-               var handle, ontype, cur,
-                       bubbleType, special, tmp, i,
-                       eventPath = [ elem || document ],
-                       type = hasOwn.call( event, "type" ) ? event.type : event,
-                       namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
-
-               cur = tmp = elem = elem || document;
-
-               // Don't do events on text and comment nodes
-               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
-                       return;
-               }
-
-               // focus/blur morphs to focusin/out; ensure we're not firing them right now
-               if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-                       return;
-               }
-
-               if ( type.indexOf( "." ) > -1 ) {
-
-                       // Namespaced trigger; create a regexp to match event type in handle()
-                       namespaces = type.split( "." );
-                       type = namespaces.shift();
-                       namespaces.sort();
-               }
-               ontype = type.indexOf( ":" ) < 0 && "on" + type;
-
-               // Caller can pass in a jQuery.Event object, Object, or just an event type string
-               event = event[ jQuery.expando ] ?
-                       event :
-                       new jQuery.Event( type, typeof event === "object" && event );
-
-               // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
-               event.isTrigger = onlyHandlers ? 2 : 3;
-               event.namespace = namespaces.join( "." );
-               event.rnamespace = event.namespace ?
-                       new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
-                       null;
-
-               // Clean up the event in case it is being reused
-               event.result = undefined;
-               if ( !event.target ) {
-                       event.target = elem;
-               }
-
-               // Clone any incoming data and prepend the event, creating the handler arg list
-               data = data == null ?
-                       [ event ] :
-                       jQuery.makeArray( data, [ event ] );
-
-               // Allow special events to draw outside the lines
-               special = jQuery.event.special[ type ] || {};
-               if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
-                       return;
-               }
-
-               // Determine event propagation path in advance, per W3C events spec (#9951)
-               // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-               if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-                       bubbleType = special.delegateType || type;
-                       if ( !rfocusMorph.test( bubbleType + type ) ) {
-                               cur = cur.parentNode;
-                       }
-                       for ( ; cur; cur = cur.parentNode ) {
-                               eventPath.push( cur );
-                               tmp = cur;
-                       }
-
-                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
-                       if ( tmp === ( elem.ownerDocument || document ) ) {
-                               eventPath.push( tmp.defaultView || tmp.parentWindow || window );
-                       }
-               }
-
-               // Fire handlers on the event path
-               i = 0;
-               while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
-
-                       event.type = i > 1 ?
-                               bubbleType :
-                               special.bindType || type;
-
-                       // jQuery handler
-                       handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] &&
-                               jQuery._data( cur, "handle" );
-
-                       if ( handle ) {
-                               handle.apply( cur, data );
-                       }
-
-                       // Native handler
-                       handle = ontype && cur[ ontype ];
-                       if ( handle && handle.apply && acceptData( cur ) ) {
-                               event.result = handle.apply( cur, data );
-                               if ( event.result === false ) {
-                                       event.preventDefault();
-                               }
-                       }
-               }
-               event.type = type;
-
-               // If nobody prevented the default action, do it now
-               if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-                       if (
-                               ( !special._default ||
-                                special._default.apply( eventPath.pop(), data ) === false
-                               ) && acceptData( elem )
-                       ) {
-
-                               // Call a native DOM method on the target with the same name name as the event.
-                               // Can't use an .isFunction() check here because IE6/7 fails that test.
-                               // Don't do default actions on window, that's where global variables be (#6170)
-                               if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
-
-                                       // Don't re-trigger an onFOO event when we call its FOO() method
-                                       tmp = elem[ ontype ];
-
-                                       if ( tmp ) {
-                                               elem[ ontype ] = null;
-                                       }
-
-                                       // Prevent re-triggering of the same event, since we already bubbled it above
-                                       jQuery.event.triggered = type;
-                                       try {
-                                               elem[ type ]();
-                                       } catch ( e ) {
-
-                                               // IE<9 dies on focus/blur to hidden element (#1486,#12518)
-                                               // only reproducible on winXP IE8 native, not IE9 in IE8 mode
-                                       }
-                                       jQuery.event.triggered = undefined;
-
-                                       if ( tmp ) {
-                                               elem[ ontype ] = tmp;
-                                       }
-                               }
-                       }
-               }
+       dispatch: function( nativeEvent ) {
 
-               return event.result;
-       },
+               var i, j, ret, matched, handleObj, handlerQueue,
+                       args = new Array( arguments.length ),
 
-       dispatch: function( event ) {
+                       // Make a writable jQuery.Event from the native event object
+                       event = jQuery.event.fix( nativeEvent ),
 
-               // Make a writable jQuery.Event from the native event object
-               event = jQuery.event.fix( event );
-
-               var i, j, ret, matched, handleObj,
-                       handlerQueue = [],
-                       args = slice.call( arguments ),
-                       handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+                       handlers = (
+                               dataPriv.get( this, "events" ) || Object.create( null )
+                       )[ event.type ] || [],
                        special = jQuery.event.special[ event.type ] || {};
 
                // Use the fix-ed jQuery.Event rather than the (read-only) native event
                args[ 0 ] = event;
+
+               for ( i = 1; i < arguments.length; i++ ) {
+                       args[ i ] = arguments[ i ];
+               }
+
                event.delegateTarget = this;
 
                // Call the preDispatch hook for the mapped type, and let it bail if desired
@@ -5216,9 +5133,10 @@ jQuery.event = {
                        while ( ( handleObj = matched.handlers[ j++ ] ) &&
                                !event.isImmediatePropagationStopped() ) {
 
-                               // Triggered event must either 1) have no namespace, or 2) have namespace(s)
-                               // a subset or equal to those in the bound event (both can have no namespace).
-                               if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
+                               // If the event is namespaced, then each handler is only invoked if it is
+                               // specially universal or its namespaces are a superset of the event's.
+                               if ( !event.rnamespace || handleObj.namespace === false ||
+                                       event.rnamespace.test( handleObj.namespace ) ) {
 
                                        event.handleObj = handleObj;
                                        event.data = handleObj.data;
@@ -5245,160 +5163,95 @@ jQuery.event = {
        },
 
        handlers: function( event, handlers ) {
-               var i, matches, sel, handleObj,
+               var i, handleObj, sel, matchedHandlers, matchedSelectors,
                        handlerQueue = [],
                        delegateCount = handlers.delegateCount,
                        cur = event.target;
 
-               // Support (at least): Chrome, IE9
                // Find delegate handlers
-               // Black-hole SVG <use> instance trees (#13180)
-               //
-               // Support: Firefox<=42+
-               // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
-               if ( delegateCount && cur.nodeType &&
-                       ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
-
-                       /* jshint eqeqeq: false */
-                       for ( ; cur != this; cur = cur.parentNode || this ) {
-                               /* jshint eqeqeq: true */
-
-                               // Don't check non-elements (#13208)
-                               // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
-                               if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
-                                       matches = [];
+               if ( delegateCount &&
+
+                       // Support: IE <=9
+                       // Black-hole SVG <use> instance trees (trac-13180)
+                       cur.nodeType &&
+
+                       // Support: Firefox <=42
+                       // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
+                       // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
+                       // Support: IE 11 only
+                       // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
+                       !( event.type === "click" && event.button >= 1 ) ) {
+
+                       for ( ; cur !== this; cur = cur.parentNode || this ) {
+
+                               // Don't check non-elements (trac-13208)
+                               // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)
+                               if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
+                                       matchedHandlers = [];
+                                       matchedSelectors = {};
                                        for ( i = 0; i < delegateCount; i++ ) {
                                                handleObj = handlers[ i ];
 
-                                               // Don't conflict with Object.prototype properties (#13203)
+                                               // Don't conflict with Object.prototype properties (trac-13203)
                                                sel = handleObj.selector + " ";
 
-                                               if ( matches[ sel ] === undefined ) {
-                                                       matches[ sel ] = handleObj.needsContext ?
+                                               if ( matchedSelectors[ sel ] === undefined ) {
+                                                       matchedSelectors[ sel ] = handleObj.needsContext ?
                                                                jQuery( sel, this ).index( cur ) > -1 :
                                                                jQuery.find( sel, this, null, [ cur ] ).length;
                                                }
-                                               if ( matches[ sel ] ) {
-                                                       matches.push( handleObj );
+                                               if ( matchedSelectors[ sel ] ) {
+                                                       matchedHandlers.push( handleObj );
                                                }
                                        }
-                                       if ( matches.length ) {
-                                               handlerQueue.push( { elem: cur, handlers: matches } );
+                                       if ( matchedHandlers.length ) {
+                                               handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
                                        }
                                }
                        }
                }
 
                // Add the remaining (directly-bound) handlers
+               cur = this;
                if ( delegateCount < handlers.length ) {
-                       handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
+                       handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
                }
 
                return handlerQueue;
        },
 
-       fix: function( event ) {
-               if ( event[ jQuery.expando ] ) {
-                       return event;
-               }
-
-               // Create a writable copy of the event object and normalize some properties
-               var i, prop, copy,
-                       type = event.type,
-                       originalEvent = event,
-                       fixHook = this.fixHooks[ type ];
-
-               if ( !fixHook ) {
-                       this.fixHooks[ type ] = fixHook =
-                               rmouseEvent.test( type ) ? this.mouseHooks :
-                               rkeyEvent.test( type ) ? this.keyHooks :
-                               {};
-               }
-               copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-               event = new jQuery.Event( originalEvent );
-
-               i = copy.length;
-               while ( i-- ) {
-                       prop = copy[ i ];
-                       event[ prop ] = originalEvent[ prop ];
-               }
-
-               // Support: IE<9
-               // Fix target property (#1925)
-               if ( !event.target ) {
-                       event.target = originalEvent.srcElement || document;
-               }
-
-               // Support: Safari 6-8+
-               // Target should not be a text node (#504, #13143)
-               if ( event.target.nodeType === 3 ) {
-                       event.target = event.target.parentNode;
-               }
-
-               // Support: IE<9
-               // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
-               event.metaKey = !!event.metaKey;
-
-               return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
-       },
-
-       // Includes some event props shared by KeyEvent and MouseEvent
-       props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
-               "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
-
-       fixHooks: {},
+       addProp: function( name, hook ) {
+               Object.defineProperty( jQuery.Event.prototype, name, {
+                       enumerable: true,
+                       configurable: true,
 
-       keyHooks: {
-               props: "char charCode key keyCode".split( " " ),
-               filter: function( event, original ) {
+                       get: isFunction( hook ) ?
+                               function() {
+                                       if ( this.originalEvent ) {
+                                               return hook( this.originalEvent );
+                                       }
+                               } :
+                               function() {
+                                       if ( this.originalEvent ) {
+                                               return this.originalEvent[ name ];
+                                       }
+                               },
 
-                       // Add which for key events
-                       if ( event.which == null ) {
-                               event.which = original.charCode != null ? original.charCode : original.keyCode;
+                       set: function( value ) {
+                               Object.defineProperty( this, name, {
+                                       enumerable: true,
+                                       configurable: true,
+                                       writable: true,
+                                       value: value
+                               } );
                        }
-
-                       return event;
-               }
+               } );
        },
 
-       mouseHooks: {
-               props: ( "button buttons clientX clientY fromElement offsetX offsetY " +
-                       "pageX pageY screenX screenY toElement" ).split( " " ),
-               filter: function( event, original ) {
-                       var body, eventDoc, doc,
-                               button = original.button,
-                               fromElement = original.fromElement;
-
-                       // Calculate pageX/Y if missing and clientX/Y available
-                       if ( event.pageX == null && original.clientX != null ) {
-                               eventDoc = event.target.ownerDocument || document;
-                               doc = eventDoc.documentElement;
-                               body = eventDoc.body;
-
-                               event.pageX = original.clientX +
-                                       ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
-                                       ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-                               event.pageY = original.clientY +
-                                       ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) -
-                                       ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-                       }
-
-                       // Add relatedTarget, if necessary
-                       if ( !event.relatedTarget && fromElement ) {
-                               event.relatedTarget = fromElement === event.target ?
-                                       original.toElement :
-                                       fromElement;
-                       }
-
-                       // Add which for click: 1 === left; 2 === middle; 3 === right
-                       // Note: button is not normalized, so don't use it
-                       if ( !event.which && button !== undefined ) {
-                               event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-                       }
-
-                       return event;
-               }
+       fix: function( originalEvent ) {
+               return originalEvent[ jQuery.expando ] ?
+                       originalEvent :
+                       new jQuery.Event( originalEvent );
        },
 
        special: {
@@ -5407,46 +5260,51 @@ jQuery.event = {
                        // Prevent triggered image.load events from bubbling to window.load
                        noBubble: true
                },
-               focus: {
-
-                       // Fire native event if possible so blur/focus sequence is correct
-                       trigger: function() {
-                               if ( this !== safeActiveElement() && this.focus ) {
-                                       try {
-                                               this.focus();
-                                               return false;
-                                       } catch ( e ) {
-
-                                               // Support: IE<9
-                                               // If we error on focus to hidden element (#1486, #12518),
-                                               // let .trigger() run the handlers
-                                       }
-                               }
-                       },
-                       delegateType: "focusin"
-               },
-               blur: {
-                       trigger: function() {
-                               if ( this === safeActiveElement() && this.blur ) {
-                                       this.blur();
-                                       return false;
+               click: {
+
+                       // Utilize native event to ensure correct state for checkable inputs
+                       setup: function( data ) {
+
+                               // For mutual compressibility with _default, replace `this` access with a local var.
+                               // `|| data` is dead code meant only to preserve the variable through minification.
+                               var el = this || data;
+
+                               // Claim the first handler
+                               if ( rcheckableType.test( el.type ) &&
+                                       el.click && nodeName( el, "input" ) ) {
+
+                                       // dataPriv.set( el, "click", ... )
+                                       leverageNative( el, "click", true );
                                }
+
+                               // Return false to allow normal processing in the caller
+                               return false;
                        },
-                       delegateType: "focusout"
-               },
-               click: {
+                       trigger: function( data ) {
 
-                       // For checkbox, fire native event so checked state will be right
-                       trigger: function() {
-                               if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
-                                       this.click();
-                                       return false;
+                               // For mutual compressibility with _default, replace `this` access with a local var.
+                               // `|| data` is dead code meant only to preserve the variable through minification.
+                               var el = this || data;
+
+                               // Force setup before triggering a click
+                               if ( rcheckableType.test( el.type ) &&
+                                       el.click && nodeName( el, "input" ) ) {
+
+                                       leverageNative( el, "click" );
                                }
+
+                               // Return non-false to allow normal event-path propagation
+                               return true;
                        },
 
-                       // For cross-browser consistency, don't fire native .click() on links
+                       // For cross-browser consistency, suppress native .click() on links
+                       // Also prevent it if we're currently inside a leveraged native-event stack
                        _default: function( event ) {
-                               return jQuery.nodeName( event.target, "a" );
+                               var target = event.target;
+                               return rcheckableType.test( target.type ) &&
+                                       target.click && nodeName( target, "input" ) &&
+                                       dataPriv.get( target, "click" ) ||
+                                       nodeName( target, "a" );
                        }
                },
 
@@ -5460,59 +5318,99 @@ jQuery.event = {
                                }
                        }
                }
-       },
-
-       // Piggyback on a donor event to simulate a different one
-       simulate: function( type, elem, event ) {
-               var e = jQuery.extend(
-                       new jQuery.Event(),
-                       event,
-                       {
-                               type: type,
-                               isSimulated: true
-
-                               // Previously, `originalEvent: {}` was set here, so stopPropagation call
-                               // would not be triggered on donor event, since in our own
-                               // jQuery.event.stopPropagation function we had a check for existence of
-                               // originalEvent.stopPropagation method, so, consequently it would be a noop.
-                               //
-                               // Guard for simulated events was moved to jQuery.event.stopPropagation function
-                               // since `originalEvent` should point to the original event for the
-                               // constancy with other events and for more focused logic
-                       }
-               );
+       }
+};
 
-               jQuery.event.trigger( e, null, elem );
+// Ensure the presence of an event listener that handles manually-triggered
+// synthetic events by interrupting progress until reinvoked in response to
+// *native* events that it fires directly, ensuring that state changes have
+// already occurred before other listeners are invoked.
+function leverageNative( el, type, isSetup ) {
 
-               if ( e.isDefaultPrevented() ) {
-                       event.preventDefault();
+       // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add
+       if ( !isSetup ) {
+               if ( dataPriv.get( el, type ) === undefined ) {
+                       jQuery.event.add( el, type, returnTrue );
                }
+               return;
        }
-};
 
-jQuery.removeEvent = document.removeEventListener ?
-       function( elem, type, handle ) {
+       // Register the controller as a special universal handler for all event namespaces
+       dataPriv.set( el, type, false );
+       jQuery.event.add( el, type, {
+               namespace: false,
+               handler: function( event ) {
+                       var result,
+                               saved = dataPriv.get( this, type );
 
-               // This "if" is needed for plain objects
-               if ( elem.removeEventListener ) {
-                       elem.removeEventListener( type, handle );
-               }
-       } :
-       function( elem, type, handle ) {
-               var name = "on" + type;
+                       if ( ( event.isTrigger & 1 ) && this[ type ] ) {
 
-               if ( elem.detachEvent ) {
+                               // Interrupt processing of the outer synthetic .trigger()ed event
+                               if ( !saved ) {
 
-                       // #8545, #7054, preventing memory leaks for custom events in IE6-8
-                       // detachEvent needed property on element, by name of that event,
-                       // to properly expose it to GC
-                       if ( typeof elem[ name ] === "undefined" ) {
-                               elem[ name ] = null;
-                       }
+                                       // Store arguments for use when handling the inner native event
+                                       // There will always be at least one argument (an event object), so this array
+                                       // will not be confused with a leftover capture object.
+                                       saved = slice.call( arguments );
+                                       dataPriv.set( this, type, saved );
+
+                                       // Trigger the native event and capture its result
+                                       this[ type ]();
+                                       result = dataPriv.get( this, type );
+                                       dataPriv.set( this, type, false );
+
+                                       if ( saved !== result ) {
+
+                                               // Cancel the outer synthetic event
+                                               event.stopImmediatePropagation();
+                                               event.preventDefault();
+
+                                               return result;
+                                       }
+
+                               // If this is an inner synthetic event for an event with a bubbling surrogate
+                               // (focus or blur), assume that the surrogate already propagated from triggering
+                               // the native event and prevent that from happening again here.
+                               // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
+                               // bubbling surrogate propagates *after* the non-bubbling base), but that seems
+                               // less bad than duplication.
+                               } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
+                                       event.stopPropagation();
+                               }
 
-                       elem.detachEvent( name, handle );
+                       // If this is a native event triggered above, everything is now in order
+                       // Fire an inner synthetic event with the original arguments
+                       } else if ( saved ) {
+
+                               // ...and capture the result
+                               dataPriv.set( this, type, jQuery.event.trigger(
+                                       saved[ 0 ],
+                                       saved.slice( 1 ),
+                                       this
+                               ) );
+
+                               // Abort handling of the native event by all jQuery handlers while allowing
+                               // native handlers on the same element to run. On target, this is achieved
+                               // by stopping immediate propagation just on the jQuery event. However,
+                               // the native event is re-wrapped by a jQuery one on each level of the
+                               // propagation so the only way to stop it for jQuery is to stop it for
+                               // everyone via native `stopPropagation()`. This is not a problem for
+                               // focus/blur which don't bubble, but it does also stop click on checkboxes
+                               // and radios. We accept this limitation.
+                               event.stopPropagation();
+                               event.isImmediatePropagationStopped = returnTrue;
+                       }
                }
-       };
+       } );
+}
+
+jQuery.removeEvent = function( elem, type, handle ) {
+
+       // This "if" is needed for plain objects
+       if ( elem.removeEventListener ) {
+               elem.removeEventListener( type, handle );
+       }
+};
 
 jQuery.Event = function( src, props ) {
 
@@ -5531,11 +5429,21 @@ jQuery.Event = function( src, props ) {
                this.isDefaultPrevented = src.defaultPrevented ||
                                src.defaultPrevented === undefined &&
 
-                               // Support: IE < 9, Android < 4.0
+                               // Support: Android <=2.3 only
                                src.returnValue === false ?
                        returnTrue :
                        returnFalse;
 
+               // Create target properties
+               // Support: Safari <=6 - 7 only
+               // Target should not be a text node (trac-504, trac-13143)
+               this.target = ( src.target && src.target.nodeType === 3 ) ?
+                       src.target.parentNode :
+                       src.target;
+
+               this.currentTarget = src.currentTarget;
+               this.relatedTarget = src.relatedTarget;
+
        // Event type
        } else {
                this.type = src;
@@ -5547,36 +5455,28 @@ jQuery.Event = function( src, props ) {
        }
 
        // Create a timestamp if incoming event doesn't have one
-       this.timeStamp = src && src.timeStamp || jQuery.now();
+       this.timeStamp = src && src.timeStamp || Date.now();
 
        // Mark it as fixed
        this[ jQuery.expando ] = true;
 };
 
 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
 jQuery.Event.prototype = {
        constructor: jQuery.Event,
        isDefaultPrevented: returnFalse,
        isPropagationStopped: returnFalse,
        isImmediatePropagationStopped: returnFalse,
+       isSimulated: false,
 
        preventDefault: function() {
                var e = this.originalEvent;
 
                this.isDefaultPrevented = returnTrue;
-               if ( !e ) {
-                       return;
-               }
 
-               // If preventDefault exists, run it on the original event
-               if ( e.preventDefault ) {
+               if ( e && !this.isSimulated ) {
                        e.preventDefault();
-
-               // Support: IE
-               // Otherwise set the returnValue property of the original event to false
-               } else {
-                       e.returnValue = false;
                }
        },
        stopPropagation: function() {
@@ -5584,25 +5484,16 @@ jQuery.Event.prototype = {
 
                this.isPropagationStopped = returnTrue;
 
-               if ( !e || this.isSimulated ) {
-                       return;
-               }
-
-               // If stopPropagation exists, run it on the original event
-               if ( e.stopPropagation ) {
+               if ( e && !this.isSimulated ) {
                        e.stopPropagation();
                }
-
-               // Support: IE
-               // Set the cancelBubble property of the original event to true
-               e.cancelBubble = true;
        },
        stopImmediatePropagation: function() {
                var e = this.originalEvent;
 
                this.isImmediatePropagationStopped = returnTrue;
 
-               if ( e && e.stopImmediatePropagation ) {
+               if ( e && !this.isSimulated ) {
                        e.stopImmediatePropagation();
                }
 
@@ -5610,206 +5501,234 @@ jQuery.Event.prototype = {
        }
 };
 
-// Create mouseenter/leave events using mouseover/out and event-time checks
-// so that event delegation works in jQuery.
-// Do the same for pointerenter/pointerleave and pointerover/pointerout
-//
-// Support: Safari 7 only
-// Safari sends mouseenter too often; see:
-// https://code.google.com/p/chromium/issues/detail?id=470258
-// for the description of the bug (it existed in older Chrome versions as well).
+// Includes all common event props including KeyEvent and MouseEvent specific props
 jQuery.each( {
-       mouseenter: "mouseover",
-       mouseleave: "mouseout",
-       pointerenter: "pointerover",
-       pointerleave: "pointerout"
-}, function( orig, fix ) {
-       jQuery.event.special[ orig ] = {
-               delegateType: fix,
-               bindType: fix,
-
-               handle: function( event ) {
-                       var ret,
-                               target = this,
-                               related = event.relatedTarget,
-                               handleObj = event.handleObj;
-
-                       // For mouseenter/leave call the handler if related is outside the target.
-                       // NB: No relatedTarget if the mouse left/entered the browser window
-                       if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
-                               event.type = handleObj.origType;
-                               ret = handleObj.handler.apply( this, arguments );
-                               event.type = fix;
+       altKey: true,
+       bubbles: true,
+       cancelable: true,
+       changedTouches: true,
+       ctrlKey: true,
+       detail: true,
+       eventPhase: true,
+       metaKey: true,
+       pageX: true,
+       pageY: true,
+       shiftKey: true,
+       view: true,
+       "char": true,
+       code: true,
+       charCode: true,
+       key: true,
+       keyCode: true,
+       button: true,
+       buttons: true,
+       clientX: true,
+       clientY: true,
+       offsetX: true,
+       offsetY: true,
+       pointerId: true,
+       pointerType: true,
+       screenX: true,
+       screenY: true,
+       targetTouches: true,
+       toElement: true,
+       touches: true,
+       which: true
+}, jQuery.event.addProp );
+
+jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
+
+       function focusMappedHandler( nativeEvent ) {
+               if ( document.documentMode ) {
+
+                       // Support: IE 11+
+                       // Attach a single focusin/focusout handler on the document while someone wants
+                       // focus/blur. This is because the former are synchronous in IE while the latter
+                       // are async. In other browsers, all those handlers are invoked synchronously.
+
+                       // `handle` from private data would already wrap the event, but we need
+                       // to change the `type` here.
+                       var handle = dataPriv.get( this, "handle" ),
+                               event = jQuery.event.fix( nativeEvent );
+                       event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
+                       event.isSimulated = true;
+
+                       // First, handle focusin/focusout
+                       handle( nativeEvent );
+
+                       // ...then, handle focus/blur
+                       //
+                       // focus/blur don't bubble while focusin/focusout do; simulate the former by only
+                       // invoking the handler at the lower level.
+                       if ( event.target === event.currentTarget ) {
+
+                               // The setup part calls `leverageNative`, which, in turn, calls
+                               // `jQuery.event.add`, so event handle will already have been set
+                               // by this point.
+                               handle( event );
                        }
-                       return ret;
+               } else {
+
+                       // For non-IE browsers, attach a single capturing handler on the document
+                       // while someone wants focusin/focusout.
+                       jQuery.event.simulate( delegateType, nativeEvent.target,
+                               jQuery.event.fix( nativeEvent ) );
                }
-       };
-} );
+       }
 
-// IE submit delegation
-if ( !support.submit ) {
+       jQuery.event.special[ type ] = {
 
-       jQuery.event.special.submit = {
+               // Utilize native event if possible so blur/focus sequence is correct
                setup: function() {
 
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Lazy-add a submit handler when a descendant form may potentially be submitted
-                       jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+                       var attaches;
 
-                               // Node name check avoids a VML-related crash in IE (#9807)
-                               var elem = e.target,
-                                       form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ?
+                       // Claim the first handler
+                       // dataPriv.set( this, "focus", ... )
+                       // dataPriv.set( this, "blur", ... )
+                       leverageNative( this, type, true );
 
-                                               // Support: IE <=8
-                                               // We use jQuery.prop instead of elem.form
-                                               // to allow fixing the IE8 delegated submit issue (gh-2332)
-                                               // by 3rd party polyfills/workarounds.
-                                               jQuery.prop( elem, "form" ) :
-                                               undefined;
+                       if ( document.documentMode ) {
 
-                               if ( form && !jQuery._data( form, "submit" ) ) {
-                                       jQuery.event.add( form, "submit._submit", function( event ) {
-                                               event._submitBubble = true;
-                                       } );
-                                       jQuery._data( form, "submit", true );
+                               // Support: IE 9 - 11+
+                               // We use the same native handler for focusin & focus (and focusout & blur)
+                               // so we need to coordinate setup & teardown parts between those events.
+                               // Use `delegateType` as the key as `type` is already used by `leverageNative`.
+                               attaches = dataPriv.get( this, delegateType );
+                               if ( !attaches ) {
+                                       this.addEventListener( delegateType, focusMappedHandler );
                                }
-                       } );
+                               dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 );
+                       } else {
 
-                       // return undefined since we don't need an event listener
+                               // Return false to allow normal processing in the caller
+                               return false;
+                       }
                },
+               trigger: function() {
 
-               postDispatch: function( event ) {
+                       // Force setup before trigger
+                       leverageNative( this, type );
 
-                       // If form was submitted by the user, bubble the event up the tree
-                       if ( event._submitBubble ) {
-                               delete event._submitBubble;
-                               if ( this.parentNode && !event.isTrigger ) {
-                                       jQuery.event.simulate( "submit", this.parentNode, event );
-                               }
-                       }
+                       // Return non-false to allow normal event-path propagation
+                       return true;
                },
 
                teardown: function() {
+                       var attaches;
 
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-                       jQuery.event.remove( this, "._submit" );
-               }
-       };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !support.change ) {
-
-       jQuery.event.special.change = {
-
-               setup: function() {
-
-                       if ( rformElems.test( this.nodeName ) ) {
-
-                               // IE doesn't fire change on a check/radio until blur; trigger it on click
-                               // after a propertychange. Eat the blur-change in special.change.handle.
-                               // This still fires onchange a second time for check/radio after blur.
-                               if ( this.type === "checkbox" || this.type === "radio" ) {
-                                       jQuery.event.add( this, "propertychange._change", function( event ) {
-                                               if ( event.originalEvent.propertyName === "checked" ) {
-                                                       this._justChanged = true;
-                                               }
-                                       } );
-                                       jQuery.event.add( this, "click._change", function( event ) {
-                                               if ( this._justChanged && !event.isTrigger ) {
-                                                       this._justChanged = false;
-                                               }
-
-                                               // Allow triggered, simulated change events (#11500)
-                                               jQuery.event.simulate( "change", this, event );
-                                       } );
+                       if ( document.documentMode ) {
+                               attaches = dataPriv.get( this, delegateType ) - 1;
+                               if ( !attaches ) {
+                                       this.removeEventListener( delegateType, focusMappedHandler );
+                                       dataPriv.remove( this, delegateType );
+                               } else {
+                                       dataPriv.set( this, delegateType, attaches );
                                }
+                       } else {
+
+                               // Return false to indicate standard teardown should be applied
                                return false;
                        }
+               },
 
-                       // Delegated event; lazy-add a change handler on descendant inputs
-                       jQuery.event.add( this, "beforeactivate._change", function( e ) {
-                               var elem = e.target;
-
-                               if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) {
-                                       jQuery.event.add( elem, "change._change", function( event ) {
-                                               if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-                                                       jQuery.event.simulate( "change", this.parentNode, event );
-                                               }
-                                       } );
-                                       jQuery._data( elem, "change", true );
-                               }
-                       } );
+               // Suppress native focus or blur if we're currently inside
+               // a leveraged native-event stack
+               _default: function( event ) {
+                       return dataPriv.get( event.target, type );
                },
 
-               handle: function( event ) {
-                       var elem = event.target;
+               delegateType: delegateType
+       };
 
-                       // Swallow native change events from checkbox/radio, we already triggered them above
-                       if ( this !== elem || event.isSimulated || event.isTrigger ||
-                               ( elem.type !== "radio" && elem.type !== "checkbox" ) ) {
+       // Support: Firefox <=44
+       // Firefox doesn't have focus(in | out) events
+       // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+       //
+       // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
+       // focus(in | out) events fire after focus & blur events,
+       // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
+       // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
+       //
+       // Support: IE 9 - 11+
+       // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,
+       // attach a single handler for both events in IE.
+       jQuery.event.special[ delegateType ] = {
+               setup: function() {
 
-                               return event.handleObj.handler.apply( this, arguments );
+                       // Handle: regular nodes (via `this.ownerDocument`), window
+                       // (via `this.document`) & document (via `this`).
+                       var doc = this.ownerDocument || this.document || this,
+                               dataHolder = document.documentMode ? this : doc,
+                               attaches = dataPriv.get( dataHolder, delegateType );
+
+                       // Support: IE 9 - 11+
+                       // We use the same native handler for focusin & focus (and focusout & blur)
+                       // so we need to coordinate setup & teardown parts between those events.
+                       // Use `delegateType` as the key as `type` is already used by `leverageNative`.
+                       if ( !attaches ) {
+                               if ( document.documentMode ) {
+                                       this.addEventListener( delegateType, focusMappedHandler );
+                               } else {
+                                       doc.addEventListener( type, focusMappedHandler, true );
+                               }
                        }
+                       dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 );
                },
-
                teardown: function() {
-                       jQuery.event.remove( this, "._change" );
+                       var doc = this.ownerDocument || this.document || this,
+                               dataHolder = document.documentMode ? this : doc,
+                               attaches = dataPriv.get( dataHolder, delegateType ) - 1;
 
-                       return !rformElems.test( this.nodeName );
+                       if ( !attaches ) {
+                               if ( document.documentMode ) {
+                                       this.removeEventListener( delegateType, focusMappedHandler );
+                               } else {
+                                       doc.removeEventListener( type, focusMappedHandler, true );
+                               }
+                               dataPriv.remove( dataHolder, delegateType );
+                       } else {
+                               dataPriv.set( dataHolder, delegateType, attaches );
+                       }
                }
        };
-}
+} );
 
-// Support: Firefox
-// Firefox doesn't have focus(in | out) events
-// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// so that event delegation works in jQuery.
+// Do the same for pointerenter/pointerleave and pointerover/pointerout
 //
-// Support: Chrome, Safari
-// focus(in | out) events fire after focus & blur events,
-// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
-// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
-if ( !support.focusin ) {
-       jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-               // Attach a single capturing handler on the document while someone wants focusin/focusout
-               var handler = function( event ) {
-                       jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
-               };
-
-               jQuery.event.special[ fix ] = {
-                       setup: function() {
-                               var doc = this.ownerDocument || this,
-                                       attaches = jQuery._data( doc, fix );
+// Support: Safari 7 only
+// Safari sends mouseenter too often; see:
+// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
+// for the description of the bug (it existed in older Chrome versions as well).
+jQuery.each( {
+       mouseenter: "mouseover",
+       mouseleave: "mouseout",
+       pointerenter: "pointerover",
+       pointerleave: "pointerout"
+}, function( orig, fix ) {
+       jQuery.event.special[ orig ] = {
+               delegateType: fix,
+               bindType: fix,
 
-                               if ( !attaches ) {
-                                       doc.addEventListener( orig, handler, true );
-                               }
-                               jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
-                       },
-                       teardown: function() {
-                               var doc = this.ownerDocument || this,
-                                       attaches = jQuery._data( doc, fix ) - 1;
+               handle: function( event ) {
+                       var ret,
+                               target = this,
+                               related = event.relatedTarget,
+                               handleObj = event.handleObj;
 
-                               if ( !attaches ) {
-                                       doc.removeEventListener( orig, handler, true );
-                                       jQuery._removeData( doc, fix );
-                               } else {
-                                       jQuery._data( doc, fix, attaches );
-                               }
+                       // For mouseenter/leave call the handler if related is outside the target.
+                       // NB: No relatedTarget if the mouse left/entered the browser window
+                       if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
+                               event.type = handleObj.origType;
+                               ret = handleObj.handler.apply( this, arguments );
+                               event.type = fix;
                        }
-               };
-       } );
-}
+                       return ret;
+               }
+       };
+} );
 
 jQuery.fn.extend( {
 
@@ -5854,154 +5773,89 @@ jQuery.fn.extend( {
                return this.each( function() {
                        jQuery.event.remove( this, types, fn, selector );
                } );
-       },
-
-       trigger: function( type, data ) {
-               return this.each( function() {
-                       jQuery.event.trigger( type, data, this );
-               } );
-       },
-       triggerHandler: function( type, data ) {
-               var elem = this[ 0 ];
-               if ( elem ) {
-                       return jQuery.event.trigger( type, data, elem, true );
-               }
        }
 } );
 
 
-var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
-       rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
-       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
+var
 
-       // Support: IE 10-11, Edge 10240+
+       // Support: IE <=10 - 11, Edge 12 - 13 only
        // In IE/Edge using regex groups here causes severe slowdowns.
        // See https://connect.microsoft.com/IE/feedback/details/1736512/
        rnoInnerhtml = /<script|<style|<link/i,
 
        // checked="checked" or checked
        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-       rscriptTypeMasked = /^true\/(.*)/,
-       rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
-       safeFragment = createSafeFragment( document ),
-       fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) );
 
-// Support: IE<8
-// Manipulating tables requires a tbody
+       rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
+
+// Prefer a tbody over its parent table for containing new rows
 function manipulationTarget( elem, content ) {
-       return jQuery.nodeName( elem, "table" ) &&
-               jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+       if ( nodeName( elem, "table" ) &&
+               nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
+
+               return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
+       }
 
-               elem.getElementsByTagName( "tbody" )[ 0 ] ||
-                       elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
-               elem;
+       return elem;
 }
 
 // Replace/restore the type attribute of script elements for safe DOM manipulation
 function disableScript( elem ) {
-       elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type;
+       elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
        return elem;
 }
 function restoreScript( elem ) {
-       var match = rscriptTypeMasked.exec( elem.type );
-       if ( match ) {
-               elem.type = match[ 1 ];
+       if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
+               elem.type = elem.type.slice( 5 );
        } else {
                elem.removeAttribute( "type" );
        }
+
        return elem;
 }
 
 function cloneCopyEvent( src, dest ) {
-       if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-               return;
-       }
-
-       var type, i, l,
-               oldData = jQuery._data( src ),
-               curData = jQuery._data( dest, oldData ),
-               events = oldData.events;
-
-       if ( events ) {
-               delete curData.handle;
-               curData.events = {};
-
-               for ( type in events ) {
-                       for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-                               jQuery.event.add( dest, type, events[ type ][ i ] );
-                       }
-               }
-       }
-
-       // make the cloned public data object a copy from the original
-       if ( curData.data ) {
-               curData.data = jQuery.extend( {}, curData.data );
-       }
-}
+       var i, l, type, pdataOld, udataOld, udataCur, events;
 
-function fixCloneNodeIssues( src, dest ) {
-       var nodeName, e, data;
-
-       // We do not need to do anything for non-Elements
        if ( dest.nodeType !== 1 ) {
                return;
        }
 
-       nodeName = dest.nodeName.toLowerCase();
+       // 1. Copy private data: events, handlers, etc.
+       if ( dataPriv.hasData( src ) ) {
+               pdataOld = dataPriv.get( src );
+               events = pdataOld.events;
 
-       // IE6-8 copies events bound via attachEvent when using cloneNode.
-       if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
-               data = jQuery._data( dest );
+               if ( events ) {
+                       dataPriv.remove( dest, "handle events" );
 
-               for ( e in data.events ) {
-                       jQuery.removeEvent( dest, e, data.handle );
+                       for ( type in events ) {
+                               for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+                                       jQuery.event.add( dest, type, events[ type ][ i ] );
+                               }
+                       }
                }
-
-               // Event data gets referenced instead of copied if the expando gets copied too
-               dest.removeAttribute( jQuery.expando );
        }
 
-       // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
-       if ( nodeName === "script" && dest.text !== src.text ) {
-               disableScript( dest ).text = src.text;
-               restoreScript( dest );
-
-       // IE6-10 improperly clones children of object elements using classid.
-       // IE10 throws NoModificationAllowedError if parent is null, #12132.
-       } else if ( nodeName === "object" ) {
-               if ( dest.parentNode ) {
-                       dest.outerHTML = src.outerHTML;
-               }
-
-               // This path appears unavoidable for IE9. When cloning an object
-               // element in IE9, the outerHTML strategy above is not sufficient.
-               // If the src has innerHTML and the destination does not,
-               // copy the src.innerHTML into the dest.innerHTML. #10324
-               if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) {
-                       dest.innerHTML = src.innerHTML;
-               }
-
-       } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
-
-               // IE6-8 fails to persist the checked state of a cloned checkbox
-               // or radio button. Worse, IE6-7 fail to give the cloned element
-               // a checked appearance if the defaultChecked value isn't also set
+       // 2. Copy user data
+       if ( dataUser.hasData( src ) ) {
+               udataOld = dataUser.access( src );
+               udataCur = jQuery.extend( {}, udataOld );
 
-               dest.defaultChecked = dest.checked = src.checked;
+               dataUser.set( dest, udataCur );
+       }
+}
 
-               // IE6-7 get confused and end up setting the value of a cloned
-               // checkbox/radio button to an empty string instead of "on"
-               if ( dest.value !== src.value ) {
-                       dest.value = src.value;
-               }
+// Fix IE bugs, see support tests
+function fixInput( src, dest ) {
+       var nodeName = dest.nodeName.toLowerCase();
 
-       // IE6-8 fails to return the selected option to the default selected
-       // state when cloning options
-       } else if ( nodeName === "option" ) {
-               dest.defaultSelected = dest.selected = src.defaultSelected;
+       // Fails to persist the checked state of a cloned checkbox or radio button.
+       if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+               dest.checked = src.checked;
 
-       // IE6-8 fails to set the defaultValue to the correct value when
-       // cloning other types of input fields
+       // Fails to return the selected option to the default selected state when cloning options
        } else if ( nodeName === "input" || nodeName === "textarea" ) {
                dest.defaultValue = src.defaultValue;
        }
@@ -6010,23 +5864,22 @@ function fixCloneNodeIssues( src, dest ) {
 function domManip( collection, args, callback, ignored ) {
 
        // Flatten any nested arrays
-       args = concat.apply( [], args );
+       args = flat( args );
 
-       var first, node, hasScripts,
-               scripts, doc, fragment,
+       var fragment, first, scripts, hasScripts, node, doc,
                i = 0,
                l = collection.length,
                iNoClone = l - 1,
                value = args[ 0 ],
-               isFunction = jQuery.isFunction( value );
+               valueIsFunction = isFunction( value );
 
        // We can't cloneNode fragments that contain checked, in WebKit
-       if ( isFunction ||
+       if ( valueIsFunction ||
                        ( l > 1 && typeof value === "string" &&
                                !support.checkClone && rchecked.test( value ) ) ) {
                return collection.each( function( index ) {
                        var self = collection.eq( index );
-                       if ( isFunction ) {
+                       if ( valueIsFunction ) {
                                args[ 0 ] = value.call( this, index, self.html() );
                        }
                        domManip( self, args, callback, ignored );
@@ -6048,7 +5901,7 @@ function domManip( collection, args, callback, ignored ) {
 
                        // Use the original fragment for the last item
                        // instead of the first because it can end up
-                       // being emptied incorrectly in certain situations (#8070).
+                       // being emptied incorrectly in certain situations (trac-8070).
                        for ( ; i < l; i++ ) {
                                node = fragment;
 
@@ -6058,7 +5911,7 @@ function domManip( collection, args, callback, ignored ) {
                                        // Keep references to cloned scripts for later restoration
                                        if ( hasScripts ) {
 
-                                               // Support: Android<4.1, PhantomJS<2
+                                               // Support: Android <=4.0 only, PhantomJS 1 only
                                                // push.apply(_, arraylike) throws on ancient WebKit
                                                jQuery.merge( scripts, getAll( node, "script" ) );
                                        }
@@ -6070,34 +5923,36 @@ function domManip( collection, args, callback, ignored ) {
                        if ( hasScripts ) {
                                doc = scripts[ scripts.length - 1 ].ownerDocument;
 
-                               // Reenable scripts
+                               // Re-enable scripts
                                jQuery.map( scripts, restoreScript );
 
                                // Evaluate executable scripts on first document insertion
                                for ( i = 0; i < hasScripts; i++ ) {
                                        node = scripts[ i ];
                                        if ( rscriptType.test( node.type || "" ) &&
-                                               !jQuery._data( node, "globalEval" ) &&
+                                               !dataPriv.access( node, "globalEval" ) &&
                                                jQuery.contains( doc, node ) ) {
 
-                                               if ( node.src ) {
+                                               if ( node.src && ( node.type || "" ).toLowerCase()  !== "module" ) {
 
                                                        // Optional AJAX dependency, but won't run scripts if not present
-                                                       if ( jQuery._evalUrl ) {
-                                                               jQuery._evalUrl( node.src );
+                                                       if ( jQuery._evalUrl && !node.noModule ) {
+                                                               jQuery._evalUrl( node.src, {
+                                                                       nonce: node.nonce || node.getAttribute( "nonce" )
+                                                               }, doc );
                                                        }
                                                } else {
-                                                       jQuery.globalEval(
-                                                               ( node.text || node.textContent || node.innerHTML || "" )
-                                                                       .replace( rcleanScript, "" )
-                                                       );
+
+                                                       // Unwrap a CDATA section containing script contents. This shouldn't be
+                                                       // needed as in XML documents they're already not visible when
+                                                       // inspecting element contents and in HTML documents they have no
+                                                       // meaning but we're preserving that logic for backwards compatibility.
+                                                       // This will be removed completely in 4.0. See gh-4904.
+                                                       DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
                                                }
                                        }
                                }
                        }
-
-                       // Fix #11809: Avoid leaking memory
-                       fragment = first = null;
                }
        }
 
@@ -6106,17 +5961,16 @@ function domManip( collection, args, callback, ignored ) {
 
 function remove( elem, selector, keepData ) {
        var node,
-               elems = selector ? jQuery.filter( selector, elem ) : elem,
+               nodes = selector ? jQuery.filter( selector, elem ) : elem,
                i = 0;
 
-       for ( ; ( node = elems[ i ] ) != null; i++ ) {
-
+       for ( ; ( node = nodes[ i ] ) != null; i++ ) {
                if ( !keepData && node.nodeType === 1 ) {
                        jQuery.cleanData( getAll( node ) );
                }
 
                if ( node.parentNode ) {
-                       if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
+                       if ( keepData && isAttached( node ) ) {
                                setGlobalEval( getAll( node, "script" ) );
                        }
                        node.parentNode.removeChild( node );
@@ -6128,38 +5982,25 @@ function remove( elem, selector, keepData ) {
 
 jQuery.extend( {
        htmlPrefilter: function( html ) {
-               return html.replace( rxhtmlTag, "<$1></$2>" );
+               return html;
        },
 
        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-               var destElements, node, clone, i, srcElements,
-                       inPage = jQuery.contains( elem.ownerDocument, elem );
-
-               if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
-                       !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
-
-                       clone = elem.cloneNode( true );
+               var i, l, srcElements, destElements,
+                       clone = elem.cloneNode( true ),
+                       inPage = isAttached( elem );
 
-               // IE<=8 does not properly clone detached, unknown element nodes
-               } else {
-                       fragmentDiv.innerHTML = elem.outerHTML;
-                       fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
-               }
+               // Fix IE cloning issues
+               if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
+                               !jQuery.isXMLDoc( elem ) ) {
 
-               if ( ( !support.noCloneEvent || !support.noCloneChecked ) &&
-                               ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
-
-                       // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+                       // We eschew jQuery#find here for performance reasons:
+                       // https://jsperf.com/getall-vs-sizzle/2
                        destElements = getAll( clone );
                        srcElements = getAll( elem );
 
-                       // Fix all IE cloning issues
-                       for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) {
-
-                               // Ensure that the destination node is not null; Fixes #9587
-                               if ( destElements[ i ] ) {
-                                       fixCloneNodeIssues( node, destElements[ i ] );
-                               }
+                       for ( i = 0, l = srcElements.length; i < l; i++ ) {
+                               fixInput( srcElements[ i ], destElements[ i ] );
                        }
                }
 
@@ -6169,8 +6010,8 @@ jQuery.extend( {
                                srcElements = srcElements || getAll( elem );
                                destElements = destElements || getAll( clone );
 
-                               for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
-                                       cloneCopyEvent( node, destElements[ i ] );
+                               for ( i = 0, l = srcElements.length; i < l; i++ ) {
+                                       cloneCopyEvent( srcElements[ i ], destElements[ i ] );
                                }
                        } else {
                                cloneCopyEvent( elem, clone );
@@ -6183,27 +6024,18 @@ jQuery.extend( {
                        setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
                }
 
-               destElements = srcElements = node = null;
-
                // Return the cloned set
                return clone;
        },
 
-       cleanData: function( elems, /* internal */ forceAcceptData ) {
-               var elem, type, id, data,
-                       i = 0,
-                       internalKey = jQuery.expando,
-                       cache = jQuery.cache,
-                       attributes = support.attributes,
-                       special = jQuery.event.special;
-
-               for ( ; ( elem = elems[ i ] ) != null; i++ ) {
-                       if ( forceAcceptData || acceptData( elem ) ) {
-
-                               id = elem[ internalKey ];
-                               data = id && cache[ id ];
+       cleanData: function( elems ) {
+               var data, elem, type,
+                       special = jQuery.event.special,
+                       i = 0;
 
-                               if ( data ) {
+               for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
+                       if ( acceptData( elem ) ) {
+                               if ( ( data = elem[ dataPriv.expando ] ) ) {
                                        if ( data.events ) {
                                                for ( type in data.events ) {
                                                        if ( special[ type ] ) {
@@ -6216,27 +6048,15 @@ jQuery.extend( {
                                                }
                                        }
 
-                                       // Remove cache only if it was not already removed by jQuery.event.remove
-                                       if ( cache[ id ] ) {
-
-                                               delete cache[ id ];
-
-                                               // Support: IE<9
-                                               // IE does not allow us to delete expando properties from nodes
-                                               // IE creates expando attributes along with the property
-                                               // IE does not have a removeAttribute function on Document nodes
-                                               if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
-                                                       elem.removeAttribute( internalKey );
-
-                                               // Webkit & Blink performance suffers when deleting properties
-                                               // from DOM nodes, so set to undefined instead
-                                               // https://code.google.com/p/chromium/issues/detail?id=378607
-                                               } else {
-                                                       elem[ internalKey ] = undefined;
-                                               }
+                                       // Support: Chrome <=35 - 45+
+                                       // Assign undefined instead of using delete, see Data#remove
+                                       elem[ dataPriv.expando ] = undefined;
+                               }
+                               if ( elem[ dataUser.expando ] ) {
 
-                                               deletedIds.push( id );
-                                       }
+                                       // Support: Chrome <=35 - 45+
+                                       // Assign undefined instead of using delete, see Data#remove
+                                       elem[ dataUser.expando ] = undefined;
                                }
                        }
                }
@@ -6244,10 +6064,6 @@ jQuery.extend( {
 } );
 
 jQuery.fn.extend( {
-
-       // Keep domManip exposed until 3.0 (gh-2225)
-       domManip: domManip,
-
        detach: function( selector ) {
                return remove( this, selector, true );
        },
@@ -6260,9 +6076,11 @@ jQuery.fn.extend( {
                return access( this, function( value ) {
                        return value === undefined ?
                                jQuery.text( this ) :
-                               this.empty().append(
-                                       ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value )
-                               );
+                               this.empty().each( function() {
+                                       if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+                                               this.textContent = value;
+                                       }
+                               } );
                }, null, value, arguments.length );
        },
 
@@ -6305,21 +6123,13 @@ jQuery.fn.extend( {
                        i = 0;
 
                for ( ; ( elem = this[ i ] ) != null; i++ ) {
-
-                       // Remove element nodes and prevent memory leaks
                        if ( elem.nodeType === 1 ) {
-                               jQuery.cleanData( getAll( elem, false ) );
-                       }
 
-                       // Remove any remaining nodes
-                       while ( elem.firstChild ) {
-                               elem.removeChild( elem.firstChild );
-                       }
+                               // Prevent memory leaks
+                               jQuery.cleanData( getAll( elem, false ) );
 
-                       // If this is a select, ensure that it displays empty (#12336)
-                       // Support: IE<9
-                       if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
-                               elem.options.length = 0;
+                               // Remove any remaining nodes
+                               elem.textContent = "";
                        }
                }
 
@@ -6341,25 +6151,21 @@ jQuery.fn.extend( {
                                i = 0,
                                l = this.length;
 
-                       if ( value === undefined ) {
-                               return elem.nodeType === 1 ?
-                                       elem.innerHTML.replace( rinlinejQuery, "" ) :
-                                       undefined;
+                       if ( value === undefined && elem.nodeType === 1 ) {
+                               return elem.innerHTML;
                        }
 
                        // See if we can take a shortcut and just use innerHTML
                        if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-                               ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
-                               ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
 
                                value = jQuery.htmlPrefilter( value );
 
                                try {
                                        for ( ; i < l; i++ ) {
+                                               elem = this[ i ] || {};
 
                                                // Remove element nodes and prevent memory leaks
-                                               elem = this[ i ] || {};
                                                if ( elem.nodeType === 1 ) {
                                                        jQuery.cleanData( getAll( elem, false ) );
                                                        elem.innerHTML = value;
@@ -6406,119 +6212,121 @@ jQuery.each( {
 }, function( name, original ) {
        jQuery.fn[ name ] = function( selector ) {
                var elems,
-                       i = 0,
                        ret = [],
                        insert = jQuery( selector ),
-                       last = insert.length - 1;
+                       last = insert.length - 1,
+                       i = 0;
 
                for ( ; i <= last; i++ ) {
                        elems = i === last ? this : this.clone( true );
                        jQuery( insert[ i ] )[ original ]( elems );
 
-                       // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+                       // Support: Android <=4.0 only, PhantomJS 1 only
+                       // .get() because push.apply(_, arraylike) throws on ancient WebKit
                        push.apply( ret, elems.get() );
                }
 
                return this.pushStack( ret );
        };
 } );
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
 
+var rcustomProp = /^--/;
 
-var iframe,
-       elemdisplay = {
-
-               // Support: Firefox
-               // We have to pre-define these values for FF (#10227)
-               HTML: "block",
-               BODY: "block"
-       };
-
-/**
- * Retrieve the actual display of a element
- * @param {String} name nodeName of the element
- * @param {Object} doc Document object
- */
-
-// Called only from within defaultDisplay
-function actualDisplay( name, doc ) {
-       var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
 
-               display = jQuery.css( elem[ 0 ], "display" );
+var getStyles = function( elem ) {
 
-       // We don't have any data stored on the element,
-       // so use "detach" method as fast way to get rid of the element
-       elem.detach();
+               // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)
+               // IE throws on elements created in popups
+               // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+               var view = elem.ownerDocument.defaultView;
 
-       return display;
-}
+               if ( !view || !view.opener ) {
+                       view = window;
+               }
 
-/**
- * Try to determine the default display value of an element
- * @param {String} nodeName
- */
-function defaultDisplay( nodeName ) {
-       var doc = document,
-               display = elemdisplay[ nodeName ];
+               return view.getComputedStyle( elem );
+       };
 
-       if ( !display ) {
-               display = actualDisplay( nodeName, doc );
+var swap = function( elem, options, callback ) {
+       var ret, name,
+               old = {};
 
-               // If the simple way fails, read from inside an iframe
-               if ( display === "none" || !display ) {
+       // Remember the old values, and insert the new ones
+       for ( name in options ) {
+               old[ name ] = elem.style[ name ];
+               elem.style[ name ] = options[ name ];
+       }
 
-                       // Use the already-created iframe if possible
-                       iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
-                               .appendTo( doc.documentElement );
+       ret = callback.call( elem );
 
-                       // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
-                       doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+       // Revert the old values
+       for ( name in options ) {
+               elem.style[ name ] = old[ name ];
+       }
 
-                       // Support: IE
-                       doc.write();
-                       doc.close();
+       return ret;
+};
 
-                       display = actualDisplay( nodeName, doc );
-                       iframe.detach();
-               }
 
-               // Store the correct default display
-               elemdisplay[ nodeName ] = display;
-       }
+var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
 
-       return display;
-}
-var rmargin = ( /^margin/ );
 
-var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
 
-var swap = function( elem, options, callback, args ) {
-       var ret, name,
-               old = {};
+( function() {
 
-       // Remember the old values, and insert the new ones
-       for ( name in options ) {
-               old[ name ] = elem.style[ name ];
-               elem.style[ name ] = options[ name ];
-       }
+       // Executing both pixelPosition & boxSizingReliable tests require only one layout
+       // so they're executed at the same time to save the second computation.
+       function computeStyleTests() {
 
-       ret = callback.apply( elem, args || [] );
+               // This is a singleton, we need to execute it only once
+               if ( !div ) {
+                       return;
+               }
 
-       // Revert the old values
-       for ( name in options ) {
-               elem.style[ name ] = old[ name ];
-       }
+               container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
+                       "margin-top:1px;padding:0;border:0";
+               div.style.cssText =
+                       "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
+                       "margin:auto;border:1px;padding:1px;" +
+                       "width:60%;top:1%";
+               documentElement.appendChild( container ).appendChild( div );
 
-       return ret;
-};
+               var divStyle = window.getComputedStyle( div );
+               pixelPositionVal = divStyle.top !== "1%";
 
+               // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
+               reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
 
-var documentElement = document.documentElement;
+               // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
+               // Some styles come back with percentage values, even though they shouldn't
+               div.style.right = "60%";
+               pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
 
+               // Support: IE 9 - 11 only
+               // Detect misreporting of content dimensions for box-sizing:border-box elements
+               boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
 
+               // Support: IE 9 only
+               // Detect overflow:scroll screwiness (gh-3699)
+               // Support: Chrome <=64
+               // Don't get tricked when zoom affects offsetWidth (gh-4029)
+               div.style.position = "absolute";
+               scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
 
-( function() {
-       var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
-               reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
+               documentElement.removeChild( container );
+
+               // Nullify the div so it wouldn't be stored in the memory and
+               // it will also be a sign that checks already performed
+               div = null;
+       }
+
+       function roundPixelMeasures( measure ) {
+               return Math.round( parseFloat( measure ) );
+       }
+
+       var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
+               reliableTrDimensionsVal, reliableMarginLeftVal,
                container = document.createElement( "div" ),
                div = document.createElement( "div" );
 
@@ -6527,292 +6335,170 @@ var documentElement = document.documentElement;
                return;
        }
 
-       div.style.cssText = "float:left;opacity:.5";
-
-       // Support: IE<9
-       // Make sure that element opacity exists (as opposed to filter)
-       support.opacity = div.style.opacity === "0.5";
-
-       // Verify style float existence
-       // (IE uses styleFloat instead of cssFloat)
-       support.cssFloat = !!div.style.cssFloat;
-
+       // Support: IE <=9 - 11 only
+       // Style of cloned element affects source element cloned (trac-8908)
        div.style.backgroundClip = "content-box";
        div.cloneNode( true ).style.backgroundClip = "";
        support.clearCloneStyle = div.style.backgroundClip === "content-box";
 
-       container = document.createElement( "div" );
-       container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
-               "padding:0;margin-top:1px;position:absolute";
-       div.innerHTML = "";
-       container.appendChild( div );
-
-       // Support: Firefox<29, Android 2.3
-       // Vendor-prefix box-sizing
-       support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
-               div.style.WebkitBoxSizing === "";
-
        jQuery.extend( support, {
-               reliableHiddenOffsets: function() {
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
-                       return reliableHiddenOffsetsVal;
-               },
-
                boxSizingReliable: function() {
-
-                       // We're checking for pixelPositionVal here instead of boxSizingReliableVal
-                       // since that compresses better and they're computed together anyway.
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
+                       computeStyleTests();
                        return boxSizingReliableVal;
                },
-
-               pixelMarginRight: function() {
-
-                       // Support: Android 4.0-4.3
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
-                       return pixelMarginRightVal;
+               pixelBoxStyles: function() {
+                       computeStyleTests();
+                       return pixelBoxStylesVal;
                },
-
                pixelPosition: function() {
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
+                       computeStyleTests();
                        return pixelPositionVal;
                },
-
-               reliableMarginRight: function() {
-
-                       // Support: Android 2.3
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
-                       return reliableMarginRightVal;
-               },
-
                reliableMarginLeft: function() {
-
-                       // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
-                       if ( pixelPositionVal == null ) {
-                               computeStyleTests();
-                       }
+                       computeStyleTests();
                        return reliableMarginLeftVal;
+               },
+               scrollboxSize: function() {
+                       computeStyleTests();
+                       return scrollboxSizeVal;
+               },
+
+               // Support: IE 9 - 11+, Edge 15 - 18+
+               // IE/Edge misreport `getComputedStyle` of table rows with width/height
+               // set in CSS while `offset*` properties report correct values.
+               // Behavior in IE 9 is more subtle than in newer versions & it passes
+               // some versions of this test; make sure not to make it pass there!
+               //
+               // Support: Firefox 70+
+               // Only Firefox includes border widths
+               // in computed dimensions. (gh-4529)
+               reliableTrDimensions: function() {
+                       var table, tr, trChild, trStyle;
+                       if ( reliableTrDimensionsVal == null ) {
+                               table = document.createElement( "table" );
+                               tr = document.createElement( "tr" );
+                               trChild = document.createElement( "div" );
+
+                               table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
+                               tr.style.cssText = "box-sizing:content-box;border:1px solid";
+
+                               // Support: Chrome 86+
+                               // Height set through cssText does not get applied.
+                               // Computed height then comes back as 0.
+                               tr.style.height = "1px";
+                               trChild.style.height = "9px";
+
+                               // Support: Android 8 Chrome 86+
+                               // In our bodyBackground.html iframe,
+                               // display for all div elements is set to "inline",
+                               // which causes a problem only in Android 8 Chrome 86.
+                               // Ensuring the div is `display: block`
+                               // gets around this issue.
+                               trChild.style.display = "block";
+
+                               documentElement
+                                       .appendChild( table )
+                                       .appendChild( tr )
+                                       .appendChild( trChild );
+
+                               trStyle = window.getComputedStyle( tr );
+                               reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +
+                                       parseInt( trStyle.borderTopWidth, 10 ) +
+                                       parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;
+
+                               documentElement.removeChild( table );
+                       }
+                       return reliableTrDimensionsVal;
                }
        } );
-
-       function computeStyleTests() {
-               var contents, divStyle,
-                       documentElement = document.documentElement;
-
-               // Setup
-               documentElement.appendChild( container );
-
-               div.style.cssText =
-
-                       // Support: Android 2.3
-                       // Vendor-prefix box-sizing
-                       "-webkit-box-sizing:border-box;box-sizing:border-box;" +
-                       "position:relative;display:block;" +
-                       "margin:auto;border:1px;padding:1px;" +
-                       "top:1%;width:50%";
-
-               // Support: IE<9
-               // Assume reasonable values in the absence of getComputedStyle
-               pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
-               pixelMarginRightVal = reliableMarginRightVal = true;
-
-               // Check for getComputedStyle so that this code is not run in IE<9.
-               if ( window.getComputedStyle ) {
-                       divStyle = window.getComputedStyle( div );
-                       pixelPositionVal = ( divStyle || {} ).top !== "1%";
-                       reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
-                       boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
-
-                       // Support: Android 4.0 - 4.3 only
-                       // Some styles come back with percentage values, even though they shouldn't
-                       div.style.marginRight = "50%";
-                       pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
-
-                       // Support: Android 2.3 only
-                       // Div with explicit width and no margin-right incorrectly
-                       // gets computed margin-right based on width of container (#3333)
-                       // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-                       contents = div.appendChild( document.createElement( "div" ) );
-
-                       // Reset CSS: box-sizing; display; margin; border; padding
-                       contents.style.cssText = div.style.cssText =
-
-                               // Support: Android 2.3
-                               // Vendor-prefix box-sizing
-                               "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
-                               "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
-                       contents.style.marginRight = contents.style.width = "0";
-                       div.style.width = "1px";
-
-                       reliableMarginRightVal =
-                               !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
-
-                       div.removeChild( contents );
-               }
-
-               // Support: IE6-8
-               // First check that getClientRects works as expected
-               // Check if table cells still have offsetWidth/Height when they are set
-               // to display:none and there are still other visible table cells in a
-               // table row; if so, offsetWidth/Height are not reliable for use when
-               // determining if an element has been hidden directly using
-               // display:none (it is still safe to use offsets if a parent element is
-               // hidden; don safety goggles and see bug #4512 for more information).
-               div.style.display = "none";
-               reliableHiddenOffsetsVal = div.getClientRects().length === 0;
-               if ( reliableHiddenOffsetsVal ) {
-                       div.style.display = "";
-                       div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-                       contents = div.getElementsByTagName( "td" );
-                       contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
-                       reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
-                       if ( reliableHiddenOffsetsVal ) {
-                               contents[ 0 ].style.display = "";
-                               contents[ 1 ].style.display = "none";
-                               reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
-                       }
-               }
-
-               // Teardown
-               documentElement.removeChild( container );
-       }
-
 } )();
 
 
-var getStyles, curCSS,
-       rposition = /^(top|right|bottom|left)$/;
-
-if ( window.getComputedStyle ) {
-       getStyles = function( elem ) {
-
-               // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
-               // IE throws on elements created in popups
-               // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
-               var view = elem.ownerDocument.defaultView;
-
-               if ( !view.opener ) {
-                       view = window;
-               }
-
-               return view.getComputedStyle( elem );
-       };
-
-       curCSS = function( elem, name, computed ) {
-               var width, minWidth, maxWidth, ret,
-                       style = elem.style;
-
-               computed = computed || getStyles( elem );
-
-               // getPropertyValue is only needed for .css('filter') in IE9, see #12537
-               ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
-
-               if ( computed ) {
-
-                       if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-                               ret = jQuery.style( elem, name );
-                       }
-
-                       // A tribute to the "awesome hack by Dean Edwards"
-                       // Chrome < 17 and Safari 5.0 uses "computed value"
-                       // instead of "used value" for margin-right
-                       // Safari 5.1.7 (at least) returns percentage for a larger set of values,
-                       // but width seems to be reliably pixels
-                       // this is against the CSSOM draft spec:
-                       // http://dev.w3.org/csswg/cssom/#resolved-values
-                       if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-
-                               // Remember the original values
-                               width = style.width;
-                               minWidth = style.minWidth;
-                               maxWidth = style.maxWidth;
-
-                               // Put in the new values to get a computed value out
-                               style.minWidth = style.maxWidth = style.width = ret;
-                               ret = computed.width;
-
-                               // Revert the changed values
-                               style.width = width;
-                               style.minWidth = minWidth;
-                               style.maxWidth = maxWidth;
-                       }
-               }
-
-               // Support: IE
-               // IE returns zIndex value as an integer.
-               return ret === undefined ?
-                       ret :
-                       ret + "";
-       };
-} else if ( documentElement.currentStyle ) {
-       getStyles = function( elem ) {
-               return elem.currentStyle;
-       };
-
-       curCSS = function( elem, name, computed ) {
-               var left, rs, rsLeft, ret,
-                       style = elem.style;
-
-               computed = computed || getStyles( elem );
-               ret = computed ? computed[ name ] : undefined;
-
-               // Avoid setting ret to empty string here
-               // so we don't default to auto
-               if ( ret == null && style && style[ name ] ) {
-                       ret = style[ name ];
-               }
-
-               // From the awesome hack by Dean Edwards
-               // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-               // If we're not dealing with a regular pixel number
-               // but a number that has a weird ending, we need to convert it to pixels
-               // but not position css attributes, as those are
-               // proportional to the parent element instead
-               // and we can't measure the parent instead because it
-               // might trigger a "stacking dolls" problem
-               if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+function curCSS( elem, name, computed ) {
+       var width, minWidth, maxWidth, ret,
+               isCustomProp = rcustomProp.test( name ),
+
+               // Support: Firefox 51+
+               // Retrieving style before computed somehow
+               // fixes an issue with getting wrong values
+               // on detached elements
+               style = elem.style;
+
+       computed = computed || getStyles( elem );
+
+       // getPropertyValue is needed for:
+       //   .css('filter') (IE 9 only, trac-12537)
+       //   .css('--customProperty) (gh-3144)
+       if ( computed ) {
+
+               // Support: IE <=9 - 11+
+               // IE only supports `"float"` in `getPropertyValue`; in computed styles
+               // it's only available as `"cssFloat"`. We no longer modify properties
+               // sent to `.css()` apart from camelCasing, so we need to check both.
+               // Normally, this would create difference in behavior: if
+               // `getPropertyValue` returns an empty string, the value returned
+               // by `.css()` would be `undefined`. This is usually the case for
+               // disconnected elements. However, in IE even disconnected elements
+               // with no styles return `"none"` for `getPropertyValue( "float" )`
+               ret = computed.getPropertyValue( name ) || computed[ name ];
+
+               if ( isCustomProp && ret ) {
+
+                       // Support: Firefox 105+, Chrome <=105+
+                       // Spec requires trimming whitespace for custom properties (gh-4926).
+                       // Firefox only trims leading whitespace. Chrome just collapses
+                       // both leading & trailing whitespace to a single space.
+                       //
+                       // Fall back to `undefined` if empty string returned.
+                       // This collapses a missing definition with property defined
+                       // and set to an empty string but there's no standard API
+                       // allowing us to differentiate them without a performance penalty
+                       // and returning `undefined` aligns with older jQuery.
+                       //
+                       // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED
+                       // as whitespace while CSS does not, but this is not a problem
+                       // because CSS preprocessing replaces them with U+000A LINE FEED
+                       // (which *is* CSS whitespace)
+                       // https://www.w3.org/TR/css-syntax-3/#input-preprocessing
+                       ret = ret.replace( rtrimCSS, "$1" ) || undefined;
+               }
+
+               if ( ret === "" && !isAttached( elem ) ) {
+                       ret = jQuery.style( elem, name );
+               }
+
+               // A tribute to the "awesome hack by Dean Edwards"
+               // Android Browser returns percentage for some values,
+               // but width seems to be reliably pixels.
+               // This is against the CSSOM draft spec:
+               // https://drafts.csswg.org/cssom/#resolved-values
+               if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
 
                        // Remember the original values
-                       left = style.left;
-                       rs = elem.runtimeStyle;
-                       rsLeft = rs && rs.left;
+                       width = style.width;
+                       minWidth = style.minWidth;
+                       maxWidth = style.maxWidth;
 
                        // Put in the new values to get a computed value out
-                       if ( rsLeft ) {
-                               rs.left = elem.currentStyle.left;
-                       }
-                       style.left = name === "fontSize" ? "1em" : ret;
-                       ret = style.pixelLeft + "px";
+                       style.minWidth = style.maxWidth = style.width = ret;
+                       ret = computed.width;
 
                        // Revert the changed values
-                       style.left = left;
-                       if ( rsLeft ) {
-                               rs.left = rsLeft;
-                       }
+                       style.width = width;
+                       style.minWidth = minWidth;
+                       style.maxWidth = maxWidth;
                }
+       }
 
-               // Support: IE
+       return ret !== undefined ?
+
+               // Support: IE <=9 - 11 only
                // IE returns zIndex value as an integer.
-               return ret === undefined ?
-                       ret :
-                       ret + "" || "auto";
-       };
+               ret + "" :
+               ret;
 }
 
 
-
-
 function addGetHookIf( conditionFn, hookFn ) {
 
        // Define the hook, we'll check on the first run if it's really needed.
@@ -6833,38 +6519,15 @@ function addGetHookIf( conditionFn, hookFn ) {
 }
 
 
-var
-
-               ralpha = /alpha\([^)]*\)/i,
-       ropacity = /opacity\s*=\s*([^)]*)/i,
-
-       // swappable if display is none or starts with table except
-       // "table", "table-cell", or "table-caption"
-       // see here for display values:
-       // https://developer.mozilla.org/en-US/docs/CSS/display
-       rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-       rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
-
-       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-       cssNormalTransform = {
-               letterSpacing: "0",
-               fontWeight: "400"
-       },
-
-       cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
-       emptyStyle = document.createElement( "div" ).style;
-
+var cssPrefixes = [ "Webkit", "Moz", "ms" ],
+       emptyStyle = document.createElement( "div" ).style,
+       vendorProps = {};
 
-// return a css property mapped to a potentially vendor prefixed property
+// Return a vendor-prefixed property or undefined
 function vendorPropName( name ) {
 
-       // shortcut for names that are not vendor prefixed
-       if ( name in emptyStyle ) {
-               return name;
-       }
-
-       // check for vendor prefixed names
-       var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),
+       // Check for vendor prefixed names
+       var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
                i = cssPrefixes.length;
 
        while ( i-- ) {
@@ -6875,171 +6538,187 @@ function vendorPropName( name ) {
        }
 }
 
-function showHide( elements, show ) {
-       var display, elem, hidden,
-               values = [],
-               index = 0,
-               length = elements.length;
-
-       for ( ; index < length; index++ ) {
-               elem = elements[ index ];
-               if ( !elem.style ) {
-                       continue;
-               }
-
-               values[ index ] = jQuery._data( elem, "olddisplay" );
-               display = elem.style.display;
-               if ( show ) {
+// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
+function finalPropName( name ) {
+       var final = jQuery.cssProps[ name ] || vendorProps[ name ];
 
-                       // Reset the inline display of this element to learn if it is
-                       // being hidden by cascaded rules or not
-                       if ( !values[ index ] && display === "none" ) {
-                               elem.style.display = "";
-                       }
+       if ( final ) {
+               return final;
+       }
+       if ( name in emptyStyle ) {
+               return name;
+       }
+       return vendorProps[ name ] = vendorPropName( name ) || name;
+}
 
-                       // Set elements which have been overridden with display: none
-                       // in a stylesheet to whatever the default browser style is
-                       // for such an element
-                       if ( elem.style.display === "" && isHidden( elem ) ) {
-                               values[ index ] =
-                                       jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) );
-                       }
-               } else {
-                       hidden = isHidden( elem );
 
-                       if ( display && display !== "none" || !hidden ) {
-                               jQuery._data(
-                                       elem,
-                                       "olddisplay",
-                                       hidden ? display : jQuery.css( elem, "display" )
-                               );
-                       }
-               }
-       }
+var
 
-       // Set the display of most of the elements in a second loop
-       // to avoid the constant reflow
-       for ( index = 0; index < length; index++ ) {
-               elem = elements[ index ];
-               if ( !elem.style ) {
-                       continue;
-               }
-               if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-                       elem.style.display = show ? values[ index ] || "" : "none";
-               }
-       }
+       // Swappable if display is none or starts with table
+       // except "table", "table-cell", or "table-caption"
+       // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+       rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+       cssNormalTransform = {
+               letterSpacing: "0",
+               fontWeight: "400"
+       };
 
-       return elements;
-}
+function setPositiveNumber( _elem, value, subtract ) {
 
-function setPositiveNumber( elem, value, subtract ) {
-       var matches = rnumsplit.exec( value );
+       // Any relative (+/-) values have already been
+       // normalized at this point
+       var matches = rcssNum.exec( value );
        return matches ?
 
                // Guard against undefined "subtract", e.g., when used as in cssHooks
-               Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+               Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
                value;
 }
 
-function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
-       var i = extra === ( isBorderBox ? "border" : "content" ) ?
-
-               // If we already have the right measurement, avoid augmentation
-               4 :
+function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
+       var i = dimension === "width" ? 1 : 0,
+               extra = 0,
+               delta = 0,
+               marginDelta = 0;
 
-               // Otherwise initialize for horizontal or vertical properties
-               name === "width" ? 1 : 0,
-
-               val = 0;
+       // Adjustment may not be necessary
+       if ( box === ( isBorderBox ? "border" : "content" ) ) {
+               return 0;
+       }
 
        for ( ; i < 4; i += 2 ) {
 
-               // both box models exclude margin, so add it if we want it
-               if ( extra === "margin" ) {
-                       val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+               // Both box models exclude margin
+               // Count margin delta separately to only add it after scroll gutter adjustment.
+               // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).
+               if ( box === "margin" ) {
+                       marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
                }
 
-               if ( isBorderBox ) {
+               // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
+               if ( !isBorderBox ) {
 
-                       // border-box includes padding, so remove it if we want content
-                       if ( extra === "content" ) {
-                               val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
-                       }
+                       // Add padding
+                       delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
 
-                       // at this point, extra isn't border nor margin, so remove border
-                       if ( extra !== "margin" ) {
-                               val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+                       // For "border" or "margin", add border
+                       if ( box !== "padding" ) {
+                               delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+
+                       // But still keep track of it otherwise
+                       } else {
+                               extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
                        }
+
+               // If we get here with a border-box (content + padding + border), we're seeking "content" or
+               // "padding" or "margin"
                } else {
 
-                       // at this point, extra isn't content, so add padding
-                       val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+                       // For "content", subtract padding
+                       if ( box === "content" ) {
+                               delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+                       }
 
-                       // at this point, extra isn't content nor padding, so add border
-                       if ( extra !== "padding" ) {
-                               val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+                       // For "content" or "padding", subtract border
+                       if ( box !== "margin" ) {
+                               delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
                        }
                }
        }
 
-       return val;
+       // Account for positive content-box scroll gutter when requested by providing computedVal
+       if ( !isBorderBox && computedVal >= 0 ) {
+
+               // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
+               // Assuming integer scroll gutter, subtract the rest and round down
+               delta += Math.max( 0, Math.ceil(
+                       elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
+                       computedVal -
+                       delta -
+                       extra -
+                       0.5
+
+               // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
+               // Use an explicit zero to avoid NaN (gh-3964)
+               ) ) || 0;
+       }
+
+       return delta + marginDelta;
 }
 
-function getWidthOrHeight( elem, name, extra ) {
+function getWidthOrHeight( elem, dimension, extra ) {
 
-       // Start with offset property, which is equivalent to the border-box value
-       var valueIsBorderBox = true,
-               val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-               styles = getStyles( elem ),
-               isBorderBox = support.boxSizing &&
-                       jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+       // Start with computed style
+       var styles = getStyles( elem ),
 
-       // Support: IE11 only
-       // In IE 11 fullscreen elements inside of an iframe have
-       // 100x too small dimensions (gh-1764).
-       if ( document.msFullscreenElement && window.top !== window ) {
+               // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
+               // Fake content-box until we know it's needed to know the true value.
+               boxSizingNeeded = !support.boxSizingReliable() || extra,
+               isBorderBox = boxSizingNeeded &&
+                       jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+               valueIsBorderBox = isBorderBox,
 
-               // Support: IE11 only
-               // Running getBoundingClientRect on a disconnected node
-               // in IE throws an error.
-               if ( elem.getClientRects().length ) {
-                       val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
+               val = curCSS( elem, dimension, styles ),
+               offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
+
+       // Support: Firefox <=54
+       // Return a confounding non-pixel value or feign ignorance, as appropriate.
+       if ( rnumnonpx.test( val ) ) {
+               if ( !extra ) {
+                       return val;
                }
+               val = "auto";
        }
 
-       // some non-html elements return undefined for offsetWidth, so check for null/undefined
-       // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-       // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-       if ( val <= 0 || val == null ) {
 
-               // Fall back to computed then uncomputed css if necessary
-               val = curCSS( elem, name, styles );
-               if ( val < 0 || val == null ) {
-                       val = elem.style[ name ];
-               }
+       // Support: IE 9 - 11 only
+       // Use offsetWidth/offsetHeight for when box sizing is unreliable.
+       // In those cases, the computed value can be trusted to be border-box.
+       if ( ( !support.boxSizingReliable() && isBorderBox ||
 
-               // Computed unit is not pixels. Stop here and return.
-               if ( rnumnonpx.test( val ) ) {
-                       return val;
-               }
+               // Support: IE 10 - 11+, Edge 15 - 18+
+               // IE/Edge misreport `getComputedStyle` of table rows with width/height
+               // set in CSS while `offset*` properties report correct values.
+               // Interestingly, in some cases IE 9 doesn't suffer from this issue.
+               !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
+
+               // Fall back to offsetWidth/offsetHeight when value is "auto"
+               // This happens for inline elements with no explicit setting (gh-3571)
+               val === "auto" ||
+
+               // Support: Android <=4.1 - 4.3 only
+               // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
+               !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
+
+               // Make sure the element is visible & connected
+               elem.getClientRects().length ) {
 
-               // we need the check for style in case a browser which returns unreliable values
-               // for getComputedStyle silently falls back to the reliable elem.style
-               valueIsBorderBox = isBorderBox &&
-                       ( support.boxSizingReliable() || val === elem.style[ name ] );
+               isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
 
-               // Normalize "", auto, and prepare for extra
-               val = parseFloat( val ) || 0;
+               // Where available, offsetWidth/offsetHeight approximate border box dimensions.
+               // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
+               // retrieved value as a content box dimension.
+               valueIsBorderBox = offsetProp in elem;
+               if ( valueIsBorderBox ) {
+                       val = elem[ offsetProp ];
+               }
        }
 
-       // use the active box-sizing model to add/subtract irrelevant styles
+       // Normalize "" and auto
+       val = parseFloat( val ) || 0;
+
+       // Adjust for the element's box model
        return ( val +
-               augmentWidthOrHeight(
+               boxModelAdjustment(
                        elem,
-                       name,
+                       dimension,
                        extra || ( isBorderBox ? "border" : "content" ),
                        valueIsBorderBox,
-                       styles
+                       styles,
+
+                       // Provide the current computed size to request scroll gutter calculation (gh-3589)
+                       val
                )
        ) + "px";
 }
@@ -7063,28 +6742,40 @@ jQuery.extend( {
 
        // Don't automatically add "px" to these possibly-unitless properties
        cssNumber: {
-               "animationIterationCount": true,
-               "columnCount": true,
-               "fillOpacity": true,
-               "flexGrow": true,
-               "flexShrink": true,
-               "fontWeight": true,
-               "lineHeight": true,
-               "opacity": true,
-               "order": true,
-               "orphans": true,
-               "widows": true,
-               "zIndex": true,
-               "zoom": true
+               animationIterationCount: true,
+               aspectRatio: true,
+               borderImageSlice: true,
+               columnCount: true,
+               flexGrow: true,
+               flexShrink: true,
+               fontWeight: true,
+               gridArea: true,
+               gridColumn: true,
+               gridColumnEnd: true,
+               gridColumnStart: true,
+               gridRow: true,
+               gridRowEnd: true,
+               gridRowStart: true,
+               lineHeight: true,
+               opacity: true,
+               order: true,
+               orphans: true,
+               scale: true,
+               widows: true,
+               zIndex: true,
+               zoom: true,
+
+               // SVG-related
+               fillOpacity: true,
+               floodOpacity: true,
+               stopOpacity: true,
+               strokeMiterlimit: true,
+               strokeOpacity: true
        },
 
        // Add in properties whose names you wish to fix before
        // setting or getting the value
-       cssProps: {
-
-               // normalize float css property
-               "float": support.cssFloat ? "cssFloat" : "styleFloat"
-       },
+       cssProps: {},
 
        // Get and set the style property on a DOM Node
        style: function( elem, name, value, extra ) {
@@ -7096,41 +6787,45 @@ jQuery.extend( {
 
                // Make sure that we're working with the right name
                var ret, type, hooks,
-                       origName = jQuery.camelCase( name ),
+                       origName = camelCase( name ),
+                       isCustomProp = rcustomProp.test( name ),
                        style = elem.style;
 
-               name = jQuery.cssProps[ origName ] ||
-                       ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
+               // Make sure that we're working with the right name. We don't
+               // want to query the value if it is a CSS custom property
+               // since they are user-defined.
+               if ( !isCustomProp ) {
+                       name = finalPropName( origName );
+               }
 
-               // gets hook for the prefixed version
-               // followed by the unprefixed version
+               // Gets hook for the prefixed version, then unprefixed version
                hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
 
                // Check if we're setting a value
                if ( value !== undefined ) {
                        type = typeof value;
 
-                       // Convert "+=" or "-=" to relative numbers (#7345)
+                       // Convert "+=" or "-=" to relative numbers (trac-7345)
                        if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
                                value = adjustCSS( elem, name, ret );
 
-                               // Fixes bug #9237
+                               // Fixes bug trac-9237
                                type = "number";
                        }
 
-                       // Make sure that null and NaN values aren't set. See: #7116
+                       // Make sure that null and NaN values aren't set (trac-7116)
                        if ( value == null || value !== value ) {
                                return;
                        }
 
                        // If a number was passed in, add the unit (except for certain CSS properties)
-                       if ( type === "number" ) {
+                       // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
+                       // "px" to a few hardcoded values.
+                       if ( type === "number" && !isCustomProp ) {
                                value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
                        }
 
-                       // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
-                       // but it would mean to define eight
-                       // (for every problematic property) identical functions
+                       // background-* props affect original clone's values
                        if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
                                style[ name ] = "inherit";
                        }
@@ -7139,11 +6834,11 @@ jQuery.extend( {
                        if ( !hooks || !( "set" in hooks ) ||
                                ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
 
-                               // Support: IE
-                               // Swallow errors from 'invalid' CSS values (#5509)
-                               try {
+                               if ( isCustomProp ) {
+                                       style.setProperty( name, value );
+                               } else {
                                        style[ name ] = value;
-                               } catch ( e ) {}
+                               }
                        }
 
                } else {
@@ -7161,15 +6856,18 @@ jQuery.extend( {
        },
 
        css: function( elem, name, extra, styles ) {
-               var num, val, hooks,
-                       origName = jQuery.camelCase( name );
+               var val, num, hooks,
+                       origName = camelCase( name ),
+                       isCustomProp = rcustomProp.test( name );
 
-               // Make sure that we're working with the right name
-               name = jQuery.cssProps[ origName ] ||
-                       ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
+               // Make sure that we're working with the right name. We don't
+               // want to modify the value if it is a CSS custom property
+               // since they are user-defined.
+               if ( !isCustomProp ) {
+                       name = finalPropName( origName );
+               }
 
-               // gets hook for the prefixed version
-               // followed by the unprefixed version
+               // Try prefixed name followed by the unprefixed name
                hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
 
                // If a hook was provided get the computed value from there
@@ -7182,127 +6880,99 @@ jQuery.extend( {
                        val = curCSS( elem, name, styles );
                }
 
-               //convert "normal" to computed value
+               // Convert "normal" to computed value
                if ( val === "normal" && name in cssNormalTransform ) {
                        val = cssNormalTransform[ name ];
                }
 
-               // Return, converting to number if forced or a qualifier was provided and val looks numeric
+               // Make numeric if forced or a qualifier was provided and val looks numeric
                if ( extra === "" || extra ) {
                        num = parseFloat( val );
                        return extra === true || isFinite( num ) ? num || 0 : val;
                }
+
                return val;
        }
 } );
 
-jQuery.each( [ "height", "width" ], function( i, name ) {
-       jQuery.cssHooks[ name ] = {
+jQuery.each( [ "height", "width" ], function( _i, dimension ) {
+       jQuery.cssHooks[ dimension ] = {
                get: function( elem, computed, extra ) {
                        if ( computed ) {
 
-                               // certain elements can have dimension info if we invisibly show them
-                               // however, it must have a current display style that would benefit from this
+                               // Certain elements can have dimension info if we invisibly show them
+                               // but it must have a current display style that would benefit
                                return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
-                                       elem.offsetWidth === 0 ?
-                                               swap( elem, cssShow, function() {
-                                                       return getWidthOrHeight( elem, name, extra );
-                                               } ) :
-                                               getWidthOrHeight( elem, name, extra );
+
+                                       // Support: Safari 8+
+                                       // Table columns in Safari have non-zero offsetWidth & zero
+                                       // getBoundingClientRect().width unless display is changed.
+                                       // Support: IE <=11 only
+                                       // Running getBoundingClientRect on a disconnected node
+                                       // in IE throws an error.
+                                       ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
+                                       swap( elem, cssShow, function() {
+                                               return getWidthOrHeight( elem, dimension, extra );
+                                       } ) :
+                                       getWidthOrHeight( elem, dimension, extra );
                        }
                },
 
                set: function( elem, value, extra ) {
-                       var styles = extra && getStyles( elem );
-                       return setPositiveNumber( elem, value, extra ?
-                               augmentWidthOrHeight(
-                                       elem,
-                                       name,
-                                       extra,
-                                       support.boxSizing &&
-                                               jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
-                                       styles
-                               ) : 0
-                       );
-               }
-       };
-} );
-
-if ( !support.opacity ) {
-       jQuery.cssHooks.opacity = {
-               get: function( elem, computed ) {
-
-                       // IE uses filters for opacity
-                       return ropacity.test( ( computed && elem.currentStyle ?
-                               elem.currentStyle.filter :
-                               elem.style.filter ) || "" ) ?
-                                       ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
-                                       computed ? "1" : "";
-               },
-
-               set: function( elem, value ) {
-                       var style = elem.style,
-                               currentStyle = elem.currentStyle,
-                               opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-                               filter = currentStyle && currentStyle.filter || style.filter || "";
-
-                       // IE has trouble with opacity if it does not have layout
-                       // Force it by setting the zoom level
-                       style.zoom = 1;
-
-                       // if setting opacity to 1, and no other filters exist -
-                       // attempt to remove filter attribute #6652
-                       // if value === "", then remove inline opacity #12685
-                       if ( ( value >= 1 || value === "" ) &&
-                                       jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
-                                       style.removeAttribute ) {
+                       var matches,
+                               styles = getStyles( elem ),
+
+                               // Only read styles.position if the test has a chance to fail
+                               // to avoid forcing a reflow.
+                               scrollboxSizeBuggy = !support.scrollboxSize() &&
+                                       styles.position === "absolute",
+
+                               // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
+                               boxSizingNeeded = scrollboxSizeBuggy || extra,
+                               isBorderBox = boxSizingNeeded &&
+                                       jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+                               subtract = extra ?
+                                       boxModelAdjustment(
+                                               elem,
+                                               dimension,
+                                               extra,
+                                               isBorderBox,
+                                               styles
+                                       ) :
+                                       0;
+
+                       // Account for unreliable border-box dimensions by comparing offset* to computed and
+                       // faking a content-box to get border and padding (gh-3699)
+                       if ( isBorderBox && scrollboxSizeBuggy ) {
+                               subtract -= Math.ceil(
+                                       elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
+                                       parseFloat( styles[ dimension ] ) -
+                                       boxModelAdjustment( elem, dimension, "border", false, styles ) -
+                                       0.5
+                               );
+                       }
 
-                               // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-                               // if "filter:" is present at all, clearType is disabled, we want to avoid this
-                               // style.removeAttribute is IE Only, but so apparently is this code path...
-                               style.removeAttribute( "filter" );
+                       // Convert to pixels if value adjustment is needed
+                       if ( subtract && ( matches = rcssNum.exec( value ) ) &&
+                               ( matches[ 3 ] || "px" ) !== "px" ) {
 
-                               // if there is no filter style applied in a css rule
-                               // or unset inline opacity, we are done
-                               if ( value === "" || currentStyle && !currentStyle.filter ) {
-                                       return;
-                               }
+                               elem.style[ dimension ] = value;
+                               value = jQuery.css( elem, dimension );
                        }
 
-                       // otherwise, set new filter values
-                       style.filter = ralpha.test( filter ) ?
-                               filter.replace( ralpha, opacity ) :
-                               filter + " " + opacity;
+                       return setPositiveNumber( elem, value, subtract );
                }
        };
-}
-
-jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
-       function( elem, computed ) {
-               if ( computed ) {
-                       return swap( elem, { "display": "inline-block" },
-                               curCSS, [ elem, "marginRight" ] );
-               }
-       }
-);
+} );
 
 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
        function( elem, computed ) {
                if ( computed ) {
-                       return (
-                               parseFloat( curCSS( elem, "marginLeft" ) ) ||
-
-                               // Support: IE<=11+
-                               // Running getBoundingClientRect on a disconnected node in IE throws an error
-                               // Support: IE8 only
-                               // getClientRects() errors on disconnected elems
-                               ( jQuery.contains( elem.ownerDocument, elem ) ?
-                                       elem.getBoundingClientRect().left -
-                                               swap( elem, { marginLeft: 0 }, function() {
-                                                       return elem.getBoundingClientRect().left;
-                                               } ) :
-                                       0
-                               )
+                       return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
+                               elem.getBoundingClientRect().left -
+                                       swap( elem, { marginLeft: 0 }, function() {
+                                               return elem.getBoundingClientRect().left;
+                                       } )
                        ) + "px";
                }
        }
@@ -7319,7 +6989,7 @@ jQuery.each( {
                        var i = 0,
                                expanded = {},
 
-                               // assumes a single number if not a string
+                               // Assumes a single number if not a string
                                parts = typeof value === "string" ? value.split( " " ) : [ value ];
 
                        for ( ; i < 4; i++ ) {
@@ -7331,7 +7001,7 @@ jQuery.each( {
                }
        };
 
-       if ( !rmargin.test( prefix ) ) {
+       if ( prefix !== "margin" ) {
                jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
        }
 } );
@@ -7343,7 +7013,7 @@ jQuery.fn.extend( {
                                map = {},
                                i = 0;
 
-                       if ( jQuery.isArray( name ) ) {
+                       if ( Array.isArray( name ) ) {
                                styles = getStyles( elem );
                                len = name.length;
 
@@ -7358,25 +7028,6 @@ jQuery.fn.extend( {
                                jQuery.style( elem, name, value ) :
                                jQuery.css( elem, name );
                }, name, value, arguments.length > 1 );
-       },
-       show: function() {
-               return showHide( this, true );
-       },
-       hide: function() {
-               return showHide( this );
-       },
-       toggle: function( state ) {
-               if ( typeof state === "boolean" ) {
-                       return state ? this.show() : this.hide();
-               }
-
-               return this.each( function() {
-                       if ( isHidden( this ) ) {
-                               jQuery( this ).show();
-                       } else {
-                               jQuery( this ).hide();
-                       }
-               } );
        }
 } );
 
@@ -7444,10 +7095,10 @@ Tween.propHooks = {
                                return tween.elem[ tween.prop ];
                        }
 
-                       // passing an empty string as a 3rd parameter to .css will automatically
-                       // attempt a parseFloat and fallback to a string if the parse fails
-                       // so, simple values such as "10px" are parsed to Float.
-                       // complex values such as "rotate(1rad)" are returned as is.
+                       // Passing an empty string as a 3rd parameter to .css will automatically
+                       // attempt a parseFloat and fallback to a string if the parse fails.
+                       // Simple values such as "10px" are parsed to Float;
+                       // complex values such as "rotate(1rad)" are returned as-is.
                        result = jQuery.css( tween.elem, tween.prop, "" );
 
                        // Empty strings, null, undefined and "auto" are converted to 0.
@@ -7455,13 +7106,14 @@ Tween.propHooks = {
                },
                set: function( tween ) {
 
-                       // use step hook for back compat - use cssHook if its there - use .style if its
-                       // available and use plain properties where available
+                       // Use step hook for back compat.
+                       // Use cssHook if its there.
+                       // Use .style if available and use plain properties where available.
                        if ( jQuery.fx.step[ tween.prop ] ) {
                                jQuery.fx.step[ tween.prop ]( tween );
-                       } else if ( tween.elem.nodeType === 1 &&
-                               ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
-                                       jQuery.cssHooks[ tween.prop ] ) ) {
+                       } else if ( tween.elem.nodeType === 1 && (
+                               jQuery.cssHooks[ tween.prop ] ||
+                                       tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
                                jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
                        } else {
                                tween.elem[ tween.prop ] = tween.now;
@@ -7470,9 +7122,8 @@ Tween.propHooks = {
        }
 };
 
-// Support: IE <=9
+// Support: IE <=9 only
 // Panic based approach to setting things on disconnected nodes
-
 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
        set: function( tween ) {
                if ( tween.elem.nodeType && tween.elem.parentNode ) {
@@ -7493,35 +7144,47 @@ jQuery.easing = {
 
 jQuery.fx = Tween.prototype.init;
 
-// Back Compat <1.8 extension point
+// Back compat <1.8 extension point
 jQuery.fx.step = {};
 
 
 
 
 var
-       fxNow, timerId,
+       fxNow, inProgress,
        rfxtypes = /^(?:toggle|show|hide)$/,
        rrun = /queueHooks$/;
 
-// Animations created synchronously will run synchronously
-function createFxNow() {
-       window.setTimeout( function() {
-               fxNow = undefined;
+function schedule() {
+       if ( inProgress ) {
+               if ( document.hidden === false && window.requestAnimationFrame ) {
+                       window.requestAnimationFrame( schedule );
+               } else {
+                       window.setTimeout( schedule, jQuery.fx.interval );
+               }
+
+               jQuery.fx.tick();
+       }
+}
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+       window.setTimeout( function() {
+               fxNow = undefined;
        } );
-       return ( fxNow = jQuery.now() );
+       return ( fxNow = Date.now() );
 }
 
 // Generate parameters to create a standard animation
 function genFx( type, includeWidth ) {
        var which,
-               attrs = { height: type },
-               i = 0;
+               i = 0,
+               attrs = { height: type };
 
-       // if we include width, step value is 1 to do all cssExpand values,
-       // if we don't include width, step value is 2 to skip over Left and Right
+       // If we include width, step value is 1 to do all cssExpand values,
+       // otherwise step value is 2 to skip over Left and Right
        includeWidth = includeWidth ? 1 : 0;
-       for ( ; i < 4 ; i += 2 - includeWidth ) {
+       for ( ; i < 4; i += 2 - includeWidth ) {
                which = cssExpand[ i ];
                attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
        }
@@ -7541,22 +7204,22 @@ function createTween( value, prop, animation ) {
        for ( ; index < length; index++ ) {
                if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
 
-                       // we're done with this property
+                       // We're done with this property
                        return tween;
                }
        }
 }
 
 function defaultPrefilter( elem, props, opts ) {
-       /* jshint validthis: true */
-       var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+       var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
+               isBox = "width" in props || "height" in props,
                anim = this,
                orig = {},
                style = elem.style,
-               hidden = elem.nodeType && isHidden( elem ),
-               dataShow = jQuery._data( elem, "fxshow" );
+               hidden = elem.nodeType && isHiddenWithinTree( elem ),
+               dataShow = dataPriv.get( elem, "fxshow" );
 
-       // handle queue: false promises
+       // Queue-skipping animations hijack the fx hooks
        if ( !opts.queue ) {
                hooks = jQuery._queueHooks( elem, "fx" );
                if ( hooks.unqueued == null ) {
@@ -7572,8 +7235,7 @@ function defaultPrefilter( elem, props, opts ) {
 
                anim.always( function() {
 
-                       // doing this makes sure that the complete handler will be called
-                       // before this completes
+                       // Ensure the complete handler is called before this completes
                        anim.always( function() {
                                hooks.unqueued--;
                                if ( !jQuery.queue( elem, "fx" ).length ) {
@@ -7583,112 +7245,140 @@ function defaultPrefilter( elem, props, opts ) {
                } );
        }
 
-       // height/width overflow pass
-       if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+       // Detect show/hide animations
+       for ( prop in props ) {
+               value = props[ prop ];
+               if ( rfxtypes.test( value ) ) {
+                       delete props[ prop ];
+                       toggle = toggle || value === "toggle";
+                       if ( value === ( hidden ? "hide" : "show" ) ) {
+
+                               // Pretend to be hidden if this is a "show" and
+                               // there is still data from a stopped show/hide
+                               if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+                                       hidden = true;
+
+                               // Ignore all other no-op show/hide data
+                               } else {
+                                       continue;
+                               }
+                       }
+                       orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+               }
+       }
+
+       // Bail out if this is a no-op like .hide().hide()
+       propTween = !jQuery.isEmptyObject( props );
+       if ( !propTween && jQuery.isEmptyObject( orig ) ) {
+               return;
+       }
+
+       // Restrict "overflow" and "display" styles during box animations
+       if ( isBox && elem.nodeType === 1 ) {
 
-               // Make sure that nothing sneaks out
-               // Record all 3 overflow attributes because IE does not
-               // change the overflow attribute when overflowX and
-               // overflowY are set to the same value
+               // Support: IE <=9 - 11, Edge 12 - 15
+               // Record all 3 overflow attributes because IE does not infer the shorthand
+               // from identically-valued overflowX and overflowY and Edge just mirrors
+               // the overflowX value there.
                opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
 
-               // Set display property to inline-block for height/width
-               // animations on inline elements that are having width/height animated
+               // Identify a display type, preferring old show/hide data over the CSS cascade
+               restoreDisplay = dataShow && dataShow.display;
+               if ( restoreDisplay == null ) {
+                       restoreDisplay = dataPriv.get( elem, "display" );
+               }
                display = jQuery.css( elem, "display" );
+               if ( display === "none" ) {
+                       if ( restoreDisplay ) {
+                               display = restoreDisplay;
+                       } else {
 
-               // Test default display if display is currently "none"
-               checkDisplay = display === "none" ?
-                       jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
+                               // Get nonempty value(s) by temporarily forcing visibility
+                               showHide( [ elem ], true );
+                               restoreDisplay = elem.style.display || restoreDisplay;
+                               display = jQuery.css( elem, "display" );
+                               showHide( [ elem ] );
+                       }
+               }
 
-               if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
+               // Animate inline elements as inline-block
+               if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
+                       if ( jQuery.css( elem, "float" ) === "none" ) {
 
-                       // inline-level elements accept inline-block;
-                       // block-level elements need to be inline with layout
-                       if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
+                               // Restore the original display value at the end of pure show/hide animations
+                               if ( !propTween ) {
+                                       anim.done( function() {
+                                               style.display = restoreDisplay;
+                                       } );
+                                       if ( restoreDisplay == null ) {
+                                               display = style.display;
+                                               restoreDisplay = display === "none" ? "" : display;
+                                       }
+                               }
                                style.display = "inline-block";
-                       } else {
-                               style.zoom = 1;
                        }
                }
        }
 
        if ( opts.overflow ) {
                style.overflow = "hidden";
-               if ( !support.shrinkWrapBlocks() ) {
-                       anim.always( function() {
-                               style.overflow = opts.overflow[ 0 ];
-                               style.overflowX = opts.overflow[ 1 ];
-                               style.overflowY = opts.overflow[ 2 ];
-                       } );
-               }
+               anim.always( function() {
+                       style.overflow = opts.overflow[ 0 ];
+                       style.overflowX = opts.overflow[ 1 ];
+                       style.overflowY = opts.overflow[ 2 ];
+               } );
        }
 
-       // show/hide pass
-       for ( prop in props ) {
-               value = props[ prop ];
-               if ( rfxtypes.exec( value ) ) {
-                       delete props[ prop ];
-                       toggle = toggle || value === "toggle";
-                       if ( value === ( hidden ? "hide" : "show" ) ) {
+       // Implement show/hide animations
+       propTween = false;
+       for ( prop in orig ) {
 
-                               // If there is dataShow left over from a stopped hide or show
-                               // and we are going to proceed with show, we should pretend to be hidden
-                               if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
-                                       hidden = true;
-                               } else {
-                                       continue;
+               // General show/hide setup for this element animation
+               if ( !propTween ) {
+                       if ( dataShow ) {
+                               if ( "hidden" in dataShow ) {
+                                       hidden = dataShow.hidden;
                                }
+                       } else {
+                               dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
                        }
-                       orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
 
-               // Any non-fx value stops us from restoring the original display value
-               } else {
-                       display = undefined;
-               }
-       }
+                       // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
+                       if ( toggle ) {
+                               dataShow.hidden = !hidden;
+                       }
 
-       if ( !jQuery.isEmptyObject( orig ) ) {
-               if ( dataShow ) {
-                       if ( "hidden" in dataShow ) {
-                               hidden = dataShow.hidden;
+                       // Show elements before animating them
+                       if ( hidden ) {
+                               showHide( [ elem ], true );
                        }
-               } else {
-                       dataShow = jQuery._data( elem, "fxshow", {} );
-               }
 
-               // store state if its toggle - enables .stop().toggle() to "reverse"
-               if ( toggle ) {
-                       dataShow.hidden = !hidden;
-               }
-               if ( hidden ) {
-                       jQuery( elem ).show();
-               } else {
+                       /* eslint-disable no-loop-func */
+
                        anim.done( function() {
-                               jQuery( elem ).hide();
+
+                               /* eslint-enable no-loop-func */
+
+                               // The final step of a "hide" animation is actually hiding the element
+                               if ( !hidden ) {
+                                       showHide( [ elem ] );
+                               }
+                               dataPriv.remove( elem, "fxshow" );
+                               for ( prop in orig ) {
+                                       jQuery.style( elem, prop, orig[ prop ] );
+                               }
                        } );
                }
-               anim.done( function() {
-                       var prop;
-                       jQuery._removeData( elem, "fxshow" );
-                       for ( prop in orig ) {
-                               jQuery.style( elem, prop, orig[ prop ] );
-                       }
-               } );
-               for ( prop in orig ) {
-                       tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
 
-                       if ( !( prop in dataShow ) ) {
-                               dataShow[ prop ] = tween.start;
-                               if ( hidden ) {
-                                       tween.end = tween.start;
-                                       tween.start = prop === "width" || prop === "height" ? 1 : 0;
-                               }
+               // Per-property setup
+               propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+               if ( !( prop in dataShow ) ) {
+                       dataShow[ prop ] = propTween.start;
+                       if ( hidden ) {
+                               propTween.end = propTween.start;
+                               propTween.start = 0;
                        }
                }
-
-       // If this is a noop like .hide().hide(), restore an overwritten display value
-       } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
-               style.display = display;
        }
 }
 
@@ -7697,10 +7387,10 @@ function propFilter( props, specialEasing ) {
 
        // camelCase, specialEasing and expand cssHook pass
        for ( index in props ) {
-               name = jQuery.camelCase( index );
+               name = camelCase( index );
                easing = specialEasing[ name ];
                value = props[ index ];
-               if ( jQuery.isArray( value ) ) {
+               if ( Array.isArray( value ) ) {
                        easing = value[ 1 ];
                        value = props[ index ] = value[ 0 ];
                }
@@ -7715,8 +7405,8 @@ function propFilter( props, specialEasing ) {
                        value = hooks.expand( value );
                        delete props[ name ];
 
-                       // not quite $.extend, this wont overwrite keys already present.
-                       // also - reusing 'index' from above because we have the correct "name"
+                       // Not quite $.extend, this won't overwrite existing keys.
+                       // Reusing 'index' because we have the correct "name"
                        for ( index in value ) {
                                if ( !( index in props ) ) {
                                        props[ index ] = value[ index ];
@@ -7736,7 +7426,7 @@ function Animation( elem, properties, options ) {
                length = Animation.prefilters.length,
                deferred = jQuery.Deferred().always( function() {
 
-                       // don't match elem in the :animated selector
+                       // Don't match elem in the :animated selector
                        delete tick.elem;
                } ),
                tick = function() {
@@ -7746,25 +7436,32 @@ function Animation( elem, properties, options ) {
                        var currentTime = fxNow || createFxNow(),
                                remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
 
-                               // Support: Android 2.3
-                               // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
+                               // Support: Android 2.3 only
+                               // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)
                                temp = remaining / animation.duration || 0,
                                percent = 1 - temp,
                                index = 0,
                                length = animation.tweens.length;
 
-                       for ( ; index < length ; index++ ) {
+                       for ( ; index < length; index++ ) {
                                animation.tweens[ index ].run( percent );
                        }
 
                        deferred.notifyWith( elem, [ animation, percent, remaining ] );
 
+                       // If there's more to do, yield
                        if ( percent < 1 && length ) {
                                return remaining;
-                       } else {
-                               deferred.resolveWith( elem, [ animation ] );
-                               return false;
                        }
+
+                       // If this was an empty animation, synthesize a final progress notification
+                       if ( !length ) {
+                               deferred.notifyWith( elem, [ animation, 1, 0 ] );
+                       }
+
+                       // Resolve the animation and report its conclusion
+                       deferred.resolveWith( elem, [ animation ] );
+                       return false;
                },
                animation = deferred.promise( {
                        elem: elem,
@@ -7780,26 +7477,25 @@ function Animation( elem, properties, options ) {
                        tweens: [],
                        createTween: function( prop, end ) {
                                var tween = jQuery.Tween( elem, animation.opts, prop, end,
-                                               animation.opts.specialEasing[ prop ] || animation.opts.easing );
+                                       animation.opts.specialEasing[ prop ] || animation.opts.easing );
                                animation.tweens.push( tween );
                                return tween;
                        },
                        stop: function( gotoEnd ) {
                                var index = 0,
 
-                                       // if we are going to the end, we want to run all the tweens
+                                       // If we are going to the end, we want to run all the tweens
                                        // otherwise we skip this part
                                        length = gotoEnd ? animation.tweens.length : 0;
                                if ( stopped ) {
                                        return this;
                                }
                                stopped = true;
-                               for ( ; index < length ; index++ ) {
+                               for ( ; index < length; index++ ) {
                                        animation.tweens[ index ].run( 1 );
                                }
 
-                               // resolve when we played the last frame
-                               // otherwise, reject
+                               // Resolve when we played the last frame; otherwise, reject
                                if ( gotoEnd ) {
                                        deferred.notifyWith( elem, [ animation, 1, 0 ] );
                                        deferred.resolveWith( elem, [ animation, gotoEnd ] );
@@ -7813,12 +7509,12 @@ function Animation( elem, properties, options ) {
 
        propFilter( props, animation.opts.specialEasing );
 
-       for ( ; index < length ; index++ ) {
+       for ( ; index < length; index++ ) {
                result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
                if ( result ) {
-                       if ( jQuery.isFunction( result.stop ) ) {
+                       if ( isFunction( result.stop ) ) {
                                jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
-                                       jQuery.proxy( result.stop, result );
+                                       result.stop.bind( result );
                        }
                        return result;
                }
@@ -7826,10 +7522,17 @@ function Animation( elem, properties, options ) {
 
        jQuery.map( props, createTween, animation );
 
-       if ( jQuery.isFunction( animation.opts.start ) ) {
+       if ( isFunction( animation.opts.start ) ) {
                animation.opts.start.call( elem, animation );
        }
 
+       // Attach callbacks from options
+       animation
+               .progress( animation.opts.progress )
+               .done( animation.opts.done, animation.opts.complete )
+               .fail( animation.opts.fail )
+               .always( animation.opts.always );
+
        jQuery.fx.timer(
                jQuery.extend( tick, {
                        elem: elem,
@@ -7838,11 +7541,7 @@ function Animation( elem, properties, options ) {
                } )
        );
 
-       // attach callbacks from options
-       return animation.progress( animation.opts.progress )
-               .done( animation.opts.done, animation.opts.complete )
-               .fail( animation.opts.fail )
-               .always( animation.opts.always );
+       return animation;
 }
 
 jQuery.Animation = jQuery.extend( Animation, {
@@ -7856,18 +7555,18 @@ jQuery.Animation = jQuery.extend( Animation, {
        },
 
        tweener: function( props, callback ) {
-               if ( jQuery.isFunction( props ) ) {
+               if ( isFunction( props ) ) {
                        callback = props;
                        props = [ "*" ];
                } else {
-                       props = props.match( rnotwhite );
+                       props = props.match( rnothtmlwhite );
                }
 
                var prop,
                        index = 0,
                        length = props.length;
 
-               for ( ; index < length ; index++ ) {
+               for ( ; index < length; index++ ) {
                        prop = props[ index ];
                        Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
                        Animation.tweeners[ prop ].unshift( callback );
@@ -7888,16 +7587,27 @@ jQuery.Animation = jQuery.extend( Animation, {
 jQuery.speed = function( speed, easing, fn ) {
        var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
                complete: fn || !fn && easing ||
-                       jQuery.isFunction( speed ) && speed,
+                       isFunction( speed ) && speed,
                duration: speed,
-               easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+               easing: fn && easing || easing && !isFunction( easing ) && easing
        };
 
-       opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-               opt.duration in jQuery.fx.speeds ?
-                       jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+       // Go to the end state if fx are off
+       if ( jQuery.fx.off ) {
+               opt.duration = 0;
+
+       } else {
+               if ( typeof opt.duration !== "number" ) {
+                       if ( opt.duration in jQuery.fx.speeds ) {
+                               opt.duration = jQuery.fx.speeds[ opt.duration ];
+
+                       } else {
+                               opt.duration = jQuery.fx.speeds._default;
+                       }
+               }
+       }
 
-       // normalize opt.queue - true/undefined/null -> "fx"
+       // Normalize opt.queue - true/undefined/null -> "fx"
        if ( opt.queue == null || opt.queue === true ) {
                opt.queue = "fx";
        }
@@ -7906,7 +7616,7 @@ jQuery.speed = function( speed, easing, fn ) {
        opt.old = opt.complete;
 
        opt.complete = function() {
-               if ( jQuery.isFunction( opt.old ) ) {
+               if ( isFunction( opt.old ) ) {
                        opt.old.call( this );
                }
 
@@ -7921,10 +7631,10 @@ jQuery.speed = function( speed, easing, fn ) {
 jQuery.fn.extend( {
        fadeTo: function( speed, to, easing, callback ) {
 
-               // show any hidden elements after setting opacity to 0
-               return this.filter( isHidden ).css( "opacity", 0 ).show()
+               // Show any hidden elements after setting opacity to 0
+               return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
 
-                       // animate to the value specified
+                       // Animate to the value specified
                        .end().animate( { opacity: to }, speed, easing, callback );
        },
        animate: function( prop, speed, easing, callback ) {
@@ -7936,11 +7646,12 @@ jQuery.fn.extend( {
                                var anim = Animation( this, jQuery.extend( {}, prop ), optall );
 
                                // Empty animations, or finishing resolves immediately
-                               if ( empty || jQuery._data( this, "finish" ) ) {
+                               if ( empty || dataPriv.get( this, "finish" ) ) {
                                        anim.stop( true );
                                }
                        };
-                       doAnimation.finish = doAnimation;
+
+               doAnimation.finish = doAnimation;
 
                return empty || optall.queue === false ?
                        this.each( doAnimation ) :
@@ -7958,7 +7669,7 @@ jQuery.fn.extend( {
                        clearQueue = type;
                        type = undefined;
                }
-               if ( clearQueue && type !== false ) {
+               if ( clearQueue ) {
                        this.queue( type || "fx", [] );
                }
 
@@ -7966,7 +7677,7 @@ jQuery.fn.extend( {
                        var dequeue = true,
                                index = type != null && type + "queueHooks",
                                timers = jQuery.timers,
-                               data = jQuery._data( this );
+                               data = dataPriv.get( this );
 
                        if ( index ) {
                                if ( data[ index ] && data[ index ].stop ) {
@@ -7990,9 +7701,9 @@ jQuery.fn.extend( {
                                }
                        }
 
-                       // start the next in the queue if the last step wasn't forced
-                       // timers currently will call their complete callbacks, which will dequeue
-                       // but only if they were gotoEnd
+                       // Start the next in the queue if the last step wasn't forced.
+                       // Timers currently will call their complete callbacks, which
+                       // will dequeue but only if they were gotoEnd.
                        if ( dequeue || !gotoEnd ) {
                                jQuery.dequeue( this, type );
                        }
@@ -8004,23 +7715,23 @@ jQuery.fn.extend( {
                }
                return this.each( function() {
                        var index,
-                               data = jQuery._data( this ),
+                               data = dataPriv.get( this ),
                                queue = data[ type + "queue" ],
                                hooks = data[ type + "queueHooks" ],
                                timers = jQuery.timers,
                                length = queue ? queue.length : 0;
 
-                       // enable finishing flag on private data
+                       // Enable finishing flag on private data
                        data.finish = true;
 
-                       // empty the queue first
+                       // Empty the queue first
                        jQuery.queue( this, type, [] );
 
                        if ( hooks && hooks.stop ) {
                                hooks.stop.call( this, true );
                        }
 
-                       // look for any active animations, and finish them
+                       // Look for any active animations, and finish them
                        for ( index = timers.length; index--; ) {
                                if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
                                        timers[ index ].anim.stop( true );
@@ -8028,20 +7739,20 @@ jQuery.fn.extend( {
                                }
                        }
 
-                       // look for any animations in the old queue and finish them
+                       // Look for any animations in the old queue and finish them
                        for ( index = 0; index < length; index++ ) {
                                if ( queue[ index ] && queue[ index ].finish ) {
                                        queue[ index ].finish.call( this );
                                }
                        }
 
-                       // turn off finishing flag
+                       // Turn off finishing flag
                        delete data.finish;
                } );
        }
 } );
 
-jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
+jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
        var cssFn = jQuery.fn[ name ];
        jQuery.fn[ name ] = function( speed, easing, callback ) {
                return speed == null || typeof speed === "boolean" ?
@@ -8067,15 +7778,15 @@ jQuery.each( {
 jQuery.timers = [];
 jQuery.fx.tick = function() {
        var timer,
-               timers = jQuery.timers,
-               i = 0;
+               i = 0,
+               timers = jQuery.timers;
 
-       fxNow = jQuery.now();
+       fxNow = Date.now();
 
        for ( ; i < timers.length; i++ ) {
                timer = timers[ i ];
 
-               // Checks the timer has not already been removed
+               // Run the timer and safely remove it when done (allowing for external removal)
                if ( !timer() && timers[ i ] === timer ) {
                        timers.splice( i--, 1 );
                }
@@ -8089,24 +7800,21 @@ jQuery.fx.tick = function() {
 
 jQuery.fx.timer = function( timer ) {
        jQuery.timers.push( timer );
-       if ( timer() ) {
-               jQuery.fx.start();
-       } else {
-               jQuery.timers.pop();
-       }
+       jQuery.fx.start();
 };
 
 jQuery.fx.interval = 13;
-
 jQuery.fx.start = function() {
-       if ( !timerId ) {
-               timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
+       if ( inProgress ) {
+               return;
        }
+
+       inProgress = true;
+       schedule();
 };
 
 jQuery.fx.stop = function() {
-       window.clearInterval( timerId );
-       timerId = null;
+       inProgress = null;
 };
 
 jQuery.fx.speeds = {
@@ -8119,7 +7827,6 @@ jQuery.fx.speeds = {
 
 
 // Based off of the plugin by Clint Helfers, with permission.
-// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
 jQuery.fn.delay = function( time, type ) {
        time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
        type = type || "fx";
@@ -8134,527 +7841,162 @@ jQuery.fn.delay = function( time, type ) {
 
 
 ( function() {
-       var a,
-               input = document.createElement( "input" ),
-               div = document.createElement( "div" ),
+       var input = document.createElement( "input" ),
                select = document.createElement( "select" ),
                opt = select.appendChild( document.createElement( "option" ) );
 
-       // Setup
-       div = document.createElement( "div" );
-       div.setAttribute( "className", "t" );
-       div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-       a = div.getElementsByTagName( "a" )[ 0 ];
-
-       // Support: Windows Web Apps (WWA)
-       // `type` must use .setAttribute for WWA (#14901)
-       input.setAttribute( "type", "checkbox" );
-       div.appendChild( input );
-
-       a = div.getElementsByTagName( "a" )[ 0 ];
-
-       // First batch of tests.
-       a.style.cssText = "top:1px";
-
-       // Test setAttribute on camelCase class.
-       // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-       support.getSetAttribute = div.className !== "t";
-
-       // Get the style information from getAttribute
-       // (IE uses .cssText instead)
-       support.style = /top/.test( a.getAttribute( "style" ) );
-
-       // Make sure that URLs aren't manipulated
-       // (IE normalizes it by default)
-       support.hrefNormalized = a.getAttribute( "href" ) === "/a";
+       input.type = "checkbox";
 
-       // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
-       support.checkOn = !!input.value;
+       // Support: Android <=4.3 only
+       // Default value for a checkbox should be "on"
+       support.checkOn = input.value !== "";
 
-       // Make sure that a selected-by-default option has a working selected property.
-       // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+       // Support: IE <=11 only
+       // Must access selectedIndex to make default options select
        support.optSelected = opt.selected;
 
-       // Tests for enctype support on a form (#6743)
-       support.enctype = !!document.createElement( "form" ).enctype;
-
-       // Make sure that the options inside disabled selects aren't marked as disabled
-       // (WebKit marks them as disabled)
-       select.disabled = true;
-       support.optDisabled = !opt.disabled;
-
-       // Support: IE8 only
-       // Check if we can trust getAttribute("value")
+       // Support: IE <=11 only
+       // An input loses its value after becoming a radio
        input = document.createElement( "input" );
-       input.setAttribute( "value", "" );
-       support.input = input.getAttribute( "value" ) === "";
-
-       // Check if an input maintains its value after becoming a radio
        input.value = "t";
-       input.setAttribute( "type", "radio" );
+       input.type = "radio";
        support.radioValue = input.value === "t";
 } )();
 
 
-var rreturn = /\r/g;
+var boolHook,
+       attrHandle = jQuery.expr.attrHandle;
 
 jQuery.fn.extend( {
-       val: function( value ) {
-               var hooks, ret, isFunction,
-                       elem = this[ 0 ];
+       attr: function( name, value ) {
+               return access( this, jQuery.attr, name, value, arguments.length > 1 );
+       },
 
-               if ( !arguments.length ) {
-                       if ( elem ) {
-                               hooks = jQuery.valHooks[ elem.type ] ||
-                                       jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+       removeAttr: function( name ) {
+               return this.each( function() {
+                       jQuery.removeAttr( this, name );
+               } );
+       }
+} );
 
-                               if (
-                                       hooks &&
-                                       "get" in hooks &&
-                                       ( ret = hooks.get( elem, "value" ) ) !== undefined
-                               ) {
-                                       return ret;
-                               }
+jQuery.extend( {
+       attr: function( elem, name, value ) {
+               var ret, hooks,
+                       nType = elem.nodeType;
 
-                               ret = elem.value;
+               // Don't get/set attributes on text, comment and attribute nodes
+               if ( nType === 3 || nType === 8 || nType === 2 ) {
+                       return;
+               }
 
-                               return typeof ret === "string" ?
+               // Fallback to prop when attributes are not supported
+               if ( typeof elem.getAttribute === "undefined" ) {
+                       return jQuery.prop( elem, name, value );
+               }
 
-                                       // handle most common string cases
-                                       ret.replace( rreturn, "" ) :
+               // Attribute hooks are determined by the lowercase version
+               // Grab necessary hook if one is defined
+               if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+                       hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
+                               ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
+               }
 
-                                       // handle cases where value is null/undef or number
-                                       ret == null ? "" : ret;
+               if ( value !== undefined ) {
+                       if ( value === null ) {
+                               jQuery.removeAttr( elem, name );
+                               return;
                        }
 
-                       return;
+                       if ( hooks && "set" in hooks &&
+                               ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
+                               return ret;
+                       }
+
+                       elem.setAttribute( name, value + "" );
+                       return value;
                }
 
-               isFunction = jQuery.isFunction( value );
+               if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
+                       return ret;
+               }
 
-               return this.each( function( i ) {
-                       var val;
+               ret = jQuery.find.attr( elem, name );
 
-                       if ( this.nodeType !== 1 ) {
-                               return;
-                       }
+               // Non-existent attributes return null, we normalize to undefined
+               return ret == null ? undefined : ret;
+       },
 
-                       if ( isFunction ) {
-                               val = value.call( this, i, jQuery( this ).val() );
-                       } else {
-                               val = value;
+       attrHooks: {
+               type: {
+                       set: function( elem, value ) {
+                               if ( !support.radioValue && value === "radio" &&
+                                       nodeName( elem, "input" ) ) {
+                                       var val = elem.value;
+                                       elem.setAttribute( "type", value );
+                                       if ( val ) {
+                                               elem.value = val;
+                                       }
+                                       return value;
+                               }
                        }
+               }
+       },
 
-                       // Treat null/undefined as ""; convert numbers to string
-                       if ( val == null ) {
-                               val = "";
-                       } else if ( typeof val === "number" ) {
-                               val += "";
-                       } else if ( jQuery.isArray( val ) ) {
-                               val = jQuery.map( val, function( value ) {
-                                       return value == null ? "" : value + "";
-                               } );
-                       }
+       removeAttr: function( elem, value ) {
+               var name,
+                       i = 0,
 
-                       hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+                       // Attribute names can contain non-HTML whitespace characters
+                       // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
+                       attrNames = value && value.match( rnothtmlwhite );
 
-                       // If set returns undefined, fall back to normal setting
-                       if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
-                               this.value = val;
+               if ( attrNames && elem.nodeType === 1 ) {
+                       while ( ( name = attrNames[ i++ ] ) ) {
+                               elem.removeAttribute( name );
                        }
-               } );
+               }
        }
 } );
 
-jQuery.extend( {
-       valHooks: {
-               option: {
-                       get: function( elem ) {
-                               var val = jQuery.find.attr( elem, "value" );
-                               return val != null ?
-                                       val :
+// Hooks for boolean attributes
+boolHook = {
+       set: function( elem, value, name ) {
+               if ( value === false ) {
 
-                                       // Support: IE10-11+
-                                       // option.text throws exceptions (#14686, #14858)
-                                       jQuery.trim( jQuery.text( elem ) );
-                       }
-               },
-               select: {
-                       get: function( elem ) {
-                               var value, option,
-                                       options = elem.options,
-                                       index = elem.selectedIndex,
-                                       one = elem.type === "select-one" || index < 0,
-                                       values = one ? null : [],
-                                       max = one ? index + 1 : options.length,
-                                       i = index < 0 ?
-                                               max :
-                                               one ? index : 0;
+                       // Remove boolean attributes when set to false
+                       jQuery.removeAttr( elem, name );
+               } else {
+                       elem.setAttribute( name, name );
+               }
+               return name;
+       }
+};
 
-                               // Loop through all the selected options
-                               for ( ; i < max; i++ ) {
-                                       option = options[ i ];
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
+       var getter = attrHandle[ name ] || jQuery.find.attr;
 
-                                       // oldIE doesn't update selected after form reset (#2551)
-                                       if ( ( option.selected || i === index ) &&
+       attrHandle[ name ] = function( elem, name, isXML ) {
+               var ret, handle,
+                       lowercaseName = name.toLowerCase();
 
-                                                       // Don't return options that are disabled or in a disabled optgroup
-                                                       ( support.optDisabled ?
-                                                               !option.disabled :
-                                                               option.getAttribute( "disabled" ) === null ) &&
-                                                       ( !option.parentNode.disabled ||
-                                                               !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+               if ( !isXML ) {
 
-                                               // Get the specific value for the option
-                                               value = jQuery( option ).val();
-
-                                               // We don't need an array for one selects
-                                               if ( one ) {
-                                                       return value;
-                                               }
-
-                                               // Multi-Selects return an array
-                                               values.push( value );
-                                       }
-                               }
-
-                               return values;
-                       },
-
-                       set: function( elem, value ) {
-                               var optionSet, option,
-                                       options = elem.options,
-                                       values = jQuery.makeArray( value ),
-                                       i = options.length;
-
-                               while ( i-- ) {
-                                       option = options[ i ];
-
-                                       if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
-
-                                               // Support: IE6
-                                               // When new option element is added to select box we need to
-                                               // force reflow of newly added node in order to workaround delay
-                                               // of initialization properties
-                                               try {
-                                                       option.selected = optionSet = true;
-
-                                               } catch ( _ ) {
-
-                                                       // Will be executed only in IE6
-                                                       option.scrollHeight;
-                                               }
-
-                                       } else {
-                                               option.selected = false;
-                                       }
-                               }
-
-                               // Force browsers to behave consistently when non-matching value is set
-                               if ( !optionSet ) {
-                                       elem.selectedIndex = -1;
-                               }
-
-                               return options;
-                       }
-               }
-       }
-} );
-
-// Radios and checkboxes getter/setter
-jQuery.each( [ "radio", "checkbox" ], function() {
-       jQuery.valHooks[ this ] = {
-               set: function( elem, value ) {
-                       if ( jQuery.isArray( value ) ) {
-                               return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
-                       }
-               }
-       };
-       if ( !support.checkOn ) {
-               jQuery.valHooks[ this ].get = function( elem ) {
-                       return elem.getAttribute( "value" ) === null ? "on" : elem.value;
-               };
-       }
-} );
-
-
-
-
-var nodeHook, boolHook,
-       attrHandle = jQuery.expr.attrHandle,
-       ruseDefault = /^(?:checked|selected)$/i,
-       getSetAttribute = support.getSetAttribute,
-       getSetInput = support.input;
-
-jQuery.fn.extend( {
-       attr: function( name, value ) {
-               return access( this, jQuery.attr, name, value, arguments.length > 1 );
-       },
-
-       removeAttr: function( name ) {
-               return this.each( function() {
-                       jQuery.removeAttr( this, name );
-               } );
-       }
-} );
-
-jQuery.extend( {
-       attr: function( elem, name, value ) {
-               var ret, hooks,
-                       nType = elem.nodeType;
-
-               // Don't get/set attributes on text, comment and attribute nodes
-               if ( nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               // Fallback to prop when attributes are not supported
-               if ( typeof elem.getAttribute === "undefined" ) {
-                       return jQuery.prop( elem, name, value );
-               }
-
-               // All attributes are lowercase
-               // Grab necessary hook if one is defined
-               if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
-                       name = name.toLowerCase();
-                       hooks = jQuery.attrHooks[ name ] ||
-                               ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
-               }
-
-               if ( value !== undefined ) {
-                       if ( value === null ) {
-                               jQuery.removeAttr( elem, name );
-                               return;
-                       }
-
-                       if ( hooks && "set" in hooks &&
-                               ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
-                               return ret;
-                       }
-
-                       elem.setAttribute( name, value + "" );
-                       return value;
-               }
-
-               if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
-                       return ret;
-               }
-
-               ret = jQuery.find.attr( elem, name );
-
-               // Non-existent attributes return null, we normalize to undefined
-               return ret == null ? undefined : ret;
-       },
-
-       attrHooks: {
-               type: {
-                       set: function( elem, value ) {
-                               if ( !support.radioValue && value === "radio" &&
-                                       jQuery.nodeName( elem, "input" ) ) {
-
-                                       // Setting the type on a radio button after the value resets the value in IE8-9
-                                       // Reset value to default in case type is set after value during creation
-                                       var val = elem.value;
-                                       elem.setAttribute( "type", value );
-                                       if ( val ) {
-                                               elem.value = val;
-                                       }
-                                       return value;
-                               }
-                       }
-               }
-       },
-
-       removeAttr: function( elem, value ) {
-               var name, propName,
-                       i = 0,
-                       attrNames = value && value.match( rnotwhite );
-
-               if ( attrNames && elem.nodeType === 1 ) {
-                       while ( ( name = attrNames[ i++ ] ) ) {
-                               propName = jQuery.propFix[ name ] || name;
-
-                               // Boolean attributes get special treatment (#10870)
-                               if ( jQuery.expr.match.bool.test( name ) ) {
-
-                                       // Set corresponding property to false
-                                       if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-                                               elem[ propName ] = false;
-
-                                       // Support: IE<9
-                                       // Also clear defaultChecked/defaultSelected (if appropriate)
-                                       } else {
-                                               elem[ jQuery.camelCase( "default-" + name ) ] =
-                                                       elem[ propName ] = false;
-                                       }
-
-                               // See #9699 for explanation of this approach (setting first, then removal)
-                               } else {
-                                       jQuery.attr( elem, name, "" );
-                               }
-
-                               elem.removeAttribute( getSetAttribute ? name : propName );
-                       }
-               }
-       }
-} );
-
-// Hooks for boolean attributes
-boolHook = {
-       set: function( elem, value, name ) {
-               if ( value === false ) {
-
-                       // Remove boolean attributes when set to false
-                       jQuery.removeAttr( elem, name );
-               } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-
-                       // IE<8 needs the *property* name
-                       elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
-
-               } else {
-
-                       // Support: IE<9
-                       // Use defaultChecked and defaultSelected for oldIE
-                       elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
-               }
-               return name;
-       }
-};
-
-jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
-       var getter = attrHandle[ name ] || jQuery.find.attr;
-
-       if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
-               attrHandle[ name ] = function( elem, name, isXML ) {
-                       var ret, handle;
-                       if ( !isXML ) {
-
-                               // Avoid an infinite loop by temporarily removing this function from the getter
-                               handle = attrHandle[ name ];
-                               attrHandle[ name ] = ret;
-                               ret = getter( elem, name, isXML ) != null ?
-                                       name.toLowerCase() :
-                                       null;
-                               attrHandle[ name ] = handle;
-                       }
-                       return ret;
-               };
-       } else {
-               attrHandle[ name ] = function( elem, name, isXML ) {
-                       if ( !isXML ) {
-                               return elem[ jQuery.camelCase( "default-" + name ) ] ?
-                                       name.toLowerCase() :
-                                       null;
-                       }
-               };
-       }
-} );
-
-// fix oldIE attroperties
-if ( !getSetInput || !getSetAttribute ) {
-       jQuery.attrHooks.value = {
-               set: function( elem, value, name ) {
-                       if ( jQuery.nodeName( elem, "input" ) ) {
-
-                               // Does not return so that setAttribute is also used
-                               elem.defaultValue = value;
-                       } else {
-
-                               // Use nodeHook if defined (#1954); otherwise setAttribute is fine
-                               return nodeHook && nodeHook.set( elem, value, name );
-                       }
-               }
-       };
-}
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-       // Use this for any attribute in IE6/7
-       // This fixes almost every IE6/7 issue
-       nodeHook = {
-               set: function( elem, value, name ) {
-
-                       // Set the existing or create a new attribute node
-                       var ret = elem.getAttributeNode( name );
-                       if ( !ret ) {
-                               elem.setAttributeNode(
-                                       ( ret = elem.ownerDocument.createAttribute( name ) )
-                               );
-                       }
-
-                       ret.value = value += "";
-
-                       // Break association with cloned elements by also using setAttribute (#9646)
-                       if ( name === "value" || value === elem.getAttribute( name ) ) {
-                               return value;
-                       }
-               }
-       };
-
-       // Some attributes are constructed with empty-string values when not defined
-       attrHandle.id = attrHandle.name = attrHandle.coords =
-               function( elem, name, isXML ) {
-                       var ret;
-                       if ( !isXML ) {
-                               return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
-                                       ret.value :
-                                       null;
-                       }
-               };
-
-       // Fixing value retrieval on a button requires this module
-       jQuery.valHooks.button = {
-               get: function( elem, name ) {
-                       var ret = elem.getAttributeNode( name );
-                       if ( ret && ret.specified ) {
-                               return ret.value;
-                       }
-               },
-               set: nodeHook.set
-       };
-
-       // Set contenteditable to false on removals(#10429)
-       // Setting to empty string throws an error as an invalid value
-       jQuery.attrHooks.contenteditable = {
-               set: function( elem, value, name ) {
-                       nodeHook.set( elem, value === "" ? false : value, name );
-               }
-       };
-
-       // Set width and height to auto instead of 0 on empty string( Bug #8150 )
-       // This is for removals
-       jQuery.each( [ "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = {
-                       set: function( elem, value ) {
-                               if ( value === "" ) {
-                                       elem.setAttribute( name, "auto" );
-                                       return value;
-                               }
-                       }
-               };
-       } );
-}
-
-if ( !support.style ) {
-       jQuery.attrHooks.style = {
-               get: function( elem ) {
-
-                       // Return undefined in the case of empty string
-                       // Note: IE uppercases css property names, but if we were to .toLowerCase()
-                       // .cssText, that would destroy case sensitivity in URL's, like in "background"
-                       return elem.style.cssText || undefined;
-               },
-               set: function( elem, value ) {
-                       return ( elem.style.cssText = value + "" );
-               }
-       };
-}
+                       // Avoid an infinite loop by temporarily removing this function from the getter
+                       handle = attrHandle[ lowercaseName ];
+                       attrHandle[ lowercaseName ] = ret;
+                       ret = getter( elem, name, isXML ) != null ?
+                               lowercaseName :
+                               null;
+                       attrHandle[ lowercaseName ] = handle;
+               }
+               return ret;
+       };
+} );
 
 
 
 
-var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+var rfocusable = /^(?:input|select|textarea|button)$/i,
        rclickable = /^(?:a|area)$/i;
 
 jQuery.fn.extend( {
@@ -8663,14 +8005,8 @@ jQuery.fn.extend( {
        },
 
        removeProp: function( name ) {
-               name = jQuery.propFix[ name ] || name;
                return this.each( function() {
-
-                       // try/catch handles cases where IE balks (such as removing a property on window)
-                       try {
-                               this[ name ] = undefined;
-                               delete this[ name ];
-                       } catch ( e ) {}
+                       delete this[ jQuery.propFix[ name ] || name ];
                } );
        }
 } );
@@ -8712,18 +8048,25 @@ jQuery.extend( {
                tabIndex: {
                        get: function( elem ) {
 
+                               // Support: IE <=9 - 11 only
                                // elem.tabIndex doesn't always return the
                                // correct value when it hasn't been explicitly set
-                               // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-                               // Use proper attribute retrieval(#12072)
+                               // Use proper attribute retrieval (trac-12072)
                                var tabindex = jQuery.find.attr( elem, "tabindex" );
 
-                               return tabindex ?
-                                       parseInt( tabindex, 10 ) :
+                               if ( tabindex ) {
+                                       return parseInt( tabindex, 10 );
+                               }
+
+                               if (
                                        rfocusable.test( elem.nodeName ) ||
-                                               rclickable.test( elem.nodeName ) && elem.href ?
-                                                       0 :
-                                                       -1;
+                                       rclickable.test( elem.nodeName ) &&
+                                       elem.href
+                               ) {
+                                       return 0;
+                               }
+
+                               return -1;
                        }
                }
        },
@@ -8734,37 +8077,38 @@ jQuery.extend( {
        }
 } );
 
-// Some attributes require a special call on IE
-// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
-if ( !support.hrefNormalized ) {
-
-       // href/src property should get the full normalized URL (#10299/#12915)
-       jQuery.each( [ "href", "src" ], function( i, name ) {
-               jQuery.propHooks[ name ] = {
-                       get: function( elem ) {
-                               return elem.getAttribute( name, 4 );
-                       }
-               };
-       } );
-}
-
-// Support: Safari, IE9+
-// mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
+// Support: IE <=11 only
+// Accessing the selectedIndex property
+// forces the browser to respect setting selected
+// on the option
+// The getter ensures a default option is selected
+// when in an optgroup
+// eslint rule "no-unused-expressions" is disabled for this code
+// since it considers such accessions noop
 if ( !support.optSelected ) {
        jQuery.propHooks.selected = {
                get: function( elem ) {
+
+                       /* eslint no-unused-expressions: "off" */
+
                        var parent = elem.parentNode;
+                       if ( parent && parent.parentNode ) {
+                               parent.parentNode.selectedIndex;
+                       }
+                       return null;
+               },
+               set: function( elem ) {
 
+                       /* eslint no-unused-expressions: "off" */
+
+                       var parent = elem.parentNode;
                        if ( parent ) {
                                parent.selectedIndex;
 
-                               // Make sure that it also works with optgroups, see #5701
                                if ( parent.parentNode ) {
                                        parent.parentNode.selectedIndex;
                                }
                        }
-                       return null;
                }
        };
 }
@@ -8784,64 +8128,72 @@ jQuery.each( [
        jQuery.propFix[ this.toLowerCase() ] = this;
 } );
 
-// IE6/7 call enctype encoding
-if ( !support.enctype ) {
-       jQuery.propFix.enctype = "encoding";
-}
 
 
 
+       // Strip and collapse whitespace according to HTML spec
+       // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
+       function stripAndCollapse( value ) {
+               var tokens = value.match( rnothtmlwhite ) || [];
+               return tokens.join( " " );
+       }
 
-var rclass = /[\t\r\n\f]/g;
 
 function getClass( elem ) {
-       return jQuery.attr( elem, "class" ) || "";
+       return elem.getAttribute && elem.getAttribute( "class" ) || "";
+}
+
+function classesToArray( value ) {
+       if ( Array.isArray( value ) ) {
+               return value;
+       }
+       if ( typeof value === "string" ) {
+               return value.match( rnothtmlwhite ) || [];
+       }
+       return [];
 }
 
 jQuery.fn.extend( {
        addClass: function( value ) {
-               var classes, elem, cur, curValue, clazz, j, finalValue,
-                       i = 0;
+               var classNames, cur, curValue, className, i, finalValue;
 
-               if ( jQuery.isFunction( value ) ) {
+               if ( isFunction( value ) ) {
                        return this.each( function( j ) {
                                jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
                        } );
                }
 
-               if ( typeof value === "string" && value ) {
-                       classes = value.match( rnotwhite ) || [];
+               classNames = classesToArray( value );
 
-                       while ( ( elem = this[ i++ ] ) ) {
-                               curValue = getClass( elem );
-                               cur = elem.nodeType === 1 &&
-                                       ( " " + curValue + " " ).replace( rclass, " " );
+               if ( classNames.length ) {
+                       return this.each( function() {
+                               curValue = getClass( this );
+                               cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
 
                                if ( cur ) {
-                                       j = 0;
-                                       while ( ( clazz = classes[ j++ ] ) ) {
-                                               if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
-                                                       cur += clazz + " ";
+                                       for ( i = 0; i < classNames.length; i++ ) {
+                                               className = classNames[ i ];
+                                               if ( cur.indexOf( " " + className + " " ) < 0 ) {
+                                                       cur += className + " ";
                                                }
                                        }
 
-                                       // only assign if different to avoid unneeded rendering.
-                                       finalValue = jQuery.trim( cur );
+                                       // Only assign if different to avoid unneeded rendering.
+                                       finalValue = stripAndCollapse( cur );
                                        if ( curValue !== finalValue ) {
-                                               jQuery.attr( elem, "class", finalValue );
+                                               this.setAttribute( "class", finalValue );
                                        }
                                }
-                       }
+                       } );
                }
 
                return this;
        },
 
        removeClass: function( value ) {
-               var classes, elem, cur, curValue, clazz, j, finalValue,
-                       i = 0;
+               var classNames, cur, curValue, className, i, finalValue;
 
-               if ( jQuery.isFunction( value ) ) {
+               if ( isFunction( value ) ) {
                        return this.each( function( j ) {
                                jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
                        } );
@@ -8851,46 +8203,43 @@ jQuery.fn.extend( {
                        return this.attr( "class", "" );
                }
 
-               if ( typeof value === "string" && value ) {
-                       classes = value.match( rnotwhite ) || [];
+               classNames = classesToArray( value );
 
-                       while ( ( elem = this[ i++ ] ) ) {
-                               curValue = getClass( elem );
+               if ( classNames.length ) {
+                       return this.each( function() {
+                               curValue = getClass( this );
 
                                // This expression is here for better compressibility (see addClass)
-                               cur = elem.nodeType === 1 &&
-                                       ( " " + curValue + " " ).replace( rclass, " " );
+                               cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
 
                                if ( cur ) {
-                                       j = 0;
-                                       while ( ( clazz = classes[ j++ ] ) ) {
+                                       for ( i = 0; i < classNames.length; i++ ) {
+                                               className = classNames[ i ];
 
                                                // Remove *all* instances
-                                               while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
-                                                       cur = cur.replace( " " + clazz + " ", " " );
+                                               while ( cur.indexOf( " " + className + " " ) > -1 ) {
+                                                       cur = cur.replace( " " + className + " ", " " );
                                                }
                                        }
 
                                        // Only assign if different to avoid unneeded rendering.
-                                       finalValue = jQuery.trim( cur );
+                                       finalValue = stripAndCollapse( cur );
                                        if ( curValue !== finalValue ) {
-                                               jQuery.attr( elem, "class", finalValue );
+                                               this.setAttribute( "class", finalValue );
                                        }
                                }
-                       }
+                       } );
                }
 
                return this;
        },
 
        toggleClass: function( value, stateVal ) {
-               var type = typeof value;
+               var classNames, className, i, self,
+                       type = typeof value,
+                       isValidValue = type === "string" || Array.isArray( value );
 
-               if ( typeof stateVal === "boolean" && type === "string" ) {
-                       return stateVal ? this.addClass( value ) : this.removeClass( value );
-               }
-
-               if ( jQuery.isFunction( value ) ) {
+               if ( isFunction( value ) ) {
                        return this.each( function( i ) {
                                jQuery( this ).toggleClass(
                                        value.call( this, i, getClass( this ), stateVal ),
@@ -8899,17 +8248,20 @@ jQuery.fn.extend( {
                        } );
                }
 
-               return this.each( function() {
-                       var className, i, self, classNames;
+               if ( typeof stateVal === "boolean" && isValidValue ) {
+                       return stateVal ? this.addClass( value ) : this.removeClass( value );
+               }
 
-                       if ( type === "string" ) {
+               classNames = classesToArray( value );
+
+               return this.each( function() {
+                       if ( isValidValue ) {
 
                                // Toggle individual class names
-                               i = 0;
                                self = jQuery( this );
-                               classNames = value.match( rnotwhite ) || [];
 
-                               while ( ( className = classNames[ i++ ] ) ) {
+                               for ( i = 0; i < classNames.length; i++ ) {
+                                       className = classNames[ i ];
 
                                        // Check each className given, space separated list
                                        if ( self.hasClass( className ) ) {
@@ -8924,19 +8276,21 @@ jQuery.fn.extend( {
                                className = getClass( this );
                                if ( className ) {
 
-                                       // store className if set
-                                       jQuery._data( this, "__className__", className );
+                                       // Store className if set
+                                       dataPriv.set( this, "__className__", className );
                                }
 
-                               // If the element has a class name or if we're passed "false",
+                               // If the element has a class name or if we're passed `false`,
                                // then remove the whole classname (if there was one, the above saved it).
                                // Otherwise bring back whatever was previously saved (if anything),
                                // falling back to the empty string if nothing was stored.
-                               jQuery.attr( this, "class",
-                                       className || value === false ?
-                                       "" :
-                                       jQuery._data( this, "__className__" ) || ""
-                               );
+                               if ( this.setAttribute ) {
+                                       this.setAttribute( "class",
+                                               className || value === false ?
+                                                       "" :
+                                                       dataPriv.get( this, "__className__" ) || ""
+                                       );
+                               }
                        }
                } );
        },
@@ -8948,9 +8302,7 @@ jQuery.fn.extend( {
                className = " " + selector + " ";
                while ( ( elem = this[ i++ ] ) ) {
                        if ( elem.nodeType === 1 &&
-                               ( " " + getClass( elem ) + " " ).replace( rclass, " " )
-                                       .indexOf( className ) > -1
-                       ) {
+                               ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
                                return true;
                        }
                }
@@ -8962,121 +8314,539 @@ jQuery.fn.extend( {
 
 
 
+var rreturn = /\r/g;
+
+jQuery.fn.extend( {
+       val: function( value ) {
+               var hooks, ret, valueIsFunction,
+                       elem = this[ 0 ];
+
+               if ( !arguments.length ) {
+                       if ( elem ) {
+                               hooks = jQuery.valHooks[ elem.type ] ||
+                                       jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+                               if ( hooks &&
+                                       "get" in hooks &&
+                                       ( ret = hooks.get( elem, "value" ) ) !== undefined
+                               ) {
+                                       return ret;
+                               }
+
+                               ret = elem.value;
+
+                               // Handle most common string cases
+                               if ( typeof ret === "string" ) {
+                                       return ret.replace( rreturn, "" );
+                               }
+
+                               // Handle cases where value is null/undef or number
+                               return ret == null ? "" : ret;
+                       }
+
+                       return;
+               }
+
+               valueIsFunction = isFunction( value );
+
+               return this.each( function( i ) {
+                       var val;
+
+                       if ( this.nodeType !== 1 ) {
+                               return;
+                       }
+
+                       if ( valueIsFunction ) {
+                               val = value.call( this, i, jQuery( this ).val() );
+                       } else {
+                               val = value;
+                       }
+
+                       // Treat null/undefined as ""; convert numbers to string
+                       if ( val == null ) {
+                               val = "";
+
+                       } else if ( typeof val === "number" ) {
+                               val += "";
+
+                       } else if ( Array.isArray( val ) ) {
+                               val = jQuery.map( val, function( value ) {
+                                       return value == null ? "" : value + "";
+                               } );
+                       }
+
+                       hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+                       // If set returns undefined, fall back to normal setting
+                       if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
+                               this.value = val;
+                       }
+               } );
+       }
+} );
+
+jQuery.extend( {
+       valHooks: {
+               option: {
+                       get: function( elem ) {
+
+                               var val = jQuery.find.attr( elem, "value" );
+                               return val != null ?
+                                       val :
+
+                                       // Support: IE <=10 - 11 only
+                                       // option.text throws exceptions (trac-14686, trac-14858)
+                                       // Strip and collapse whitespace
+                                       // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
+                                       stripAndCollapse( jQuery.text( elem ) );
+                       }
+               },
+               select: {
+                       get: function( elem ) {
+                               var value, option, i,
+                                       options = elem.options,
+                                       index = elem.selectedIndex,
+                                       one = elem.type === "select-one",
+                                       values = one ? null : [],
+                                       max = one ? index + 1 : options.length;
+
+                               if ( index < 0 ) {
+                                       i = max;
+
+                               } else {
+                                       i = one ? index : 0;
+                               }
+
+                               // Loop through all the selected options
+                               for ( ; i < max; i++ ) {
+                                       option = options[ i ];
+
+                                       // Support: IE <=9 only
+                                       // IE8-9 doesn't update selected after form reset (trac-2551)
+                                       if ( ( option.selected || i === index ) &&
+
+                                                       // Don't return options that are disabled or in a disabled optgroup
+                                                       !option.disabled &&
+                                                       ( !option.parentNode.disabled ||
+                                                               !nodeName( option.parentNode, "optgroup" ) ) ) {
+
+                                               // Get the specific value for the option
+                                               value = jQuery( option ).val();
+
+                                               // We don't need an array for one selects
+                                               if ( one ) {
+                                                       return value;
+                                               }
+
+                                               // Multi-Selects return an array
+                                               values.push( value );
+                                       }
+                               }
+
+                               return values;
+                       },
+
+                       set: function( elem, value ) {
+                               var optionSet, option,
+                                       options = elem.options,
+                                       values = jQuery.makeArray( value ),
+                                       i = options.length;
+
+                               while ( i-- ) {
+                                       option = options[ i ];
+
+                                       /* eslint-disable no-cond-assign */
+
+                                       if ( option.selected =
+                                               jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
+                                       ) {
+                                               optionSet = true;
+                                       }
+
+                                       /* eslint-enable no-cond-assign */
+                               }
+
+                               // Force browsers to behave consistently when non-matching value is set
+                               if ( !optionSet ) {
+                                       elem.selectedIndex = -1;
+                               }
+                               return values;
+                       }
+               }
+       }
+} );
+
+// Radios and checkboxes getter/setter
+jQuery.each( [ "radio", "checkbox" ], function() {
+       jQuery.valHooks[ this ] = {
+               set: function( elem, value ) {
+                       if ( Array.isArray( value ) ) {
+                               return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
+                       }
+               }
+       };
+       if ( !support.checkOn ) {
+               jQuery.valHooks[ this ].get = function( elem ) {
+                       return elem.getAttribute( "value" ) === null ? "on" : elem.value;
+               };
+       }
+} );
+
+
+
+
 // Return jQuery for attributes-only inclusion
+var location = window.location;
 
+var nonce = { guid: Date.now() };
 
-jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
-       "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-       "change select submit keydown keypress keyup error contextmenu" ).split( " " ),
-       function( i, name ) {
-
-       // Handle event binding
-       jQuery.fn[ name ] = function( data, fn ) {
-               return arguments.length > 0 ?
-                       this.on( name, null, data, fn ) :
-                       this.trigger( name );
+var rquery = ( /\?/ );
+
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+       var xml, parserErrorElem;
+       if ( !data || typeof data !== "string" ) {
+               return null;
+       }
+
+       // Support: IE 9 - 11 only
+       // IE throws on parseFromString with invalid input.
+       try {
+               xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
+       } catch ( e ) {}
+
+       parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
+       if ( !xml || parserErrorElem ) {
+               jQuery.error( "Invalid XML: " + (
+                       parserErrorElem ?
+                               jQuery.map( parserErrorElem.childNodes, function( el ) {
+                                       return el.textContent;
+                               } ).join( "\n" ) :
+                               data
+               ) );
+       }
+       return xml;
+};
+
+
+var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+       stopPropagationCallback = function( e ) {
+               e.stopPropagation();
        };
+
+jQuery.extend( jQuery.event, {
+
+       trigger: function( event, data, elem, onlyHandlers ) {
+
+               var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
+                       eventPath = [ elem || document ],
+                       type = hasOwn.call( event, "type" ) ? event.type : event,
+                       namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
+
+               cur = lastElement = tmp = elem = elem || document;
+
+               // Don't do events on text and comment nodes
+               if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+                       return;
+               }
+
+               // focus/blur morphs to focusin/out; ensure we're not firing them right now
+               if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+                       return;
+               }
+
+               if ( type.indexOf( "." ) > -1 ) {
+
+                       // Namespaced trigger; create a regexp to match event type in handle()
+                       namespaces = type.split( "." );
+                       type = namespaces.shift();
+                       namespaces.sort();
+               }
+               ontype = type.indexOf( ":" ) < 0 && "on" + type;
+
+               // Caller can pass in a jQuery.Event object, Object, or just an event type string
+               event = event[ jQuery.expando ] ?
+                       event :
+                       new jQuery.Event( type, typeof event === "object" && event );
+
+               // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+               event.isTrigger = onlyHandlers ? 2 : 3;
+               event.namespace = namespaces.join( "." );
+               event.rnamespace = event.namespace ?
+                       new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
+                       null;
+
+               // Clean up the event in case it is being reused
+               event.result = undefined;
+               if ( !event.target ) {
+                       event.target = elem;
+               }
+
+               // Clone any incoming data and prepend the event, creating the handler arg list
+               data = data == null ?
+                       [ event ] :
+                       jQuery.makeArray( data, [ event ] );
+
+               // Allow special events to draw outside the lines
+               special = jQuery.event.special[ type ] || {};
+               if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+                       return;
+               }
+
+               // Determine event propagation path in advance, per W3C events spec (trac-9951)
+               // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)
+               if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
+
+                       bubbleType = special.delegateType || type;
+                       if ( !rfocusMorph.test( bubbleType + type ) ) {
+                               cur = cur.parentNode;
+                       }
+                       for ( ; cur; cur = cur.parentNode ) {
+                               eventPath.push( cur );
+                               tmp = cur;
+                       }
+
+                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
+                       if ( tmp === ( elem.ownerDocument || document ) ) {
+                               eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+                       }
+               }
+
+               // Fire handlers on the event path
+               i = 0;
+               while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
+                       lastElement = cur;
+                       event.type = i > 1 ?
+                               bubbleType :
+                               special.bindType || type;
+
+                       // jQuery handler
+                       handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&
+                               dataPriv.get( cur, "handle" );
+                       if ( handle ) {
+                               handle.apply( cur, data );
+                       }
+
+                       // Native handler
+                       handle = ontype && cur[ ontype ];
+                       if ( handle && handle.apply && acceptData( cur ) ) {
+                               event.result = handle.apply( cur, data );
+                               if ( event.result === false ) {
+                                       event.preventDefault();
+                               }
+                       }
+               }
+               event.type = type;
+
+               // If nobody prevented the default action, do it now
+               if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+                       if ( ( !special._default ||
+                               special._default.apply( eventPath.pop(), data ) === false ) &&
+                               acceptData( elem ) ) {
+
+                               // Call a native DOM method on the target with the same name as the event.
+                               // Don't do default actions on window, that's where global variables be (trac-6170)
+                               if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
+
+                                       // Don't re-trigger an onFOO event when we call its FOO() method
+                                       tmp = elem[ ontype ];
+
+                                       if ( tmp ) {
+                                               elem[ ontype ] = null;
+                                       }
+
+                                       // Prevent re-triggering of the same event, since we already bubbled it above
+                                       jQuery.event.triggered = type;
+
+                                       if ( event.isPropagationStopped() ) {
+                                               lastElement.addEventListener( type, stopPropagationCallback );
+                                       }
+
+                                       elem[ type ]();
+
+                                       if ( event.isPropagationStopped() ) {
+                                               lastElement.removeEventListener( type, stopPropagationCallback );
+                                       }
+
+                                       jQuery.event.triggered = undefined;
+
+                                       if ( tmp ) {
+                                               elem[ ontype ] = tmp;
+                                       }
+                               }
+                       }
+               }
+
+               return event.result;
+       },
+
+       // Piggyback on a donor event to simulate a different one
+       // Used only for `focus(in | out)` events
+       simulate: function( type, elem, event ) {
+               var e = jQuery.extend(
+                       new jQuery.Event(),
+                       event,
+                       {
+                               type: type,
+                               isSimulated: true
+                       }
+               );
+
+               jQuery.event.trigger( e, null, elem );
+       }
+
 } );
 
 jQuery.fn.extend( {
-       hover: function( fnOver, fnOut ) {
-               return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+
+       trigger: function( type, data ) {
+               return this.each( function() {
+                       jQuery.event.trigger( type, data, this );
+               } );
+       },
+       triggerHandler: function( type, data ) {
+               var elem = this[ 0 ];
+               if ( elem ) {
+                       return jQuery.event.trigger( type, data, elem, true );
+               }
        }
 } );
 
 
-var location = window.location;
+var
+       rbracket = /\[\]$/,
+       rCRLF = /\r?\n/g,
+       rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+       rsubmittable = /^(?:input|select|textarea|keygen)/i;
 
-var nonce = jQuery.now();
+function buildParams( prefix, obj, traditional, add ) {
+       var name;
 
-var rquery = ( /\?/ );
+       if ( Array.isArray( obj ) ) {
+
+               // Serialize array item.
+               jQuery.each( obj, function( i, v ) {
+                       if ( traditional || rbracket.test( prefix ) ) {
+
+                               // Treat each array item as a scalar.
+                               add( prefix, v );
+
+                       } else {
+
+                               // Item is non-scalar (array or object), encode its numeric index.
+                               buildParams(
+                                       prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
+                                       v,
+                                       traditional,
+                                       add
+                               );
+                       }
+               } );
+
+       } else if ( !traditional && toType( obj ) === "object" ) {
+
+               // Serialize object item.
+               for ( name in obj ) {
+                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+               }
 
+       } else {
 
+               // Serialize scalar item.
+               add( prefix, obj );
+       }
+}
 
-var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+       var prefix,
+               s = [],
+               add = function( key, valueOrFunction ) {
 
-jQuery.parseJSON = function( data ) {
+                       // If value is a function, invoke it and use its return value
+                       var value = isFunction( valueOrFunction ) ?
+                               valueOrFunction() :
+                               valueOrFunction;
 
-       // Attempt to parse using the native JSON parser first
-       if ( window.JSON && window.JSON.parse ) {
+                       s[ s.length ] = encodeURIComponent( key ) + "=" +
+                               encodeURIComponent( value == null ? "" : value );
+               };
 
-               // Support: Android 2.3
-               // Workaround failure to string-cast null input
-               return window.JSON.parse( data + "" );
+       if ( a == null ) {
+               return "";
        }
 
-       var requireNonComma,
-               depth = null,
-               str = jQuery.trim( data + "" );
+       // If an array was passed in, assume that it is an array of form elements.
+       if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+
+               // Serialize the form elements
+               jQuery.each( a, function() {
+                       add( this.name, this.value );
+               } );
 
-       // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
-       // after removing valid tokens
-       return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+       } else {
 
-               // Force termination if we see a misplaced comma
-               if ( requireNonComma && comma ) {
-                       depth = 0;
+               // If traditional, encode the "old" way (the way 1.3.2 or older
+               // did it), otherwise encode params recursively.
+               for ( prefix in a ) {
+                       buildParams( prefix, a[ prefix ], traditional, add );
                }
+       }
 
-               // Perform no more replacements after returning to outermost depth
-               if ( depth === 0 ) {
-                       return token;
-               }
+       // Return the resulting serialization
+       return s.join( "&" );
+};
+
+jQuery.fn.extend( {
+       serialize: function() {
+               return jQuery.param( this.serializeArray() );
+       },
+       serializeArray: function() {
+               return this.map( function() {
 
-               // Commas must not follow "[", "{", or ","
-               requireNonComma = open || comma;
+                       // Can add propHook for "elements" to filter or add form elements
+                       var elements = jQuery.prop( this, "elements" );
+                       return elements ? jQuery.makeArray( elements ) : this;
+               } ).filter( function() {
+                       var type = this.type;
 
-               // Determine new depth
-               // array/object open ("[" or "{"): depth += true - false (increment)
-               // array/object close ("]" or "}"): depth += false - true (decrement)
-               // other cases ("," or primitive): depth += true - true (numeric cast)
-               depth += !close - !open;
+                       // Use .is( ":disabled" ) so that fieldset[disabled] works
+                       return this.name && !jQuery( this ).is( ":disabled" ) &&
+                               rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+                               ( this.checked || !rcheckableType.test( type ) );
+               } ).map( function( _i, elem ) {
+                       var val = jQuery( this ).val();
 
-               // Remove this token
-               return "";
-       } ) ) ?
-               ( Function( "return " + str ) )() :
-               jQuery.error( "Invalid JSON: " + data );
-};
+                       if ( val == null ) {
+                               return null;
+                       }
 
+                       if ( Array.isArray( val ) ) {
+                               return jQuery.map( val, function( val ) {
+                                       return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+                               } );
+                       }
 
-// Cross-browser xml parsing
-jQuery.parseXML = function( data ) {
-       var xml, tmp;
-       if ( !data || typeof data !== "string" ) {
-               return null;
-       }
-       try {
-               if ( window.DOMParser ) { // Standard
-                       tmp = new window.DOMParser();
-                       xml = tmp.parseFromString( data, "text/xml" );
-               } else { // IE
-                       xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
-                       xml.async = "false";
-                       xml.loadXML( data );
-               }
-       } catch ( e ) {
-               xml = undefined;
-       }
-       if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-               jQuery.error( "Invalid XML: " + data );
+                       return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+               } ).get();
        }
-       return xml;
-};
+} );
 
 
 var
+       r20 = /%20/g,
        rhash = /#.*$/,
-       rts = /([?&])_=[^&]*/,
+       rantiCache = /([?&])_=[^&]*/,
+       rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
 
-       // IE leaves an \r character at EOL
-       rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
-
-       // #7653, #8125, #8152: local protocol detection
+       // trac-7653, trac-8125, trac-8152: local protocol detection
        rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
        rnoContent = /^(?:GET|HEAD)$/,
        rprotocol = /^\/\//,
-       rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
 
        /* Prefilters
         * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
@@ -9096,14 +8866,13 @@ var
         */
        transports = {},
 
-       // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+       // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression
        allTypes = "*/".concat( "*" ),
 
-       // Document location
-       ajaxLocation = location.href,
+       // Anchor tag for parsing the document origin
+       originAnchor = document.createElement( "a" );
 
-       // Segment location into parts
-       ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+originAnchor.href = location.href;
 
 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
 function addToPrefiltersOrTransports( structure ) {
@@ -9118,15 +8887,15 @@ function addToPrefiltersOrTransports( structure ) {
 
                var dataType,
                        i = 0,
-                       dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+                       dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
 
-               if ( jQuery.isFunction( func ) ) {
+               if ( isFunction( func ) ) {
 
                        // For each dataType in the dataTypeExpression
                        while ( ( dataType = dataTypes[ i++ ] ) ) {
 
                                // Prepend if requested
-                               if ( dataType.charAt( 0 ) === "+" ) {
+                               if ( dataType[ 0 ] === "+" ) {
                                        dataType = dataType.slice( 1 ) || "*";
                                        ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
 
@@ -9168,9 +8937,9 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
 
 // A special extend for ajax options
 // that takes "flat" options (not to be deep extended)
-// Fixes #9887
+// Fixes trac-9887
 function ajaxExtend( target, src ) {
-       var deep, key,
+       var key, deep,
                flatOptions = jQuery.ajaxSettings.flatOptions || {};
 
        for ( key in src ) {
@@ -9190,7 +8959,8 @@ function ajaxExtend( target, src ) {
  * - returns the corresponding response
  */
 function ajaxHandleResponses( s, jqXHR, responses ) {
-       var firstDataType, ct, finalDataType, type,
+
+       var ct, type, finalDataType, firstDataType,
                contents = s.contents,
                dataTypes = s.dataTypes;
 
@@ -9322,7 +9092,7 @@ function ajaxConvert( s, response, jqXHR, isSuccess ) {
                                if ( conv !== true ) {
 
                                        // Unless errors are allowed to bubble, catch and return them
-                                       if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation
+                                       if ( conv && s.throws ) {
                                                response = conv( response );
                                        } else {
                                                try {
@@ -9352,13 +9122,14 @@ jQuery.extend( {
        etag: {},
 
        ajaxSettings: {
-               url: ajaxLocation,
+               url: location.href,
                type: "GET",
-               isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+               isLocal: rlocalProtocol.test( location.protocol ),
                global: true,
                processData: true,
                async: true,
                contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+
                /*
                timeout: 0,
                data: null,
@@ -9402,7 +9173,7 @@ jQuery.extend( {
                        "text html": true,
 
                        // Evaluate text as a json expression
-                       "text json": jQuery.parseJSON,
+                       "text json": JSON.parse,
 
                        // Parse text as xml
                        "text xml": jQuery.parseXML
@@ -9446,30 +9217,32 @@ jQuery.extend( {
                // Force options to be an object
                options = options || {};
 
-               var
-
-                       // Cross-domain detection vars
-                       parts,
-
-                       // Loop variable
-                       i,
+               var transport,
 
                        // URL without anti-cache param
                        cacheURL,
 
-                       // Response headers as string
+                       // Response headers
                        responseHeadersString,
+                       responseHeaders,
 
                        // timeout handle
                        timeoutTimer,
 
+                       // Url cleanup var
+                       urlAnchor,
+
+                       // Request state (becomes false upon send and true upon completion)
+                       completed,
+
                        // To know if global events are to be dispatched
                        fireGlobals,
 
-                       transport,
+                       // Loop variable
+                       i,
 
-                       // Response headers
-                       responseHeaders,
+                       // uncached part of the url
+                       uncached,
 
                        // Create the final options object
                        s = jQuery.ajaxSetup( {}, options ),
@@ -9480,8 +9253,8 @@ jQuery.extend( {
                        // Context for global events is callbackContext if it is a DOM node or jQuery collection
                        globalEventContext = s.context &&
                                ( callbackContext.nodeType || callbackContext.jquery ) ?
-                                       jQuery( callbackContext ) :
-                                       jQuery.event,
+                               jQuery( callbackContext ) :
+                               jQuery.event,
 
                        // Deferreds
                        deferred = jQuery.Deferred(),
@@ -9494,9 +9267,6 @@ jQuery.extend( {
                        requestHeaders = {},
                        requestHeadersNames = {},
 
-                       // The jqXHR state
-                       state = 0,
-
                        // Default abort message
                        strAbort = "canceled",
 
@@ -9507,28 +9277,30 @@ jQuery.extend( {
                                // Builds headers hashtable if needed
                                getResponseHeader: function( key ) {
                                        var match;
-                                       if ( state === 2 ) {
+                                       if ( completed ) {
                                                if ( !responseHeaders ) {
                                                        responseHeaders = {};
                                                        while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
-                                                               responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
+                                                               responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
+                                                                       ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
+                                                                               .concat( match[ 2 ] );
                                                        }
                                                }
-                                               match = responseHeaders[ key.toLowerCase() ];
+                                               match = responseHeaders[ key.toLowerCase() + " " ];
                                        }
-                                       return match == null ? null : match;
+                                       return match == null ? null : match.join( ", " );
                                },
 
                                // Raw string
                                getAllResponseHeaders: function() {
-                                       return state === 2 ? responseHeadersString : null;
+                                       return completed ? responseHeadersString : null;
                                },
 
                                // Caches the header
                                setRequestHeader: function( name, value ) {
-                                       var lname = name.toLowerCase();
-                                       if ( !state ) {
-                                               name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+                                       if ( completed == null ) {
+                                               name = requestHeadersNames[ name.toLowerCase() ] =
+                                                       requestHeadersNames[ name.toLowerCase() ] || name;
                                                requestHeaders[ name ] = value;
                                        }
                                        return this;
@@ -9536,7 +9308,7 @@ jQuery.extend( {
 
                                // Overrides response content-type header
                                overrideMimeType: function( type ) {
-                                       if ( !state ) {
+                                       if ( completed == null ) {
                                                s.mimeType = type;
                                        }
                                        return this;
@@ -9546,16 +9318,16 @@ jQuery.extend( {
                                statusCode: function( map ) {
                                        var code;
                                        if ( map ) {
-                                               if ( state < 2 ) {
-                                                       for ( code in map ) {
-
-                                                               // Lazy-add the new callback in a way that preserves old ones
-                                                               statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
-                                                       }
-                                               } else {
+                                               if ( completed ) {
 
                                                        // Execute the appropriate callbacks
                                                        jqXHR.always( map[ jqXHR.status ] );
+                                               } else {
+
+                                                       // Lazy-add the new callbacks in a way that preserves old ones
+                                                       for ( code in map ) {
+                                                               statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+                                                       }
                                                }
                                        }
                                        return this;
@@ -9573,32 +9345,41 @@ jQuery.extend( {
                        };
 
                // Attach deferreds
-               deferred.promise( jqXHR ).complete = completeDeferred.add;
-               jqXHR.success = jqXHR.done;
-               jqXHR.error = jqXHR.fail;
+               deferred.promise( jqXHR );
 
-               // Remove hash character (#7531: and string promotion)
-               // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-               // Handle falsy url in the settings object (#10093: consistency with old signature)
+               // Add protocol if not provided (prefilters might expect it)
+               // Handle falsy url in the settings object (trac-10093: consistency with old signature)
                // We also use the url parameter if available
-               s.url = ( ( url || s.url || ajaxLocation ) + "" )
-                       .replace( rhash, "" )
-                       .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+               s.url = ( ( url || s.url || location.href ) + "" )
+                       .replace( rprotocol, location.protocol + "//" );
 
-               // Alias method option to type as per ticket #12004
+               // Alias method option to type as per ticket trac-12004
                s.type = options.method || options.type || s.method || s.type;
 
                // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+               s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
 
-               // A cross-domain request is in order when we have a protocol:host:port mismatch
+               // A cross-domain request is in order when the origin doesn't match the current origin.
                if ( s.crossDomain == null ) {
-                       parts = rurl.exec( s.url.toLowerCase() );
-                       s.crossDomain = !!( parts &&
-                               ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-                                       ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
-                                               ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
-                       );
+                       urlAnchor = document.createElement( "a" );
+
+                       // Support: IE <=8 - 11, Edge 12 - 15
+                       // IE throws exception on accessing the href property if url is malformed,
+                       // e.g. http://example.com:80x/
+                       try {
+                               urlAnchor.href = s.url;
+
+                               // Support: IE <=8 - 11 only
+                               // Anchor's host property isn't correctly set when s.url is relative
+                               urlAnchor.href = urlAnchor.href;
+                               s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
+                                       urlAnchor.protocol + "//" + urlAnchor.host;
+                       } catch ( e ) {
+
+                               // If there is an error parsing the URL, assume it is crossDomain,
+                               // it can be rejected by the transport if it is invalid
+                               s.crossDomain = true;
+                       }
                }
 
                // Convert data if not already a string
@@ -9610,12 +9391,12 @@ jQuery.extend( {
                inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
 
                // If request was aborted inside a prefilter, stop there
-               if ( state === 2 ) {
+               if ( completed ) {
                        return jqXHR;
                }
 
                // We can fire global events as of now if asked to
-               // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+               // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)
                fireGlobals = jQuery.event && s.global;
 
                // Watch for a new set of requests
@@ -9631,29 +9412,37 @@ jQuery.extend( {
 
                // Save the URL in case we're toying with the If-Modified-Since
                // and/or If-None-Match header later on
-               cacheURL = s.url;
+               // Remove hash to simplify url manipulation
+               cacheURL = s.url.replace( rhash, "" );
 
                // More options handling for requests with no content
                if ( !s.hasContent ) {
 
-                       // If data is available, append data to url
-                       if ( s.data ) {
-                               cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+                       // Remember the hash so we can put it back
+                       uncached = s.url.slice( cacheURL.length );
 
-                               // #9682: remove data so that it's not used in an eventual retry
+                       // If data is available and should be processed, append data to url
+                       if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
+                               cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
+
+                               // trac-9682: remove data so that it's not used in an eventual retry
                                delete s.data;
                        }
 
-                       // Add anti-cache in url if needed
+                       // Add or update anti-cache param if needed
                        if ( s.cache === false ) {
-                               s.url = rts.test( cacheURL ) ?
+                               cacheURL = cacheURL.replace( rantiCache, "$1" );
+                               uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
+                                       uncached;
+                       }
 
-                                       // If there is already a '_' parameter, set its value
-                                       cacheURL.replace( rts, "$1_=" + nonce++ ) :
+                       // Put hash and anti-cache on the URL that will be requested (gh-1732)
+                       s.url = cacheURL + uncached;
 
-                                       // Otherwise add one to the end
-                                       cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
-                       }
+               // Change '%20' to '+' if this is encoded form body content (gh-2658)
+               } else if ( s.data && s.processData &&
+                       ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
+                       s.data = s.data.replace( r20, "+" );
                }
 
                // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
@@ -9687,19 +9476,19 @@ jQuery.extend( {
 
                // Allow custom headers/mimetypes and early abort
                if ( s.beforeSend &&
-                       ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+                       ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
 
                        // Abort if not done already and return
                        return jqXHR.abort();
                }
 
-               // aborting is no longer a cancellation
+               // Aborting is no longer a cancellation
                strAbort = "abort";
 
                // Install callbacks on deferreds
-               for ( i in { success: 1, error: 1, complete: 1 } ) {
-                       jqXHR[ i ]( s[ i ] );
-               }
+               completeDeferred.add( s.complete );
+               jqXHR.done( s.success );
+               jqXHR.fail( s.error );
 
                // Get transport
                transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
@@ -9716,7 +9505,7 @@ jQuery.extend( {
                        }
 
                        // If request was aborted inside ajaxSend, stop there
-                       if ( state === 2 ) {
+                       if ( completed ) {
                                return jqXHR;
                        }
 
@@ -9728,18 +9517,17 @@ jQuery.extend( {
                        }
 
                        try {
-                               state = 1;
+                               completed = false;
                                transport.send( requestHeaders, done );
                        } catch ( e ) {
 
-                               // Propagate exception as error if not done
-                               if ( state < 2 ) {
-                                       done( -1, e );
-
-                               // Simply rethrow otherwise
-                               } else {
+                               // Rethrow post-completion exceptions
+                               if ( completed ) {
                                        throw e;
                                }
+
+                               // Propagate others as results
+                               done( -1, e );
                        }
                }
 
@@ -9748,13 +9536,12 @@ jQuery.extend( {
                        var isSuccess, success, error, response, modified,
                                statusText = nativeStatusText;
 
-                       // Called once
-                       if ( state === 2 ) {
+                       // Ignore repeat invocations
+                       if ( completed ) {
                                return;
                        }
 
-                       // State is "done" now
-                       state = 2;
+                       completed = true;
 
                        // Clear timeout if it exists
                        if ( timeoutTimer ) {
@@ -9779,6 +9566,13 @@ jQuery.extend( {
                                response = ajaxHandleResponses( s, jqXHR, responses );
                        }
 
+                       // Use a noop converter for missing script but not if jsonp
+                       if ( !isSuccess &&
+                               jQuery.inArray( "script", s.dataTypes ) > -1 &&
+                               jQuery.inArray( "json", s.dataTypes ) < 0 ) {
+                               s.converters[ "text script" ] = function() {};
+                       }
+
                        // Convert no matter what (that way responseXXX fields are always set)
                        response = ajaxConvert( s, response, jqXHR, isSuccess );
 
@@ -9814,8 +9608,7 @@ jQuery.extend( {
                                }
                        } else {
 
-                               // We extract error from statusText
-                               // then normalize statusText and status for non-aborts
+                               // Extract error from statusText and normalize for non-aborts
                                error = statusText;
                                if ( status || !statusText ) {
                                        statusText = "error";
@@ -9870,11 +9663,11 @@ jQuery.extend( {
        }
 } );
 
-jQuery.each( [ "get", "post" ], function( i, method ) {
+jQuery.each( [ "get", "post" ], function( _i, method ) {
        jQuery[ method ] = function( url, data, callback, type ) {
 
-               // shift arguments if data argument was omitted
-               if ( jQuery.isFunction( data ) ) {
+               // Shift arguments if data argument was omitted
+               if ( isFunction( data ) ) {
                        type = type || callback;
                        callback = data;
                        data = undefined;
@@ -9891,458 +9684,277 @@ jQuery.each( [ "get", "post" ], function( i, method ) {
        };
 } );
 
-
-jQuery._evalUrl = function( url ) {
-       return jQuery.ajax( {
-               url: url,
-
-               // Make this explicit, since user can override this through ajaxSetup (#11264)
-               type: "GET",
-               dataType: "script",
-               cache: true,
-               async: false,
-               global: false,
-               "throws": true
-       } );
-};
-
-
-jQuery.fn.extend( {
-       wrapAll: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each( function( i ) {
-                               jQuery( this ).wrapAll( html.call( this, i ) );
-                       } );
-               }
-
-               if ( this[ 0 ] ) {
-
-                       // The elements to wrap the target around
-                       var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
-
-                       if ( this[ 0 ].parentNode ) {
-                               wrap.insertBefore( this[ 0 ] );
-                       }
-
-                       wrap.map( function() {
-                               var elem = this;
-
-                               while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-                                       elem = elem.firstChild;
-                               }
-
-                               return elem;
-                       } ).append( this );
-               }
-
-               return this;
-       },
-
-       wrapInner: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each( function( i ) {
-                               jQuery( this ).wrapInner( html.call( this, i ) );
-                       } );
+jQuery.ajaxPrefilter( function( s ) {
+       var i;
+       for ( i in s.headers ) {
+               if ( i.toLowerCase() === "content-type" ) {
+                       s.contentType = s.headers[ i ] || "";
                }
-
-               return this.each( function() {
-                       var self = jQuery( this ),
-                               contents = self.contents();
-
-                       if ( contents.length ) {
-                               contents.wrapAll( html );
-
-                       } else {
-                               self.append( html );
-                       }
-               } );
-       },
-
-       wrap: function( html ) {
-               var isFunction = jQuery.isFunction( html );
-
-               return this.each( function( i ) {
-                       jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
-               } );
-       },
-
-       unwrap: function() {
-               return this.parent().each( function() {
-                       if ( !jQuery.nodeName( this, "body" ) ) {
-                               jQuery( this ).replaceWith( this.childNodes );
-                       }
-               } ).end();
        }
 } );
 
 
-function getDisplay( elem ) {
-       return elem.style && elem.style.display || jQuery.css( elem, "display" );
-}
-
-function filterHidden( elem ) {
-       while ( elem && elem.nodeType === 1 ) {
-               if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
-                       return true;
-               }
-               elem = elem.parentNode;
-       }
-       return false;
-}
-
-jQuery.expr.filters.hidden = function( elem ) {
-
-       // Support: Opera <= 12.12
-       // Opera reports offsetWidths and offsetHeights less than zero on some elements
-       return support.reliableHiddenOffsets() ?
-               ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
-                       !elem.getClientRects().length ) :
-                       filterHidden( elem );
-};
-
-jQuery.expr.filters.visible = function( elem ) {
-       return !jQuery.expr.filters.hidden( elem );
-};
-
-
-
-
-var r20 = /%20/g,
-       rbracket = /\[\]$/,
-       rCRLF = /\r?\n/g,
-       rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
-       rsubmittable = /^(?:input|select|textarea|keygen)/i;
-
-function buildParams( prefix, obj, traditional, add ) {
-       var name;
-
-       if ( jQuery.isArray( obj ) ) {
-
-               // Serialize array item.
-               jQuery.each( obj, function( i, v ) {
-                       if ( traditional || rbracket.test( prefix ) ) {
-
-                               // Treat each array item as a scalar.
-                               add( prefix, v );
-
-                       } else {
-
-                               // Item is non-scalar (array or object), encode its numeric index.
-                               buildParams(
-                                       prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
-                                       v,
-                                       traditional,
-                                       add
-                               );
-                       }
-               } );
-
-       } else if ( !traditional && jQuery.type( obj ) === "object" ) {
-
-               // Serialize object item.
-               for ( name in obj ) {
-                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-               }
-
-       } else {
-
-               // Serialize scalar item.
-               add( prefix, obj );
-       }
-}
-
-// Serialize an array of form elements or a set of
-// key/values into a query string
-jQuery.param = function( a, traditional ) {
-       var prefix,
-               s = [],
-               add = function( key, value ) {
-
-                       // If value is a function, invoke it and return its value
-                       value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-                       s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-               };
-
-       // Set traditional to true for jQuery <= 1.3.2 behavior.
-       if ( traditional === undefined ) {
-               traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-       }
-
-       // If an array was passed in, assume that it is an array of form elements.
-       if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-
-               // Serialize the form elements
-               jQuery.each( a, function() {
-                       add( this.name, this.value );
-               } );
-
-       } else {
+jQuery._evalUrl = function( url, options, doc ) {
+       return jQuery.ajax( {
+               url: url,
 
-               // If traditional, encode the "old" way (the way 1.3.2 or older
-               // did it), otherwise encode params recursively.
-               for ( prefix in a ) {
-                       buildParams( prefix, a[ prefix ], traditional, add );
-               }
-       }
+               // Make this explicit, since user can override this through ajaxSetup (trac-11264)
+               type: "GET",
+               dataType: "script",
+               cache: true,
+               async: false,
+               global: false,
 
-       // Return the resulting serialization
-       return s.join( "&" ).replace( r20, "+" );
+               // Only evaluate the response if it is successful (gh-4126)
+               // dataFilter is not invoked for failure responses, so using it instead
+               // of the default converter is kludgy but it works.
+               converters: {
+                       "text script": function() {}
+               },
+               dataFilter: function( response ) {
+                       jQuery.globalEval( response, options, doc );
+               }
+       } );
 };
 
-jQuery.fn.extend( {
-       serialize: function() {
-               return jQuery.param( this.serializeArray() );
-       },
-       serializeArray: function() {
-               return this.map( function() {
 
-                       // Can add propHook for "elements" to filter or add form elements
-                       var elements = jQuery.prop( this, "elements" );
-                       return elements ? jQuery.makeArray( elements ) : this;
-               } )
-               .filter( function() {
-                       var type = this.type;
+jQuery.fn.extend( {
+       wrapAll: function( html ) {
+               var wrap;
 
-                       // Use .is(":disabled") so that fieldset[disabled] works
-                       return this.name && !jQuery( this ).is( ":disabled" ) &&
-                               rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
-                               ( this.checked || !rcheckableType.test( type ) );
-               } )
-               .map( function( i, elem ) {
-                       var val = jQuery( this ).val();
+               if ( this[ 0 ] ) {
+                       if ( isFunction( html ) ) {
+                               html = html.call( this[ 0 ] );
+                       }
 
-                       return val == null ?
-                               null :
-                               jQuery.isArray( val ) ?
-                                       jQuery.map( val, function( val ) {
-                                               return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-                                       } ) :
-                                       { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-               } ).get();
-       }
-} );
+                       // The elements to wrap the target around
+                       wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
 
+                       if ( this[ 0 ].parentNode ) {
+                               wrap.insertBefore( this[ 0 ] );
+                       }
 
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+                       wrap.map( function() {
+                               var elem = this;
 
-       // Support: IE6-IE8
-       function() {
+                               while ( elem.firstElementChild ) {
+                                       elem = elem.firstElementChild;
+                               }
 
-               // XHR cannot access local files, always use ActiveX for that case
-               if ( this.isLocal ) {
-                       return createActiveXHR();
+                               return elem;
+                       } ).append( this );
                }
 
-               // Support: IE 9-11
-               // IE seems to error on cross-domain PATCH requests when ActiveX XHR
-               // is used. In IE 9+ always use the native XHR.
-               // Note: this condition won't catch Edge as it doesn't define
-               // document.documentMode but it also doesn't support ActiveX so it won't
-               // reach this code.
-               if ( document.documentMode > 8 ) {
-                       return createStandardXHR();
-               }
+               return this;
+       },
 
-               // Support: IE<9
-               // oldIE XHR does not support non-RFC2616 methods (#13240)
-               // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
-               // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
-               // Although this check for six methods instead of eight
-               // since IE also does not support "trace" and "connect"
-               return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
-                       createStandardXHR() || createActiveXHR();
-       } :
+       wrapInner: function( html ) {
+               if ( isFunction( html ) ) {
+                       return this.each( function( i ) {
+                               jQuery( this ).wrapInner( html.call( this, i ) );
+                       } );
+               }
 
-       // For all other browsers, use the standard XMLHttpRequest object
-       createStandardXHR;
+               return this.each( function() {
+                       var self = jQuery( this ),
+                               contents = self.contents();
 
-var xhrId = 0,
-       xhrCallbacks = {},
-       xhrSupported = jQuery.ajaxSettings.xhr();
+                       if ( contents.length ) {
+                               contents.wrapAll( html );
 
-// Support: IE<10
-// Open requests must be manually aborted on unload (#5280)
-// See https://support.microsoft.com/kb/2856746 for more info
-if ( window.attachEvent ) {
-       window.attachEvent( "onunload", function() {
-               for ( var key in xhrCallbacks ) {
-                       xhrCallbacks[ key ]( undefined, true );
-               }
-       } );
-}
+                       } else {
+                               self.append( html );
+                       }
+               } );
+       },
 
-// Determine support properties
-support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
-xhrSupported = support.ajax = !!xhrSupported;
+       wrap: function( html ) {
+               var htmlIsFunction = isFunction( html );
 
-// Create transport if the browser can provide an xhr
-if ( xhrSupported ) {
+               return this.each( function( i ) {
+                       jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
+               } );
+       },
 
-       jQuery.ajaxTransport( function( options ) {
+       unwrap: function( selector ) {
+               this.parent( selector ).not( "body" ).each( function() {
+                       jQuery( this ).replaceWith( this.childNodes );
+               } );
+               return this;
+       }
+} );
 
-               // Cross domain only allowed if supported through XMLHttpRequest
-               if ( !options.crossDomain || support.cors ) {
 
-                       var callback;
+jQuery.expr.pseudos.hidden = function( elem ) {
+       return !jQuery.expr.pseudos.visible( elem );
+};
+jQuery.expr.pseudos.visible = function( elem ) {
+       return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
+};
 
-                       return {
-                               send: function( headers, complete ) {
-                                       var i,
-                                               xhr = options.xhr(),
-                                               id = ++xhrId;
 
-                                       // Open the socket
-                                       xhr.open(
-                                               options.type,
-                                               options.url,
-                                               options.async,
-                                               options.username,
-                                               options.password
-                                       );
 
-                                       // Apply custom fields if provided
-                                       if ( options.xhrFields ) {
-                                               for ( i in options.xhrFields ) {
-                                                       xhr[ i ] = options.xhrFields[ i ];
-                                               }
-                                       }
 
-                                       // Override mime type if needed
-                                       if ( options.mimeType && xhr.overrideMimeType ) {
-                                               xhr.overrideMimeType( options.mimeType );
-                                       }
+jQuery.ajaxSettings.xhr = function() {
+       try {
+               return new window.XMLHttpRequest();
+       } catch ( e ) {}
+};
 
-                                       // X-Requested-With header
-                                       // For cross-domain requests, seeing as conditions for a preflight are
-                                       // akin to a jigsaw puzzle, we simply never set it to be sure.
-                                       // (it can always be set on a per-request basis or even using ajaxSetup)
-                                       // For same-domain requests, won't change header if already provided.
-                                       if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
-                                               headers[ "X-Requested-With" ] = "XMLHttpRequest";
-                                       }
+var xhrSuccessStatus = {
 
-                                       // Set headers
-                                       for ( i in headers ) {
-
-                                               // Support: IE<9
-                                               // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
-                                               // request header to a null-value.
-                                               //
-                                               // To keep consistent with other XHR implementations, cast the value
-                                               // to string and ignore `undefined`.
-                                               if ( headers[ i ] !== undefined ) {
-                                                       xhr.setRequestHeader( i, headers[ i ] + "" );
-                                               }
-                                       }
+               // File protocol always yields status code 0, assume 200
+               0: 200,
 
-                                       // Do send the request
-                                       // This may raise an exception which is actually
-                                       // handled in jQuery.ajax (so no try/catch here)
-                                       xhr.send( ( options.hasContent && options.data ) || null );
+               // Support: IE <=9 only
+               // trac-1450: sometimes IE returns 1223 when it should be 204
+               1223: 204
+       },
+       xhrSupported = jQuery.ajaxSettings.xhr();
 
-                                       // Listener
-                                       callback = function( _, isAbort ) {
-                                               var status, statusText, responses;
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+support.ajax = xhrSupported = !!xhrSupported;
 
-                                               // Was never called and is aborted or complete
-                                               if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+jQuery.ajaxTransport( function( options ) {
+       var callback, errorCallback;
 
-                                                       // Clean up
-                                                       delete xhrCallbacks[ id ];
-                                                       callback = undefined;
-                                                       xhr.onreadystatechange = jQuery.noop;
+       // Cross domain only allowed if supported through XMLHttpRequest
+       if ( support.cors || xhrSupported && !options.crossDomain ) {
+               return {
+                       send: function( headers, complete ) {
+                               var i,
+                                       xhr = options.xhr();
+
+                               xhr.open(
+                                       options.type,
+                                       options.url,
+                                       options.async,
+                                       options.username,
+                                       options.password
+                               );
 
-                                                       // Abort manually if needed
-                                                       if ( isAbort ) {
-                                                               if ( xhr.readyState !== 4 ) {
-                                                                       xhr.abort();
-                                                               }
-                                                       } else {
-                                                               responses = {};
-                                                               status = xhr.status;
-
-                                                               // Support: IE<10
-                                                               // Accessing binary-data responseText throws an exception
-                                                               // (#11426)
-                                                               if ( typeof xhr.responseText === "string" ) {
-                                                                       responses.text = xhr.responseText;
-                                                               }
+                               // Apply custom fields if provided
+                               if ( options.xhrFields ) {
+                                       for ( i in options.xhrFields ) {
+                                               xhr[ i ] = options.xhrFields[ i ];
+                                       }
+                               }
 
-                                                               // Firefox throws an exception when accessing
-                                                               // statusText for faulty cross-domain requests
-                                                               try {
-                                                                       statusText = xhr.statusText;
-                                                               } catch ( e ) {
+                               // Override mime type if needed
+                               if ( options.mimeType && xhr.overrideMimeType ) {
+                                       xhr.overrideMimeType( options.mimeType );
+                               }
 
-                                                                       // We normalize with Webkit giving an empty statusText
-                                                                       statusText = "";
-                                                               }
+                               // X-Requested-With header
+                               // For cross-domain requests, seeing as conditions for a preflight are
+                               // akin to a jigsaw puzzle, we simply never set it to be sure.
+                               // (it can always be set on a per-request basis or even using ajaxSetup)
+                               // For same-domain requests, won't change header if already provided.
+                               if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
+                                       headers[ "X-Requested-With" ] = "XMLHttpRequest";
+                               }
 
-                                                               // Filter status for non standard behaviors
+                               // Set headers
+                               for ( i in headers ) {
+                                       xhr.setRequestHeader( i, headers[ i ] );
+                               }
 
-                                                               // If the request is local and we have data: assume a success
-                                                               // (success with no data won't get notified, that's the best we
-                                                               // can do given current implementations)
-                                                               if ( !status && options.isLocal && !options.crossDomain ) {
-                                                                       status = responses.text ? 200 : 404;
+                               // Callback
+                               callback = function( type ) {
+                                       return function() {
+                                               if ( callback ) {
+                                                       callback = errorCallback = xhr.onload =
+                                                               xhr.onerror = xhr.onabort = xhr.ontimeout =
+                                                                       xhr.onreadystatechange = null;
+
+                                                       if ( type === "abort" ) {
+                                                               xhr.abort();
+                                                       } else if ( type === "error" ) {
+
+                                                               // Support: IE <=9 only
+                                                               // On a manual native abort, IE9 throws
+                                                               // errors on any property access that is not readyState
+                                                               if ( typeof xhr.status !== "number" ) {
+                                                                       complete( 0, "error" );
+                                                               } else {
+                                                                       complete(
 
-                                                               // IE - #1450: sometimes returns 1223 when it should be 204
-                                                               } else if ( status === 1223 ) {
-                                                                       status = 204;
+                                                                               // File: protocol always yields status 0; see trac-8605, trac-14207
+                                                                               xhr.status,
+                                                                               xhr.statusText
+                                                                       );
                                                                }
+                                                       } else {
+                                                               complete(
+                                                                       xhrSuccessStatus[ xhr.status ] || xhr.status,
+                                                                       xhr.statusText,
+
+                                                                       // Support: IE <=9 only
+                                                                       // IE9 has no XHR2 but throws on binary (trac-11426)
+                                                                       // For XHR2 non-text, let the caller handle it (gh-2498)
+                                                                       ( xhr.responseType || "text" ) !== "text"  ||
+                                                                       typeof xhr.responseText !== "string" ?
+                                                                               { binary: xhr.response } :
+                                                                               { text: xhr.responseText },
+                                                                       xhr.getAllResponseHeaders()
+                                                               );
                                                        }
                                                }
+                                       };
+                               };
+
+                               // Listen to events
+                               xhr.onload = callback();
+                               errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
 
-                                               // Call complete if needed
-                                               if ( responses ) {
-                                                       complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+                               // Support: IE 9 only
+                               // Use onreadystatechange to replace onabort
+                               // to handle uncaught aborts
+                               if ( xhr.onabort !== undefined ) {
+                                       xhr.onabort = errorCallback;
+                               } else {
+                                       xhr.onreadystatechange = function() {
+
+                                               // Check readyState before timeout as it changes
+                                               if ( xhr.readyState === 4 ) {
+
+                                                       // Allow onerror to be called first,
+                                                       // but that will not handle a native abort
+                                                       // Also, save errorCallback to a variable
+                                                       // as xhr.onerror cannot be accessed
+                                                       window.setTimeout( function() {
+                                                               if ( callback ) {
+                                                                       errorCallback();
+                                                               }
+                                                       } );
                                                }
                                        };
+                               }
 
-                                       // Do send the request
-                                       // `xhr.send` may raise an exception, but it will be
-                                       // handled in jQuery.ajax (so no try/catch here)
-                                       if ( !options.async ) {
-
-                                               // If we're in sync mode we fire the callback
-                                               callback();
-                                       } else if ( xhr.readyState === 4 ) {
+                               // Create the abort callback
+                               callback = callback( "abort" );
 
-                                               // (IE6 & IE7) if it's in cache and has been
-                                               // retrieved directly we need to fire the callback
-                                               window.setTimeout( callback );
-                                       } else {
+                               try {
 
-                                               // Register the callback, but delay it in case `xhr.send` throws
-                                               // Add to the list of active xhr callbacks
-                                               xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
-                                       }
-                               },
+                                       // Do send the request (this may raise an exception)
+                                       xhr.send( options.hasContent && options.data || null );
+                               } catch ( e ) {
 
-                               abort: function() {
+                                       // trac-14683: Only rethrow if this hasn't been notified as an error yet
                                        if ( callback ) {
-                                               callback( undefined, true );
+                                               throw e;
                                        }
                                }
-                       };
-               }
-       } );
-}
-
-// Functions to create xhrs
-function createStandardXHR() {
-       try {
-               return new window.XMLHttpRequest();
-       } catch ( e ) {}
-}
+                       },
 
-function createActiveXHR() {
-       try {
-               return new window.ActiveXObject( "Microsoft.XMLHTTP" );
-       } catch ( e ) {}
-}
+                       abort: function() {
+                               if ( callback ) {
+                                       callback();
+                               }
+                       }
+               };
+       }
+} );
 
 
 
@@ -10371,71 +9983,41 @@ jQuery.ajaxSetup( {
        }
 } );
 
-// Handle cache's special case and global
+// Handle cache's special case and crossDomain
 jQuery.ajaxPrefilter( "script", function( s ) {
        if ( s.cache === undefined ) {
                s.cache = false;
        }
        if ( s.crossDomain ) {
                s.type = "GET";
-               s.global = false;
        }
 } );
 
 // Bind script tag hack transport
 jQuery.ajaxTransport( "script", function( s ) {
 
-       // This transport only deals with cross domain requests
-       if ( s.crossDomain ) {
-
-               var script,
-                       head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
-
+       // This transport only deals with cross domain or forced-by-attrs requests
+       if ( s.crossDomain || s.scriptAttrs ) {
+               var script, callback;
                return {
-
-                       send: function( _, callback ) {
-
-                               script = document.createElement( "script" );
-
-                               script.async = true;
-
-                               if ( s.scriptCharset ) {
-                                       script.charset = s.scriptCharset;
-                               }
-
-                               script.src = s.url;
-
-                               // Attach handlers for all browsers
-                               script.onload = script.onreadystatechange = function( _, isAbort ) {
-
-                                       if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
-                                               // Handle memory leak in IE
-                                               script.onload = script.onreadystatechange = null;
-
-                                               // Remove the script
-                                               if ( script.parentNode ) {
-                                                       script.parentNode.removeChild( script );
-                                               }
-
-                                               // Dereference the script
-                                               script = null;
-
-                                               // Callback if not abort
-                                               if ( !isAbort ) {
-                                                       callback( 200, "success" );
+                       send: function( _, complete ) {
+                               script = jQuery( "<script>" )
+                                       .attr( s.scriptAttrs || {} )
+                                       .prop( { charset: s.scriptCharset, src: s.url } )
+                                       .on( "load error", callback = function( evt ) {
+                                               script.remove();
+                                               callback = null;
+                                               if ( evt ) {
+                                                       complete( evt.type === "error" ? 404 : 200, evt.type );
                                                }
-                                       }
-                               };
+                                       } );
 
-                               // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
                                // Use native DOM manipulation to avoid our domManip AJAX trickery
-                               head.insertBefore( script, head.firstChild );
+                               document.head.appendChild( script[ 0 ] );
                        },
-
                        abort: function() {
-                               if ( script ) {
-                                       script.onload( undefined, true );
+                               if ( callback ) {
+                                       callback();
                                }
                        }
                };
@@ -10452,7 +10034,7 @@ var oldCallbacks = [],
 jQuery.ajaxSetup( {
        jsonp: "callback",
        jsonpCallback: function() {
-               var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+               var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
                this[ callback ] = true;
                return callback;
        }
@@ -10474,7 +10056,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
        if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
 
                // Get callback name, remembering preexisting value associated with it
-               callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+               callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
                        s.jsonpCallback() :
                        s.jsonpCallback;
 
@@ -10493,7 +10075,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
                        return responseContainer[ 0 ];
                };
 
-               // force json dataType
+               // Force json dataType
                s.dataTypes[ 0 ] = "json";
 
                // Install callback
@@ -10517,15 +10099,15 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
                        // Save back as free
                        if ( s[ callbackName ] ) {
 
-                               // make sure that re-using the options doesn't screw things around
+                               // Make sure that re-using the options doesn't screw things around
                                s.jsonpCallback = originalSettings.jsonpCallback;
 
-                               // save the callback name for future use
+                               // Save the callback name for future use
                                oldCallbacks.push( callbackName );
                        }
 
                        // Call if it was a function and we have a response
-                       if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+                       if ( responseContainer && isFunction( overwritten ) ) {
                                overwritten( responseContainer[ 0 ] );
                        }
 
@@ -10540,42 +10122,53 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
 
 
 
-// Support: Safari 8+
+// Support: Safari 8 only
 // In Safari 8 documents created via document.implementation.createHTMLDocument
 // collapse sibling forms: the second one becomes a child of the first one.
 // Because of that, this security measure has to be disabled in Safari 8.
 // https://bugs.webkit.org/show_bug.cgi?id=137337
 support.createHTMLDocument = ( function() {
-       if ( !document.implementation.createHTMLDocument ) {
-               return false;
-       }
-       var doc = document.implementation.createHTMLDocument( "" );
-       doc.body.innerHTML = "<form></form><form></form>";
-       return doc.body.childNodes.length === 2;
+       var body = document.implementation.createHTMLDocument( "" ).body;
+       body.innerHTML = "<form></form><form></form>";
+       return body.childNodes.length === 2;
 } )();
 
 
-// data: string of html
+// Argument "data" should be string of html
 // context (optional): If specified, the fragment will be created in this context,
 // defaults to document
 // keepScripts (optional): If true, will include scripts passed in the html string
 jQuery.parseHTML = function( data, context, keepScripts ) {
-       if ( !data || typeof data !== "string" ) {
-               return null;
+       if ( typeof data !== "string" ) {
+               return [];
        }
        if ( typeof context === "boolean" ) {
                keepScripts = context;
                context = false;
        }
 
-       // document.implementation stops scripts or inline event handlers from
-       // being executed immediately
-       context = context || ( support.createHTMLDocument ?
-               document.implementation.createHTMLDocument( "" ) :
-               document );
+       var base, parsed, scripts;
+
+       if ( !context ) {
+
+               // Stop scripts or inline event handlers from being executed immediately
+               // by using document.implementation
+               if ( support.createHTMLDocument ) {
+                       context = document.implementation.createHTMLDocument( "" );
 
-       var parsed = rsingleTag.exec( data ),
-               scripts = !keepScripts && [];
+                       // Set the base href for the created document
+                       // so any parsed elements with URLs
+                       // are based on the document's URL (gh-2965)
+                       base = context.createElement( "base" );
+                       base.href = document.location.href;
+                       context.head.appendChild( base );
+               } else {
+                       context = document;
+               }
+       }
+
+       parsed = rsingleTag.exec( data );
+       scripts = !keepScripts && [];
 
        // Single tag
        if ( parsed ) {
@@ -10592,28 +10185,21 @@ jQuery.parseHTML = function( data, context, keepScripts ) {
 };
 
 
-// Keep a copy of the old load method
-var _load = jQuery.fn.load;
-
 /**
  * Load a url into a page
  */
 jQuery.fn.load = function( url, params, callback ) {
-       if ( typeof url !== "string" && _load ) {
-               return _load.apply( this, arguments );
-       }
-
        var selector, type, response,
                self = this,
                off = url.indexOf( " " );
 
        if ( off > -1 ) {
-               selector = jQuery.trim( url.slice( off, url.length ) );
+               selector = stripAndCollapse( url.slice( off ) );
                url = url.slice( 0, off );
        }
 
        // If it's a function
-       if ( jQuery.isFunction( params ) ) {
+       if ( isFunction( params ) ) {
 
                // We assume that it's the callback
                callback = params;
@@ -10654,7 +10240,7 @@ jQuery.fn.load = function( url, params, callback ) {
                // If it fails, this function gets "jqXHR", "status", "error"
                } ).always( callback && function( jqXHR, status ) {
                        self.each( function() {
-                               callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
+                               callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
                        } );
                } );
        }
@@ -10665,24 +10251,7 @@ jQuery.fn.load = function( url, params, callback ) {
 
 
 
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( [
-       "ajaxStart",
-       "ajaxStop",
-       "ajaxComplete",
-       "ajaxError",
-       "ajaxSuccess",
-       "ajaxSend"
-], function( i, type ) {
-       jQuery.fn[ type ] = function( fn ) {
-               return this.on( type, fn );
-       };
-} );
-
-
-
-
-jQuery.expr.filters.animated = function( elem ) {
+jQuery.expr.pseudos.animated = function( elem ) {
        return jQuery.grep( jQuery.timers, function( fn ) {
                return elem === fn.elem;
        } ).length;
@@ -10691,18 +10260,6 @@ jQuery.expr.filters.animated = function( elem ) {
 
 
 
-
-/**
- * Gets a window from an element
- */
-function getWindow( elem ) {
-       return jQuery.isWindow( elem ) ?
-               elem :
-               elem.nodeType === 9 ?
-                       elem.defaultView || elem.parentWindow :
-                       false;
-}
-
 jQuery.offset = {
        setOffset: function( elem, options, i ) {
                var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
@@ -10710,7 +10267,7 @@ jQuery.offset = {
                        curElem = jQuery( elem ),
                        props = {};
 
-               // set position first, in-case top/left are set even on static elem
+               // Set position first, in-case top/left are set even on static elem
                if ( position === "static" ) {
                        elem.style.position = "relative";
                }
@@ -10719,20 +10276,21 @@ jQuery.offset = {
                curCSSTop = jQuery.css( elem, "top" );
                curCSSLeft = jQuery.css( elem, "left" );
                calculatePosition = ( position === "absolute" || position === "fixed" ) &&
-                       jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1;
+                       ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
 
-               // need to be able to calculate position if either top or left
-               // is auto and position is either absolute or fixed
+               // Need to be able to calculate position if either
+               // top or left is auto and position is either absolute or fixed
                if ( calculatePosition ) {
                        curPosition = curElem.position();
                        curTop = curPosition.top;
                        curLeft = curPosition.left;
+
                } else {
                        curTop = parseFloat( curCSSTop ) || 0;
                        curLeft = parseFloat( curCSSLeft ) || 0;
                }
 
-               if ( jQuery.isFunction( options ) ) {
+               if ( isFunction( options ) ) {
 
                        // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
                        options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
@@ -10747,6 +10305,7 @@ jQuery.offset = {
 
                if ( "using" in options ) {
                        options.using.call( elem, props );
+
                } else {
                        curElem.css( props );
                }
@@ -10754,7 +10313,11 @@ jQuery.offset = {
 };
 
 jQuery.fn.extend( {
+
+       // offset() relates an element's border box to the document origin
        offset: function( options ) {
+
+               // Preserve chaining for setter
                if ( arguments.length ) {
                        return options === undefined ?
                                this :
@@ -10763,85 +10326,94 @@ jQuery.fn.extend( {
                                } );
                }
 
-               var docElem, win,
-                       box = { top: 0, left: 0 },
-                       elem = this[ 0 ],
-                       doc = elem && elem.ownerDocument;
+               var rect, win,
+                       elem = this[ 0 ];
 
-               if ( !doc ) {
+               if ( !elem ) {
                        return;
                }
 
-               docElem = doc.documentElement;
-
-               // Make sure it's not a disconnected DOM node
-               if ( !jQuery.contains( docElem, elem ) ) {
-                       return box;
+               // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
+               // Support: IE <=11 only
+               // Running getBoundingClientRect on a
+               // disconnected node in IE throws an error
+               if ( !elem.getClientRects().length ) {
+                       return { top: 0, left: 0 };
                }
 
-               // If we don't have gBCR, just use 0,0 rather than error
-               // BlackBerry 5, iOS 3 (original iPhone)
-               if ( typeof elem.getBoundingClientRect !== "undefined" ) {
-                       box = elem.getBoundingClientRect();
-               }
-               win = getWindow( doc );
+               // Get document-relative position by adding viewport scroll to viewport-relative gBCR
+               rect = elem.getBoundingClientRect();
+               win = elem.ownerDocument.defaultView;
                return {
-                       top: box.top  + ( win.pageYOffset || docElem.scrollTop )  - ( docElem.clientTop  || 0 ),
-                       left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+                       top: rect.top + win.pageYOffset,
+                       left: rect.left + win.pageXOffset
                };
        },
 
+       // position() relates an element's margin box to its offset parent's padding box
+       // This corresponds to the behavior of CSS absolute positioning
        position: function() {
                if ( !this[ 0 ] ) {
                        return;
                }
 
-               var offsetParent, offset,
-                       parentOffset = { top: 0, left: 0 },
-                       elem = this[ 0 ];
+               var offsetParent, offset, doc,
+                       elem = this[ 0 ],
+                       parentOffset = { top: 0, left: 0 };
 
-               // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
-               // because it is its only offset parent
+               // position:fixed elements are offset from the viewport, which itself always has zero offset
                if ( jQuery.css( elem, "position" ) === "fixed" ) {
 
-                       // we assume that getBoundingClientRect is available when computed position is fixed
+                       // Assume position:fixed implies availability of getBoundingClientRect
                        offset = elem.getBoundingClientRect();
+
                } else {
+                       offset = this.offset();
 
-                       // Get *real* offsetParent
-                       offsetParent = this.offsetParent();
+                       // Account for the *real* offset parent, which can be the document or its root element
+                       // when a statically positioned element is identified
+                       doc = elem.ownerDocument;
+                       offsetParent = elem.offsetParent || doc.documentElement;
+                       while ( offsetParent &&
+                               ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
+                               jQuery.css( offsetParent, "position" ) === "static" ) {
 
-                       // Get correct offsets
-                       offset = this.offset();
-                       if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
-                               parentOffset = offsetParent.offset();
+                               offsetParent = offsetParent.parentNode;
                        }
+                       if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
 
-                       // Add offsetParent borders
-                       // Subtract offsetParent scroll positions
-                       parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ) -
-                               offsetParent.scrollTop();
-                       parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) -
-                               offsetParent.scrollLeft();
+                               // Incorporate borders into its offset, since they are outside its content origin
+                               parentOffset = jQuery( offsetParent ).offset();
+                               parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
+                               parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
+                       }
                }
 
                // Subtract parent offsets and element margins
-               // note: when an element has margin: auto the offsetLeft and marginLeft
-               // are the same in Safari causing offset.left to incorrectly be 0
                return {
-                       top:  offset.top  - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+                       top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
                        left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
                };
        },
 
+       // This method will return documentElement in the following cases:
+       // 1) For the element inside the iframe without offsetParent, this method will return
+       //    documentElement of the parent window
+       // 2) For the hidden or detached element
+       // 3) For body or html element, i.e. in case of the html node - it will return itself
+       //
+       // but those exceptions were never presented as a real life use-cases
+       // and might be considered as more preferable results.
+       //
+       // This logic, however, is not guaranteed and can change at any point in the future
        offsetParent: function() {
                return this.map( function() {
                        var offsetParent = this.offsetParent;
 
-                       while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
-                               jQuery.css( offsetParent, "position" ) === "static" ) ) {
+                       while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
                                offsetParent = offsetParent.offsetParent;
                        }
+
                        return offsetParent || documentElement;
                } );
        }
@@ -10849,43 +10421,49 @@ jQuery.fn.extend( {
 
 // Create scrollLeft and scrollTop methods
 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
-       var top = /Y/.test( prop );
+       var top = "pageYOffset" === prop;
 
        jQuery.fn[ method ] = function( val ) {
                return access( this, function( elem, method, val ) {
-                       var win = getWindow( elem );
+
+                       // Coalesce documents and windows
+                       var win;
+                       if ( isWindow( elem ) ) {
+                               win = elem;
+                       } else if ( elem.nodeType === 9 ) {
+                               win = elem.defaultView;
+                       }
 
                        if ( val === undefined ) {
-                               return win ? ( prop in win ) ? win[ prop ] :
-                                       win.document.documentElement[ method ] :
-                                       elem[ method ];
+                               return win ? win[ prop ] : elem[ method ];
                        }
 
                        if ( win ) {
                                win.scrollTo(
-                                       !top ? val : jQuery( win ).scrollLeft(),
-                                       top ? val : jQuery( win ).scrollTop()
+                                       !top ? val : win.pageXOffset,
+                                       top ? val : win.pageYOffset
                                );
 
                        } else {
                                elem[ method ] = val;
                        }
-               }, method, val, arguments.length, null );
+               }, method, val, arguments.length );
        };
 } );
 
-// Support: Safari<7-8+, Chrome<37-44+
+// Support: Safari <=7 - 9.1, Chrome <=37 - 49
 // Add the top/left cssHooks using jQuery.fn.position
 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-// getComputedStyle returns percent when specified for top/left/bottom/right
-// rather than make the css module depend on the offset module, we just check for it here
-jQuery.each( [ "top", "left" ], function( i, prop ) {
+// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
+// getComputedStyle returns percent when specified for top/left/bottom/right;
+// rather than make the css module depend on the offset module, just check for it here
+jQuery.each( [ "top", "left" ], function( _i, prop ) {
        jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
                function( elem, computed ) {
                        if ( computed ) {
                                computed = curCSS( elem, prop );
 
-                               // if curCSS returns percentage, fallback to offset
+                               // If curCSS returns percentage, fallback to offset
                                return rnumnonpx.test( computed ) ?
                                        jQuery( elem ).position()[ prop ] + "px" :
                                        computed;
@@ -10897,10 +10475,13 @@ jQuery.each( [ "top", "left" ], function( i, prop ) {
 
 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-       jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
-       function( defaultExtra, funcName ) {
+       jQuery.each( {
+               padding: "inner" + name,
+               content: type,
+               "": "outer" + name
+       }, function( defaultExtra, funcName ) {
 
-               // margin is only for outerHeight, outerWidth
+               // Margin is only for outerHeight, outerWidth
                jQuery.fn[ funcName ] = function( margin, value ) {
                        var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
                                extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
@@ -10908,12 +10489,12 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
                        return access( this, function( elem, type, value ) {
                                var doc;
 
-                               if ( jQuery.isWindow( elem ) ) {
+                               if ( isWindow( elem ) ) {
 
-                                       // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
-                                       // isn't a whole lot we can do. See pull request at this URL for discussion:
-                                       // https://github.com/jquery/jquery/pull/764
-                                       return elem.document.documentElement[ "client" + name ];
+                                       // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
+                                       return funcName.indexOf( "outer" ) === 0 ?
+                                               elem[ "inner" + name ] :
+                                               elem.document.documentElement[ "client" + name ];
                                }
 
                                // Get document width or height
@@ -10922,8 +10503,6 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
 
                                        // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
                                        // whichever is greatest
-                                       // unfortunately, this causes bug #3838 in IE6/8 only,
-                                       // but there is currently no good, small way to fix it.
                                        return Math.max(
                                                elem.body[ "scroll" + name ], doc[ "scroll" + name ],
                                                elem.body[ "offset" + name ], doc[ "offset" + name ],
@@ -10938,12 +10517,28 @@ jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
 
                                        // Set width or height on the element
                                        jQuery.style( elem, type, value, extra );
-                       }, type, chainable ? margin : undefined, chainable, null );
+                       }, type, chainable ? margin : undefined, chainable );
                };
        } );
 } );
 
 
+jQuery.each( [
+       "ajaxStart",
+       "ajaxStop",
+       "ajaxComplete",
+       "ajaxError",
+       "ajaxSuccess",
+       "ajaxSend"
+], function( _i, type ) {
+       jQuery.fn[ type ] = function( fn ) {
+               return this.on( type, fn );
+       };
+} );
+
+
+
+
 jQuery.fn.extend( {
 
        bind: function( types, data, fn ) {
@@ -10962,16 +10557,106 @@ jQuery.fn.extend( {
                return arguments.length === 1 ?
                        this.off( selector, "**" ) :
                        this.off( types, selector || "**", fn );
+       },
+
+       hover: function( fnOver, fnOut ) {
+               return this
+                       .on( "mouseenter", fnOver )
+                       .on( "mouseleave", fnOut || fnOver );
        }
 } );
 
-// The number of elements contained in the matched element set
-jQuery.fn.size = function() {
-       return this.length;
+jQuery.each(
+       ( "blur focus focusin focusout resize scroll click dblclick " +
+       "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+       "change select submit keydown keypress keyup contextmenu" ).split( " " ),
+       function( _i, name ) {
+
+               // Handle event binding
+               jQuery.fn[ name ] = function( data, fn ) {
+                       return arguments.length > 0 ?
+                               this.on( name, null, data, fn ) :
+                               this.trigger( name );
+               };
+       }
+);
+
+
+
+
+// Support: Android <=4.0 only
+// Make sure we trim BOM and NBSP
+// Require that the "whitespace run" starts from a non-whitespace
+// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
+var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
+
+// Bind a function to a context, optionally partially applying any
+// arguments.
+// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
+// However, it is not slated for removal any time soon
+jQuery.proxy = function( fn, context ) {
+       var tmp, args, proxy;
+
+       if ( typeof context === "string" ) {
+               tmp = fn[ context ];
+               context = fn;
+               fn = tmp;
+       }
+
+       // Quick check to determine if target is callable, in the spec
+       // this throws a TypeError, but we will just return undefined.
+       if ( !isFunction( fn ) ) {
+               return undefined;
+       }
+
+       // Simulated bind
+       args = slice.call( arguments, 2 );
+       proxy = function() {
+               return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+       };
+
+       // Set the guid of unique handler to the same of original handler, so it can be removed
+       proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+       return proxy;
 };
 
-jQuery.fn.andSelf = jQuery.fn.addBack;
+jQuery.holdReady = function( hold ) {
+       if ( hold ) {
+               jQuery.readyWait++;
+       } else {
+               jQuery.ready( true );
+       }
+};
+jQuery.isArray = Array.isArray;
+jQuery.parseJSON = JSON.parse;
+jQuery.nodeName = nodeName;
+jQuery.isFunction = isFunction;
+jQuery.isWindow = isWindow;
+jQuery.camelCase = camelCase;
+jQuery.type = toType;
+
+jQuery.now = Date.now;
+
+jQuery.isNumeric = function( obj ) {
+
+       // As of jQuery 3.0, isNumeric is limited to
+       // strings and numbers (primitives or objects)
+       // that can be coerced to finite numbers (gh-2662)
+       var type = jQuery.type( obj );
+       return ( type === "number" || type === "string" ) &&
+
+               // parseFloat NaNs numeric-cast false positives ("")
+               // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+               // subtraction forces infinities to NaN
+               !isNaN( obj - parseFloat( obj ) );
+};
 
+jQuery.trim = function( text ) {
+       return text == null ?
+               "" :
+               ( text + "" ).replace( rtrim, "$1" );
+};
 
 
 
@@ -10996,6 +10681,7 @@ if ( typeof define === "function" && define.amd ) {
 
 
 
+
 var
 
        // Map over jQuery in case of overwrite
@@ -11016,12 +10702,15 @@ jQuery.noConflict = function( deep ) {
        return jQuery;
 };
 
-// Expose jQuery and $ identifiers, even in
-// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
-// and CommonJS for browser emulators (#13566)
-if ( !noGlobal ) {
+// Expose jQuery and $ identifiers, even in AMD
+// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (trac-13566)
+if ( typeof noGlobal === "undefined" ) {
        window.jQuery = window.$ = jQuery;
 }
 
+
+
+
 return jQuery;
-}));
+} );
index 2e559835a0acf9bc03ffef58fc824739bbb1f7f1..480b9fb3db5980b18af0b26b020d470fbc74ecb8 100644 (file)
@@ -1,5 +1,5 @@
 //! moment.js
-//! version : 2.29.2
+//! version : 2.30.1
 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
 //! license : MIT
 //! momentjs.com
     }
 
     function isValid(m) {
-        if (m._isValid == null) {
-            var flags = getParsingFlags(m),
-                parsedParts = some.call(flags.parsedDateParts, function (i) {
-                    return i != null;
-                }),
-                isNowValid =
-                    !isNaN(m._d.getTime()) &&
-                    flags.overflow < 0 &&
-                    !flags.empty &&
-                    !flags.invalidEra &&
-                    !flags.invalidMonth &&
-                    !flags.invalidWeekday &&
-                    !flags.weekdayMismatch &&
-                    !flags.nullInput &&
-                    !flags.invalidFormat &&
-                    !flags.userInvalidated &&
-                    (!flags.meridiem || (flags.meridiem && parsedParts));
-
+        var flags = null,
+            parsedParts = false,
+            isNowValid = m._d && !isNaN(m._d.getTime());
+        if (isNowValid) {
+            flags = getParsingFlags(m);
+            parsedParts = some.call(flags.parsedDateParts, function (i) {
+                return i != null;
+            });
+            isNowValid =
+                flags.overflow < 0 &&
+                !flags.empty &&
+                !flags.invalidEra &&
+                !flags.invalidMonth &&
+                !flags.invalidWeekday &&
+                !flags.weekdayMismatch &&
+                !flags.nullInput &&
+                !flags.invalidFormat &&
+                !flags.userInvalidated &&
+                (!flags.meridiem || (flags.meridiem && parsedParts));
             if (m._strict) {
                 isNowValid =
                     isNowValid &&
                     flags.unusedTokens.length === 0 &&
                     flags.bigHour === undefined;
             }
-
-            if (Object.isFrozen == null || !Object.isFrozen(m)) {
-                m._isValid = isNowValid;
-            } else {
-                return isNowValid;
-            }
+        }
+        if (Object.isFrozen == null || !Object.isFrozen(m)) {
+            m._isValid = isNowValid;
+        } else {
+            return isNowValid;
         }
         return m._isValid;
     }
         return isFunction(format) ? format(output) : format.replace(/%s/i, output);
     }
 
-    var aliases = {};
-
-    function addUnitAlias(unit, shorthand) {
-        var lowerCase = unit.toLowerCase();
-        aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
-    }
+    var aliases = {
+        D: 'date',
+        dates: 'date',
+        date: 'date',
+        d: 'day',
+        days: 'day',
+        day: 'day',
+        e: 'weekday',
+        weekdays: 'weekday',
+        weekday: 'weekday',
+        E: 'isoWeekday',
+        isoweekdays: 'isoWeekday',
+        isoweekday: 'isoWeekday',
+        DDD: 'dayOfYear',
+        dayofyears: 'dayOfYear',
+        dayofyear: 'dayOfYear',
+        h: 'hour',
+        hours: 'hour',
+        hour: 'hour',
+        ms: 'millisecond',
+        milliseconds: 'millisecond',
+        millisecond: 'millisecond',
+        m: 'minute',
+        minutes: 'minute',
+        minute: 'minute',
+        M: 'month',
+        months: 'month',
+        month: 'month',
+        Q: 'quarter',
+        quarters: 'quarter',
+        quarter: 'quarter',
+        s: 'second',
+        seconds: 'second',
+        second: 'second',
+        gg: 'weekYear',
+        weekyears: 'weekYear',
+        weekyear: 'weekYear',
+        GG: 'isoWeekYear',
+        isoweekyears: 'isoWeekYear',
+        isoweekyear: 'isoWeekYear',
+        w: 'week',
+        weeks: 'week',
+        week: 'week',
+        W: 'isoWeek',
+        isoweeks: 'isoWeek',
+        isoweek: 'isoWeek',
+        y: 'year',
+        years: 'year',
+        year: 'year',
+    };
 
     function normalizeUnits(units) {
         return typeof units === 'string'
         return normalizedInput;
     }
 
-    var priorities = {};
-
-    function addUnitPriority(unit, priority) {
-        priorities[unit] = priority;
-    }
+    var priorities = {
+        date: 9,
+        day: 11,
+        weekday: 11,
+        isoWeekday: 11,
+        dayOfYear: 4,
+        hour: 13,
+        millisecond: 16,
+        minute: 14,
+        month: 8,
+        quarter: 7,
+        second: 15,
+        weekYear: 1,
+        isoWeekYear: 1,
+        week: 5,
+        isoWeek: 5,
+        year: 1,
+    };
 
     function getPrioritizedUnits(unitsObj) {
         var units = [],
         return units;
     }
 
-    function isLeapYear(year) {
-        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
-    }
-
-    function absFloor(number) {
-        if (number < 0) {
-            // -0 -> 0
-            return Math.ceil(number) || 0;
-        } else {
-            return Math.floor(number);
-        }
-    }
-
-    function toInt(argumentForCoercion) {
-        var coercedNumber = +argumentForCoercion,
-            value = 0;
-
-        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
-            value = absFloor(coercedNumber);
-        }
-
-        return value;
-    }
-
-    function makeGetSet(unit, keepTime) {
-        return function (value) {
-            if (value != null) {
-                set$1(this, unit, value);
-                hooks.updateOffset(this, keepTime);
-                return this;
-            } else {
-                return get(this, unit);
-            }
-        };
-    }
-
-    function get(mom, unit) {
-        return mom.isValid()
-            ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
-            : NaN;
-    }
-
-    function set$1(mom, unit, value) {
-        if (mom.isValid() && !isNaN(value)) {
-            if (
-                unit === 'FullYear' &&
-                isLeapYear(mom.year()) &&
-                mom.month() === 1 &&
-                mom.date() === 29
-            ) {
-                value = toInt(value);
-                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
-                    value,
-                    mom.month(),
-                    daysInMonth(value, mom.month())
-                );
-            } else {
-                mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
-            }
-        }
-    }
-
-    // MOMENTS
-
-    function stringGet(units) {
-        units = normalizeUnits(units);
-        if (isFunction(this[units])) {
-            return this[units]();
-        }
-        return this;
-    }
-
-    function stringSet(units, value) {
-        if (typeof units === 'object') {
-            units = normalizeObjectUnits(units);
-            var prioritized = getPrioritizedUnits(units),
-                i,
-                prioritizedLen = prioritized.length;
-            for (i = 0; i < prioritizedLen; i++) {
-                this[prioritized[i].unit](units[prioritized[i].unit]);
-            }
-        } else {
-            units = normalizeUnits(units);
-            if (isFunction(this[units])) {
-                return this[units](value);
-            }
-        }
-        return this;
-    }
-
     var match1 = /\d/, //       0 - 9
         match2 = /\d\d/, //      00 - 99
         match3 = /\d{3}/, //     000 - 999
         // includes scottish gaelic two word and hyphenated months
         matchWord =
             /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
+        match1to2NoLeadingZero = /^[1-9]\d?/, //         1-99
+        match1to2HasZero = /^([1-9]\d|\d)/, //           0-99
         regexes;
 
     regexes = {};
         return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
     }
 
+    function absFloor(number) {
+        if (number < 0) {
+            // -0 -> 0
+            return Math.ceil(number) || 0;
+        } else {
+            return Math.floor(number);
+        }
+    }
+
+    function toInt(argumentForCoercion) {
+        var coercedNumber = +argumentForCoercion,
+            value = 0;
+
+        if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+            value = absFloor(coercedNumber);
+        }
+
+        return value;
+    }
+
     var tokens = {};
 
     function addParseToken(token, callback) {
         }
     }
 
+    function isLeapYear(year) {
+        return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+    }
+
     var YEAR = 0,
         MONTH = 1,
         DATE = 2,
         WEEK = 7,
         WEEKDAY = 8;
 
+    // FORMATTING
+
+    addFormatToken('Y', 0, 0, function () {
+        var y = this.year();
+        return y <= 9999 ? zeroFill(y, 4) : '+' + y;
+    });
+
+    addFormatToken(0, ['YY', 2], 0, function () {
+        return this.year() % 100;
+    });
+
+    addFormatToken(0, ['YYYY', 4], 0, 'year');
+    addFormatToken(0, ['YYYYY', 5], 0, 'year');
+    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+    // PARSING
+
+    addRegexToken('Y', matchSigned);
+    addRegexToken('YY', match1to2, match2);
+    addRegexToken('YYYY', match1to4, match4);
+    addRegexToken('YYYYY', match1to6, match6);
+    addRegexToken('YYYYYY', match1to6, match6);
+
+    addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+    addParseToken('YYYY', function (input, array) {
+        array[YEAR] =
+            input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
+    });
+    addParseToken('YY', function (input, array) {
+        array[YEAR] = hooks.parseTwoDigitYear(input);
+    });
+    addParseToken('Y', function (input, array) {
+        array[YEAR] = parseInt(input, 10);
+    });
+
+    // HELPERS
+
+    function daysInYear(year) {
+        return isLeapYear(year) ? 366 : 365;
+    }
+
+    // HOOKS
+
+    hooks.parseTwoDigitYear = function (input) {
+        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+    };
+
+    // MOMENTS
+
+    var getSetYear = makeGetSet('FullYear', true);
+
+    function getIsLeapYear() {
+        return isLeapYear(this.year());
+    }
+
+    function makeGetSet(unit, keepTime) {
+        return function (value) {
+            if (value != null) {
+                set$1(this, unit, value);
+                hooks.updateOffset(this, keepTime);
+                return this;
+            } else {
+                return get(this, unit);
+            }
+        };
+    }
+
+    function get(mom, unit) {
+        if (!mom.isValid()) {
+            return NaN;
+        }
+
+        var d = mom._d,
+            isUTC = mom._isUTC;
+
+        switch (unit) {
+            case 'Milliseconds':
+                return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
+            case 'Seconds':
+                return isUTC ? d.getUTCSeconds() : d.getSeconds();
+            case 'Minutes':
+                return isUTC ? d.getUTCMinutes() : d.getMinutes();
+            case 'Hours':
+                return isUTC ? d.getUTCHours() : d.getHours();
+            case 'Date':
+                return isUTC ? d.getUTCDate() : d.getDate();
+            case 'Day':
+                return isUTC ? d.getUTCDay() : d.getDay();
+            case 'Month':
+                return isUTC ? d.getUTCMonth() : d.getMonth();
+            case 'FullYear':
+                return isUTC ? d.getUTCFullYear() : d.getFullYear();
+            default:
+                return NaN; // Just in case
+        }
+    }
+
+    function set$1(mom, unit, value) {
+        var d, isUTC, year, month, date;
+
+        if (!mom.isValid() || isNaN(value)) {
+            return;
+        }
+
+        d = mom._d;
+        isUTC = mom._isUTC;
+
+        switch (unit) {
+            case 'Milliseconds':
+                return void (isUTC
+                    ? d.setUTCMilliseconds(value)
+                    : d.setMilliseconds(value));
+            case 'Seconds':
+                return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
+            case 'Minutes':
+                return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
+            case 'Hours':
+                return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
+            case 'Date':
+                return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
+            // case 'Day': // Not real
+            //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
+            // case 'Month': // Not used because we need to pass two variables
+            //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
+            case 'FullYear':
+                break; // See below ...
+            default:
+                return; // Just in case
+        }
+
+        year = value;
+        month = mom.month();
+        date = mom.date();
+        date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
+        void (isUTC
+            ? d.setUTCFullYear(year, month, date)
+            : d.setFullYear(year, month, date));
+    }
+
+    // MOMENTS
+
+    function stringGet(units) {
+        units = normalizeUnits(units);
+        if (isFunction(this[units])) {
+            return this[units]();
+        }
+        return this;
+    }
+
+    function stringSet(units, value) {
+        if (typeof units === 'object') {
+            units = normalizeObjectUnits(units);
+            var prioritized = getPrioritizedUnits(units),
+                i,
+                prioritizedLen = prioritized.length;
+            for (i = 0; i < prioritizedLen; i++) {
+                this[prioritized[i].unit](units[prioritized[i].unit]);
+            }
+        } else {
+            units = normalizeUnits(units);
+            if (isFunction(this[units])) {
+                return this[units](value);
+            }
+        }
+        return this;
+    }
+
     function mod(n, x) {
         return ((n % x) + x) % x;
     }
         return this.localeData().months(this, format);
     });
 
-    // ALIASES
-
-    addUnitAlias('month', 'M');
-
-    // PRIORITY
-
-    addUnitPriority('month', 8);
-
     // PARSING
 
-    addRegexToken('M', match1to2);
+    addRegexToken('M', match1to2, match1to2NoLeadingZero);
     addRegexToken('MM', match1to2, match2);
     addRegexToken('MMM', function (isStrict, locale) {
         return locale.monthsShortRegex(isStrict);
     // MOMENTS
 
     function setMonth(mom, value) {
-        var dayOfMonth;
-
         if (!mom.isValid()) {
             // No op
             return mom;
             }
         }
 
-        dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
-        mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+        var month = value,
+            date = mom.date();
+
+        date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
+        void (mom._isUTC
+            ? mom._d.setUTCMonth(month, date)
+            : mom._d.setMonth(month, date));
         return mom;
     }
 
             longPieces = [],
             mixedPieces = [],
             i,
-            mom;
+            mom,
+            shortP,
+            longP;
         for (i = 0; i < 12; i++) {
             // make the regex if we don't have it already
             mom = createUTC([2000, i]);
-            shortPieces.push(this.monthsShort(mom, ''));
-            longPieces.push(this.months(mom, ''));
-            mixedPieces.push(this.months(mom, ''));
-            mixedPieces.push(this.monthsShort(mom, ''));
+            shortP = regexEscape(this.monthsShort(mom, ''));
+            longP = regexEscape(this.months(mom, ''));
+            shortPieces.push(shortP);
+            longPieces.push(longP);
+            mixedPieces.push(longP);
+            mixedPieces.push(shortP);
         }
         // Sorting makes sure if one month (or abbr) is a prefix of another it
         // will match the longer piece.
         shortPieces.sort(cmpLenRev);
         longPieces.sort(cmpLenRev);
         mixedPieces.sort(cmpLenRev);
-        for (i = 0; i < 12; i++) {
-            shortPieces[i] = regexEscape(shortPieces[i]);
-            longPieces[i] = regexEscape(longPieces[i]);
-        }
-        for (i = 0; i < 24; i++) {
-            mixedPieces[i] = regexEscape(mixedPieces[i]);
-        }
 
         this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
         this._monthsShortRegex = this._monthsRegex;
         );
     }
 
-    // FORMATTING
-
-    addFormatToken('Y', 0, 0, function () {
-        var y = this.year();
-        return y <= 9999 ? zeroFill(y, 4) : '+' + y;
-    });
-
-    addFormatToken(0, ['YY', 2], 0, function () {
-        return this.year() % 100;
-    });
-
-    addFormatToken(0, ['YYYY', 4], 0, 'year');
-    addFormatToken(0, ['YYYYY', 5], 0, 'year');
-    addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
-
-    // ALIASES
-
-    addUnitAlias('year', 'y');
-
-    // PRIORITIES
-
-    addUnitPriority('year', 1);
-
-    // PARSING
-
-    addRegexToken('Y', matchSigned);
-    addRegexToken('YY', match1to2, match2);
-    addRegexToken('YYYY', match1to4, match4);
-    addRegexToken('YYYYY', match1to6, match6);
-    addRegexToken('YYYYYY', match1to6, match6);
-
-    addParseToken(['YYYYY', 'YYYYYY'], YEAR);
-    addParseToken('YYYY', function (input, array) {
-        array[YEAR] =
-            input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
-    });
-    addParseToken('YY', function (input, array) {
-        array[YEAR] = hooks.parseTwoDigitYear(input);
-    });
-    addParseToken('Y', function (input, array) {
-        array[YEAR] = parseInt(input, 10);
-    });
-
-    // HELPERS
-
-    function daysInYear(year) {
-        return isLeapYear(year) ? 366 : 365;
-    }
-
-    // HOOKS
-
-    hooks.parseTwoDigitYear = function (input) {
-        return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
-    };
-
-    // MOMENTS
-
-    var getSetYear = makeGetSet('FullYear', true);
-
-    function getIsLeapYear() {
-        return isLeapYear(this.year());
-    }
-
     function createDate(y, m, d, h, M, s, ms) {
         // can't just apply() to create a date:
         // https://stackoverflow.com/q/181348
     addFormatToken('w', ['ww', 2], 'wo', 'week');
     addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
 
-    // ALIASES
-
-    addUnitAlias('week', 'w');
-    addUnitAlias('isoWeek', 'W');
-
-    // PRIORITIES
-
-    addUnitPriority('week', 5);
-    addUnitPriority('isoWeek', 5);
-
     // PARSING
 
-    addRegexToken('w', match1to2);
+    addRegexToken('w', match1to2, match1to2NoLeadingZero);
     addRegexToken('ww', match1to2, match2);
-    addRegexToken('W', match1to2);
+    addRegexToken('W', match1to2, match1to2NoLeadingZero);
     addRegexToken('WW', match1to2, match2);
 
     addWeekParseToken(
     addFormatToken('e', 0, 0, 'weekday');
     addFormatToken('E', 0, 0, 'isoWeekday');
 
-    // ALIASES
-
-    addUnitAlias('day', 'd');
-    addUnitAlias('weekday', 'e');
-    addUnitAlias('isoWeekday', 'E');
-
-    // PRIORITY
-    addUnitPriority('day', 11);
-    addUnitPriority('weekday', 11);
-    addUnitPriority('isoWeekday', 11);
-
     // PARSING
 
     addRegexToken('d', match1to2);
         return m === true
             ? shiftWeekdays(weekdays, this._week.dow)
             : m
-            ? weekdays[m.day()]
-            : weekdays;
+              ? weekdays[m.day()]
+              : weekdays;
     }
 
     function localeWeekdaysShort(m) {
         return m === true
             ? shiftWeekdays(this._weekdaysShort, this._week.dow)
             : m
-            ? this._weekdaysShort[m.day()]
-            : this._weekdaysShort;
+              ? this._weekdaysShort[m.day()]
+              : this._weekdaysShort;
     }
 
     function localeWeekdaysMin(m) {
         return m === true
             ? shiftWeekdays(this._weekdaysMin, this._week.dow)
             : m
-            ? this._weekdaysMin[m.day()]
-            : this._weekdaysMin;
+              ? this._weekdaysMin[m.day()]
+              : this._weekdaysMin;
     }
 
     function handleStrictParse$1(weekdayName, format, strict) {
         if (!this.isValid()) {
             return input != null ? this : NaN;
         }
-        var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+
+        var day = get(this, 'Day');
         if (input != null) {
             input = parseWeekday(input, this.localeData());
             return this.add(input - day, 'd');
     meridiem('a', true);
     meridiem('A', false);
 
-    // ALIASES
-
-    addUnitAlias('hour', 'h');
-
-    // PRIORITY
-    addUnitPriority('hour', 13);
-
     // PARSING
 
     function matchMeridiem(isStrict, locale) {
 
     addRegexToken('a', matchMeridiem);
     addRegexToken('A', matchMeridiem);
-    addRegexToken('H', match1to2);
-    addRegexToken('h', match1to2);
-    addRegexToken('k', match1to2);
+    addRegexToken('H', match1to2, match1to2HasZero);
+    addRegexToken('h', match1to2, match1to2NoLeadingZero);
+    addRegexToken('k', match1to2, match1to2NoLeadingZero);
     addRegexToken('HH', match1to2, match2);
     addRegexToken('hh', match1to2, match2);
     addRegexToken('kk', match1to2, match2);
 
     function isLocaleNameSane(name) {
         // Prevent names that look like filesystem paths, i.e contain '/' or '\'
-        return name.match('^[^/\\\\]*$') != null;
+        // Ensure name is available and function returns boolean
+        return !!(name && name.match('^[^/\\\\]*$'));
     }
 
     function loadLocale(name) {
                 a[MONTH] < 0 || a[MONTH] > 11
                     ? MONTH
                     : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
-                    ? DATE
-                    : a[HOUR] < 0 ||
-                      a[HOUR] > 24 ||
-                      (a[HOUR] === 24 &&
-                          (a[MINUTE] !== 0 ||
-                              a[SECOND] !== 0 ||
-                              a[MILLISECOND] !== 0))
-                    ? HOUR
-                    : a[MINUTE] < 0 || a[MINUTE] > 59
-                    ? MINUTE
-                    : a[SECOND] < 0 || a[SECOND] > 59
-                    ? SECOND
-                    : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
-                    ? MILLISECOND
-                    : -1;
+                      ? DATE
+                      : a[HOUR] < 0 ||
+                          a[HOUR] > 24 ||
+                          (a[HOUR] === 24 &&
+                              (a[MINUTE] !== 0 ||
+                                  a[SECOND] !== 0 ||
+                                  a[MILLISECOND] !== 0))
+                        ? HOUR
+                        : a[MINUTE] < 0 || a[MINUTE] > 59
+                          ? MINUTE
+                          : a[SECOND] < 0 || a[SECOND] > 59
+                            ? SECOND
+                            : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
+                              ? MILLISECOND
+                              : -1;
 
             if (
                 getParsingFlags(m)._overflowDayOfYear &&
     function preprocessRFC2822(s) {
         // Remove comments and folding whitespace and replace multiple-spaces with a single space
         return s
-            .replace(/\([^)]*\)|[\n\t]/g, ' ')
+            .replace(/\([^()]*\)|[\n\t]/g, ' ')
             .replace(/(\s\s+)/g, ' ')
             .replace(/^\s\s*/, '')
             .replace(/\s\s*$/, '');
         return diff < -6
             ? 'sameElse'
             : diff < -1
-            ? 'lastWeek'
-            : diff < 0
-            ? 'lastDay'
-            : diff < 1
-            ? 'sameDay'
-            : diff < 2
-            ? 'nextDay'
-            : diff < 7
-            ? 'nextWeek'
-            : 'sameElse';
+              ? 'lastWeek'
+              : diff < 0
+                ? 'lastDay'
+                : diff < 1
+                  ? 'sameDay'
+                  : diff < 2
+                    ? 'nextDay'
+                    : diff < 7
+                      ? 'nextWeek'
+                      : 'sameElse';
     }
 
     function calendar$1(time, formats) {
             mixedPieces = [],
             i,
             l,
+            erasName,
+            erasAbbr,
+            erasNarrow,
             eras = this.eras();
 
         for (i = 0, l = eras.length; i < l; ++i) {
-            namePieces.push(regexEscape(eras[i].name));
-            abbrPieces.push(regexEscape(eras[i].abbr));
-            narrowPieces.push(regexEscape(eras[i].narrow));
+            erasName = regexEscape(eras[i].name);
+            erasAbbr = regexEscape(eras[i].abbr);
+            erasNarrow = regexEscape(eras[i].narrow);
 
-            mixedPieces.push(regexEscape(eras[i].name));
-            mixedPieces.push(regexEscape(eras[i].abbr));
-            mixedPieces.push(regexEscape(eras[i].narrow));
+            namePieces.push(erasName);
+            abbrPieces.push(erasAbbr);
+            narrowPieces.push(erasNarrow);
+            mixedPieces.push(erasName);
+            mixedPieces.push(erasAbbr);
+            mixedPieces.push(erasNarrow);
         }
 
         this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
 
     // ALIASES
 
-    addUnitAlias('weekYear', 'gg');
-    addUnitAlias('isoWeekYear', 'GG');
-
-    // PRIORITY
-
-    addUnitPriority('weekYear', 1);
-    addUnitPriority('isoWeekYear', 1);
-
     // PARSING
 
     addRegexToken('G', matchSigned);
             this,
             input,
             this.week(),
-            this.weekday(),
+            this.weekday() + this.localeData()._week.dow,
             this.localeData()._week.dow,
             this.localeData()._week.doy
         );
 
     addFormatToken('Q', 0, 'Qo', 'quarter');
 
-    // ALIASES
-
-    addUnitAlias('quarter', 'Q');
-
-    // PRIORITY
-
-    addUnitPriority('quarter', 7);
-
     // PARSING
 
     addRegexToken('Q', match1);
 
     addFormatToken('D', ['DD', 2], 'Do', 'date');
 
-    // ALIASES
-
-    addUnitAlias('date', 'D');
-
-    // PRIORITY
-    addUnitPriority('date', 9);
-
     // PARSING
 
-    addRegexToken('D', match1to2);
+    addRegexToken('D', match1to2, match1to2NoLeadingZero);
     addRegexToken('DD', match1to2, match2);
     addRegexToken('Do', function (isStrict, locale) {
         // TODO: Remove "ordinalParse" fallback in next major release.
 
     addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
 
-    // ALIASES
-
-    addUnitAlias('dayOfYear', 'DDD');
-
-    // PRIORITY
-    addUnitPriority('dayOfYear', 4);
-
     // PARSING
 
     addRegexToken('DDD', match1to3);
 
     addFormatToken('m', ['mm', 2], 0, 'minute');
 
-    // ALIASES
-
-    addUnitAlias('minute', 'm');
-
-    // PRIORITY
-
-    addUnitPriority('minute', 14);
-
     // PARSING
 
-    addRegexToken('m', match1to2);
+    addRegexToken('m', match1to2, match1to2HasZero);
     addRegexToken('mm', match1to2, match2);
     addParseToken(['m', 'mm'], MINUTE);
 
 
     addFormatToken('s', ['ss', 2], 0, 'second');
 
-    // ALIASES
-
-    addUnitAlias('second', 's');
-
-    // PRIORITY
-
-    addUnitPriority('second', 15);
-
     // PARSING
 
-    addRegexToken('s', match1to2);
+    addRegexToken('s', match1to2, match1to2HasZero);
     addRegexToken('ss', match1to2, match2);
     addParseToken(['s', 'ss'], SECOND);
 
         return this.millisecond() * 1000000;
     });
 
-    // ALIASES
-
-    addUnitAlias('millisecond', 'ms');
-
-    // PRIORITY
-
-    addUnitPriority('millisecond', 16);
-
     // PARSING
 
     addRegexToken('S', match1to3, match1);
                     toInt((number % 100) / 10) === 1
                         ? 'th'
                         : b === 1
-                        ? 'st'
-                        : b === 2
-                        ? 'nd'
-                        : b === 3
-                        ? 'rd'
-                        : 'th';
+                          ? 'st'
+                          : b === 2
+                            ? 'nd'
+                            : b === 3
+                              ? 'rd'
+                              : 'th';
             return number + output;
         },
     });
         }
     }
 
-    // TODO: Use this.as('ms')?
-    function valueOf$1() {
-        if (!this.isValid()) {
-            return NaN;
-        }
-        return (
-            this._milliseconds +
-            this._days * 864e5 +
-            (this._months % 12) * 2592e6 +
-            toInt(this._months / 12) * 31536e6
-        );
-    }
-
     function makeAs(alias) {
         return function () {
             return this.as(alias);
         asWeeks = makeAs('w'),
         asMonths = makeAs('M'),
         asQuarters = makeAs('Q'),
-        asYears = makeAs('y');
+        asYears = makeAs('y'),
+        valueOf$1 = asMilliseconds;
 
     function clone$1() {
         return createDuration(this);
 
     //! moment.js
 
-    hooks.version = '2.29.2';
+    hooks.version = '2.30.1';
 
     setHookCallback(createLocal);
 
index c2d5519ce6d8d0cbd4b2fff450a38d91af7a8856..177c4eab7b64232b80f2ae3a3281808ffc753f0f 100644 (file)
@@ -9,9 +9,10 @@
         root.Rickshaw = factory(d3);
     }
 }(this, function (d3) {
-/* jshint -W079 */ 
+/* jshint -W079 */
 
 var Rickshaw = {
+       version: '1.7.0',
 
        namespace: function(namespace, obj) {
 
@@ -415,9 +416,8 @@ Rickshaw.Graph = function(args) {
 
                this._loadRenderers();
                this.configure(args);
-               this.validateSeries(args.series);
+               this.setSeries(args.series);
 
-               this.series.active = function() { return self.series.filter( function(s) { return !s.disabled } ) };
                this.setSize({ width: args.width, height: args.height });
                this.element.classList.add('rickshaw_graph');
 
@@ -459,7 +459,7 @@ Rickshaw.Graph = function(args) {
                        if (!Array.isArray(s.data)) {
                                throw "series data is not an array: " + JSON.stringify(s.data);
                        }
-                       
+
                        if (s.data.length > 0) {
                                var x = s.data[0].x;
                                var y = s.data[0].y;
@@ -480,6 +480,12 @@ Rickshaw.Graph = function(args) {
                }, this );
        };
 
+       this.setSeries = function(series) {
+               this.validateSeries(series);
+               this.series = series;
+               this.series.active = function() { return self.series.filter( function(s) { return !s.disabled } ) };
+       };
+
        this.dataDomain = function() {
 
                var data = this.series.map( function(s) { return s.data } );
@@ -690,14 +696,21 @@ Rickshaw.Graph = function(args) {
 
                args = args || {};
 
-               if (typeof window !== undefined) {
-                       var style = window.getComputedStyle(this.element, null);
-                       var elementWidth = parseInt(style.getPropertyValue('width'), 10);
-                       var elementHeight = parseInt(style.getPropertyValue('height'), 10);
-               }
+               if (args.width && args.height) {
+                       // use explicitly specified size
+                       this.width = args.width;
+                       this.height = args.height;
+               } else {
+                       // calc size (will cause layout reflow)
+                       if (typeof window !== 'undefined') {
+                               var style = window.getComputedStyle(this.element, null);
+                               var elementWidth = parseInt(style.getPropertyValue('width'), 10);
+                               var elementHeight = parseInt(style.getPropertyValue('height'), 10);
+                       }
 
-               this.width = args.width || elementWidth || 400;
-               this.height = args.height || elementHeight || 250;
+                       this.width = args.width || elementWidth || 400;
+                       this.height = args.height || elementHeight || 250;
+               }
 
                this.vis && this.vis
                        .attr('width', this.width)
@@ -948,7 +961,7 @@ Rickshaw.Fixtures.Time = function() {
                }, {
                        name: 'minute',
                        seconds: 60,
-                       formatter: function(d) { return d.getUTCMinutes() }
+                       formatter: function(d) { return d.getUTCMinutes() + 'm' }
                }, {
                        name: '15 second',
                        seconds: 15,
@@ -1097,20 +1110,20 @@ Rickshaw.Fixtures.Time.Local = function() {
 
        this.ceil = function(time, unit) {
 
-               var date, floor, year;
+               var date, floor, year, offset;
 
                if (unit.name == 'day') {
 
                        var nearFuture = new Date((time + unit.seconds - 1) * 1000);
 
                        var rounded = new Date(0);
+                       rounded.setFullYear(nearFuture.getFullYear());
+                       rounded.setMonth(nearFuture.getMonth());
+                       rounded.setDate(nearFuture.getDate());
                        rounded.setMilliseconds(0);
                        rounded.setSeconds(0);
                        rounded.setMinutes(0);
                        rounded.setHours(0);
-                       rounded.setDate(nearFuture.getDate());
-                       rounded.setMonth(nearFuture.getMonth());
-                       rounded.setFullYear(nearFuture.getFullYear());
 
                        return rounded.getTime() / 1000;
                }
@@ -1146,33 +1159,33 @@ Rickshaw.Fixtures.Time.Local = function() {
 
                        return new Date(year, 0).getTime() / 1000;
                }
-
-               return Math.ceil(time / unit.seconds) * unit.seconds;
+               offset = new Date(time * 1000).getTimezoneOffset() * 60;
+               return Math.ceil((time - offset) / unit.seconds) * unit.seconds + offset;
        };
 };
 Rickshaw.namespace('Rickshaw.Fixtures.Number');
 
 Rickshaw.Fixtures.Number.formatKMBT = function(y) {
        var abs_y = Math.abs(y);
-       if (abs_y >= 1000000000000)   { return y / 1000000000000 + "T" }
-       else if (abs_y >= 1000000000) { return y / 1000000000 + "B" }
-       else if (abs_y >= 1000000)    { return y / 1000000 + "M" }
-       else if (abs_y >= 1000)       { return y / 1000 + "K" }
-       else if (abs_y < 1 && y > 0)  { return y.toFixed(2) }
-       else if (abs_y === 0)         { return '' }
-       else                      { return y }
+       if (abs_y >= 1000000000000)      { return (y / 1000000000000).toFixed(2) + "T" }
+       else if (abs_y >= 1000000000)    { return (y / 1000000000).toFixed(2) + "B" }
+       else if (abs_y >= 1000000)       { return (y / 1000000).toFixed(2) + "M" }
+       else if (abs_y >= 1000)          { return (y / 1000).toFixed(2) + "K" }
+       else if (abs_y < 1 && abs_y > 0) { return y.toFixed(2) }
+       else if (abs_y === 0)            { return '0' }
+       else                             { return y }
 };
 
 Rickshaw.Fixtures.Number.formatBase1024KMGTP = function(y) {
-    var abs_y = Math.abs(y);
-    if (abs_y >= 1125899906842624)  { return y / 1125899906842624 + "P" }
-    else if (abs_y >= 1099511627776){ return y / 1099511627776 + "T" }
-    else if (abs_y >= 1073741824)   { return y / 1073741824 + "G" }
-    else if (abs_y >= 1048576)      { return y / 1048576 + "M" }
-    else if (abs_y >= 1024)         { return y / 1024 + "K" }
-    else if (abs_y < 1 && y > 0)    { return y.toFixed(2) }
-    else if (abs_y === 0)           { return '' }
-    else                        { return y }
+       var abs_y = Math.abs(y);
+       if (abs_y >= 1125899906842624)   { return (y / 1125899906842624).toFixed(2) + "P" }
+       else if (abs_y >= 1099511627776) { return (y / 1099511627776).toFixed(2) + "T" }
+       else if (abs_y >= 1073741824)    { return (y / 1073741824).toFixed(2) + "G" }
+       else if (abs_y >= 1048576)       { return (y / 1048576).toFixed(2) + "M" }
+       else if (abs_y >= 1024)          { return (y / 1024).toFixed(2) + "K" }
+       else if (abs_y < 1 && abs_y > 0) { return y.toFixed(2) }
+       else if (abs_y === 0)            { return '0' }
+       else                             { return y }
 };
 Rickshaw.namespace("Rickshaw.Color.Palette");
 
@@ -1497,6 +1510,7 @@ Rickshaw.Graph.Axis.X = function(args) {
 
                this.graph = args.graph;
                this.orientation = args.orientation || 'top';
+               this.color = args.color || "#000000";
 
                this.pixelsPerTick = args.pixelsPerTick || 75;
                if (args.ticks) this.staticTicks = args.ticks;
@@ -1514,6 +1528,7 @@ Rickshaw.Graph.Axis.X = function(args) {
                                .append("svg:svg")
                                .attr('height', this.height)
                                .attr('width', this.width)
+                               .attr('stroke', this.color)
                                .attr('class', 'rickshaw_graph x_axis_d3');
 
                        this.element = this.vis[0][0];
@@ -1554,13 +1569,15 @@ Rickshaw.Graph.Axis.X = function(args) {
                this.ticks = this.staticTicks || Math.floor(this.graph.width / this.pixelsPerTick);
 
                var berth = Math.floor(this.width * berthRate / 2) || 0;
+               var bar_offset = this.graph.renderer.name == "bar" && Math.ceil(this.graph.width * 0.95 / this.graph.series[0].data.length / 2) || 0;
+
                var transform;
 
                if (this.orientation == 'top') {
                        var yOffset = this.height || this.graph.height;
-                       transform = 'translate(' + berth + ',' + yOffset + ')';
+                       transform = 'translate(' + (berth + bar_offset) + ',' + yOffset + ')';
                } else {
-                       transform = 'translate(' + berth + ', 0)';
+                       transform = 'translate(' + (berth + bar_offset) + ', 0)';
                }
 
                if (this.element) {
@@ -1612,6 +1629,7 @@ Rickshaw.Graph.Axis.Y = Rickshaw.Class.create( {
 
                this.graph = args.graph;
                this.orientation = args.orientation || 'right';
+               this.color = args.color || "#000000";
 
                this.pixelsPerTick = args.pixelsPerTick || 75;
                if (args.ticks) this.staticTicks = args.ticks;
@@ -1629,6 +1647,7 @@ Rickshaw.Graph.Axis.Y = Rickshaw.Class.create( {
                        this.element = args.element;
                        this.vis = d3.select(args.element)
                                .append("svg:svg")
+                               .attr('stroke', this.color)
                                .attr('class', 'rickshaw_graph y_axis');
 
                        this.element = this.vis[0][0];
@@ -1790,13 +1809,23 @@ Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
 
        var self = this;
 
-       var colorSafe = {};
+       var propertiesSafe = {};
        var activeLine = null;
 
        var disabledColor = args.disabledColor || function(seriesColor) {
                return d3.interpolateRgb(seriesColor, d3.rgb('#d8d8d8'))(0.8).toString();
        };
 
+       var transformFn = args.transform || function(isActive, series) {
+               var newProperties = {};
+               if (!isActive) {
+                       // backwards compability
+                       newProperties.color = disabledColor(series.color);
+               }
+               return newProperties;
+       };
+
+
        this.addHighlightEvents = function (l) {
 
                l.element.addEventListener( 'mouseover', function(e) {
@@ -1805,8 +1834,11 @@ Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                        else activeLine = l;
 
                        self.legend.lines.forEach( function(line) {
+                               var newProperties;
+                               var isActive = false;
 
                                if (l === line) {
+                                       isActive = true;
 
                                        // if we're not in a stacked renderer bring active line to the top
                                        if (self.graph.renderer.unstack && (line.series.renderer ? line.series.renderer.unstack : true)) {
@@ -1817,11 +1849,21 @@ Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                                                var series = self.graph.series.splice(seriesIndex, 1)[0];
                                                self.graph.series.push(series);
                                        }
-                                       return;
                                }
 
-                               colorSafe[line.series.name] = colorSafe[line.series.name] || line.series.color;
-                               line.series.color = disabledColor(line.series.color);
+                               newProperties = transformFn(isActive, line.series);
+
+                               propertiesSafe[line.series.name] = propertiesSafe[line.series.name] || {
+                                       color   : line.series.color,
+                                       stroke  : line.series.stroke
+                               };
+
+                               if (newProperties.color) {
+                                       line.series.color = newProperties.color;
+                               }
+                               if (newProperties.stroke) {
+                                       line.series.stroke = newProperties.stroke;
+                               }
 
                        } );
 
@@ -1844,8 +1886,10 @@ Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                                        delete line.originalIndex;
                                }
 
-                               if (colorSafe[line.series.name]) {
-                                       line.series.color = colorSafe[line.series.name];
+                               var lineProperties = propertiesSafe[line.series.name];
+                               if (lineProperties) {
+                                       line.series.color  = lineProperties.color;
+                                       line.series.stroke = lineProperties.stroke;
                                }
                        } );
 
@@ -1986,10 +2030,8 @@ Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
 
        if (this.legend) {
 
-               var $ = jQuery;
-               if (typeof $ != 'undefined' && $(this.legend.list).sortable) {
-
-                       $(this.legend.list).sortable( {
+               if (typeof jQuery != 'undefined' && jQuery(this.legend.list).sortable) {
+                       jQuery(this.legend.list).sortable( {
                                start: function(event, ui) {
                                        ui.item.bind('no.onclick',
                                                function(event) {
@@ -2033,6 +2075,125 @@ Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
        this.updateBehaviour = function () { this._addBehavior() };
 
 };
+Rickshaw.namespace('Rickshaw.Graph.DragZoom');
+
+Rickshaw.Graph.DragZoom = Rickshaw.Class.create({
+
+       initialize: function(args) {
+               if (!args || !args.graph) {
+                       throw new Error("Rickshaw.Graph.DragZoom needs a reference to a graph");
+               }
+               var defaults = {
+                       opacity: 0.5,
+                       fill: 'steelblue',
+                       minimumTimeSelection: 60,
+                       callback: function() {}
+               };
+
+               this.graph = args.graph;
+               this.svg = d3.select(this.graph.element).select("svg");
+               this.svgWidth = parseInt(this.svg.attr("width"), 10);
+               this.opacity = args.opacity || defaults.opacity;
+               this.fill = args.fill || defaults.fill;
+               this.minimumTimeSelection = args.minimumTimeSelection || defaults.minimumTimeSelection;
+               this.callback = args.callback || defaults.callback;
+
+               this.registerMouseEvents();
+       },
+
+       registerMouseEvents: function() {
+               var self = this;
+               var ESCAPE_KEYCODE = 27;
+               var rectangle;
+
+               var drag = {
+                       startDt: null,
+                       stopDt: null,
+                       startPX: null,
+                       stopPX: null
+               };
+
+               this.svg.on("mousedown", onMousedown);
+
+               function onMouseup(datum, index) {
+                       drag.stopDt = pointAsDate(d3.event);
+                       var windowAfterDrag = [
+                               drag.startDt,
+                               drag.stopDt
+                       ].sort(compareNumbers);
+
+                       self.graph.window.xMin = windowAfterDrag[0];
+                       self.graph.window.xMax = windowAfterDrag[1];
+
+                       var endTime = self.graph.window.xMax;
+                       var range = self.graph.window.xMax - self.graph.window.xMin;
+
+                       reset(this);
+
+                       if (range < self.minimumTimeSelection || isNaN(range)) {
+                               return;
+                       }
+                       self.graph.update();
+                       self.callback({range: range, endTime: endTime});
+               }
+
+               function onMousemove() {
+                       var offset = drag.stopPX = (d3.event.offsetX || d3.event.layerX);
+                       if (offset > (self.svgWidth - 1) || offset < 1) {
+                               return;
+                       }
+
+                       var limits = [drag.startPX, offset].sort(compareNumbers);
+                       var selectionWidth = limits[1]-limits[0];
+                       if (isNaN(selectionWidth)) {
+                               return reset(this);
+                       }
+                       rectangle.attr("fill", self.fill)
+                       .attr("x", limits[0])
+                       .attr("width", selectionWidth);
+               }
+
+               function onMousedown() {
+                       var el = d3.select(this);
+                       rectangle = el.append("rect")
+                       .style("opacity", self.opacity)
+                       .attr("y", 0)
+                       .attr("height", "100%");
+
+                       if(d3.event.preventDefault) {
+                               d3.event.preventDefault();
+                       } else {
+                               d3.event.returnValue = false;
+                       }
+                       drag.target = d3.event.target;
+                       drag.startDt = pointAsDate(d3.event);
+                       drag.startPX = d3.event.offsetX || d3.event.layerX;
+                       el.on("mousemove", onMousemove);
+                       d3.select(document).on("mouseup", onMouseup);
+                       d3.select(document).on("keyup", function() {
+                               if (d3.event.keyCode === ESCAPE_KEYCODE) {
+                                       reset(this);
+                               }
+                       });
+               }
+
+               function reset(el) {
+                       var s = d3.select(el);
+                       s.on("mousemove", null);
+                       d3.select(document).on("mouseup", null);
+                       drag = {};
+                       rectangle.remove();
+               }
+
+               function compareNumbers(a, b) {
+                       return a - b;
+               }
+
+               function pointAsDate(e) {
+                       return Math.floor(self.graph.x.invert(e.offsetX || e.layerX));
+               }
+       }
+});
 Rickshaw.namespace('Rickshaw.Graph.HoverDetail');
 
 Rickshaw.Graph.HoverDetail = Rickshaw.Class.create({
@@ -2050,7 +2211,7 @@ Rickshaw.Graph.HoverDetail = Rickshaw.Class.create({
                };
 
                var element = this.element = document.createElement('div');
-               element.className = 'detail';
+               element.className = 'detail inactive';
 
                this.visible = true;
                graph.element.appendChild(element);
@@ -2080,8 +2241,9 @@ Rickshaw.Graph.HoverDetail = Rickshaw.Class.create({
 
                var graph = this.graph;
 
-               var eventX = e.offsetX || e.layerX;
-               var eventY = e.offsetY || e.layerY;
+               var rect = graph.element.getBoundingClientRect();
+               var eventX = e.clientX - rect.left;
+               var eventY = e.clientY - rect.top;
 
                var j = 0;
                var points = [];
@@ -2288,26 +2450,43 @@ Rickshaw.Graph.HoverDetail = Rickshaw.Class.create({
 
        _addListeners: function() {
 
+               // Keep reference for later removal.
+               this.mousemoveListener = function(e) {
+                       this.visible = true;
+                       this.update(e);
+               }.bind(this);
+
+               // Add listener.
                this.graph.element.addEventListener(
                        'mousemove',
-                       function(e) {
-                               this.visible = true;
-                               this.update(e);
-                       }.bind(this),
+                       this.mousemoveListener,
                        false
                );
 
                this.graph.onUpdate( function() { this.update() }.bind(this) );
 
+               // Keep reference for later removal.
+               this.mouseoutListener = function(e) {
+                       if (e.relatedTarget && !(e.relatedTarget.compareDocumentPosition(this.graph.element) & Node.DOCUMENT_POSITION_CONTAINS)) {
+                               this.hide();
+                       }
+               }.bind(this);
+
+               // Add listener.
                this.graph.element.addEventListener(
                        'mouseout',
-                       function(e) {
-                               if (e.relatedTarget && !(e.relatedTarget.compareDocumentPosition(this.graph.element) & Node.DOCUMENT_POSITION_CONTAINS)) {
-                                       this.hide();
-                               }
-                       }.bind(this),
+                       this.mouseoutListener,
                        false
                );
+       },
+
+       _removeListeners: function() {
+               if (this.mousemoveListener) {
+                       this.graph.element.removeEventListener('mousemove', this.mousemoveListener, false);
+               }
+               if (this.mouseoutListener) {
+                       this.graph.element.removeEventListener('mouseout', this.mouseoutListener, false);
+               }
        }
 });
 Rickshaw.namespace('Rickshaw.Graph.JSONP');
@@ -2334,6 +2513,7 @@ Rickshaw.Graph.Legend = Rickshaw.Class.create( {
                this.element = args.element;
                this.graph = args.graph;
                this.naturalOrder = args.naturalOrder;
+               this.colorKey = args.colorKey || 'color';
 
                this.element.classList.add(this.className);
 
@@ -2381,7 +2561,7 @@ Rickshaw.Graph.Legend = Rickshaw.Class.create( {
                }
                var swatch = document.createElement('div');
                swatch.className = 'swatch';
-               swatch.style.backgroundColor = series.color;
+               swatch.style.backgroundColor = series[this.colorKey];
 
                line.appendChild(swatch);
 
@@ -2410,68 +2590,93 @@ Rickshaw.Graph.Legend = Rickshaw.Class.create( {
                return line;
        }
 } );
-
 Rickshaw.namespace('Rickshaw.Graph.RangeSlider');
 
 Rickshaw.Graph.RangeSlider = Rickshaw.Class.create({
 
        initialize: function(args) {
 
+               var $ = jQuery;
+               var self = this;
                var element = this.element = args.element;
-               var graph = this.graph = args.graph;
+               var graphs = this.graphs = args.graphs;
+               if (!graphs) {
+                       graphs = this.graph = args.graph;
+               }
+               if (graphs.constructor !== Array) {
+                       graphs = [graphs];
+               }
+               this.graph = graphs[0];
 
                this.slideCallbacks = [];
 
                this.build();
 
-               graph.onUpdate( function() { this.update() }.bind(this) );
+               for (var i = 0; i < graphs.length; i++) {
+                       graphs[i].onUpdate(function() {
+                               self.update();
+                       }.bind(self));
+
+                       (function(idx){
+                               graphs[idx].onConfigure(function() {
+                                       $(this.element)[0].style.width = graphs[idx].width + 'px';
+                               }.bind(self));
+                       })(i);
+               }
+
        },
 
        build: function() {
 
+               var domain;
                var element = this.element;
-               var graph = this.graph;
                var $ = jQuery;
-
-               var domain = graph.dataDomain();
                var self = this;
+               var graphs = this.graphs || this.graph;
+
+               if (graphs.constructor !== Array) {
+                       graphs = [graphs];
+               }
 
-               $( function() {
-                       $(element).slider( {
+               // base the slider's min/max on the first graph
+               this.graph = graphs[0];
+               domain = graphs[0].dataDomain();
+
+               $(function() {
+                       $(element).slider({
                                range: true,
                                min: domain[0],
                                max: domain[1],
-                               values: [ 
+                               values: [
                                        domain[0],
                                        domain[1]
                                ],
-                               slide: function( event, ui ) {
+                               start: function(event, ui) {
+                                       self.slideStarted({ event: event, ui: ui });
+                               },
+                               stop: function(event, ui) {
+                                       self.slideFinished({ event: event, ui: ui });
+                               },
+                               slide: function(event, ui) {
+                                       if (!self.slideShouldUpdate(event, ui))
+                                               return;
 
                                        if (ui.values[1] <= ui.values[0]) return;
 
-                                       graph.window.xMin = ui.values[0];
-                                       graph.window.xMax = ui.values[1];
-                                       graph.update();
-
-                                       var domain = graph.dataDomain();
-
-                                       // if we're at an extreme, stick there
-                                       if (domain[0] == ui.values[0]) {
-                                               graph.window.xMin = undefined;
-                                       }
-
-                                       if (domain[1] == ui.values[1]) {
-                                               graph.window.xMax = undefined;
+                                       for (var i = 0; i < graphs.length; i++) {
+                                               self.processSlideChange({
+                                                       event: event,
+                                                       ui: ui,
+                                                       graph: graphs[i]
+                                               });
                                        }
-
-                                       self.slideCallbacks.forEach(function(callback) {
-                                               callback(graph, graph.window.xMin, graph.window.xMax);
-                                       });
                                }
                        } );
                } );
 
-               $(element)[0].style.width = graph.width + 'px';
+               graphs[0].onConfigure(function() {
+                       $(this.element)[0].style.width = graphs[0].width + 'px';
+               }.bind(this));
 
        },
 
@@ -2500,6 +2705,45 @@ Rickshaw.Graph.RangeSlider = Rickshaw.Class.create({
 
        onSlide: function(callback) {
                this.slideCallbacks.push(callback);
+       },
+
+       processSlideChange: function(args) {
+               var event = args.event;
+               var ui = args.ui;
+               var graph = args.graph;
+
+               graph.window.xMin = ui.values[0];
+               graph.window.xMax = ui.values[1];
+               graph.update();
+
+               var domain = graph.dataDomain();
+
+               // if we're at an extreme, stick there
+               if (domain[0] == ui.values[0]) {
+                       graph.window.xMin = undefined;
+               }
+
+               if (domain[1] == ui.values[1]) {
+                       graph.window.xMax = undefined;
+               }
+
+               this.slideCallbacks.forEach(function(callback) {
+                       callback(graph, graph.window.xMin, graph.window.xMax);
+               });
+
+       },
+
+       // allows the slide updates to bail out if sliding is not permitted
+       slideShouldUpdate: function() {
+               return true;
+       },
+
+       slideStarted: function() {
+               return;
+       },
+
+       slideFinished: function() {
+               return;
        }
 });
 
@@ -3008,7 +3252,8 @@ Rickshaw.Graph.Renderer = Rickshaw.Class.create( {
                        unstack: true,
                        padding: { top: 0.01, right: 0, bottom: 0.01, left: 0 },
                        stroke: false,
-                       fill: false
+                       fill: false,
+                       opacity: 1
                };
        },
 
@@ -3016,6 +3261,9 @@ Rickshaw.Graph.Renderer = Rickshaw.Class.create( {
                // Requires that at least one series contains some data
                var stackedData = data || this.graph.stackedData || this.graph.stackData();
 
+               // filter out any series that may be empty in the current x-domain
+               stackedData = stackedData.filter(function (a) { return a && a.length !== 0; });
+
                var xMin = +Infinity;
                var xMax = -Infinity;
 
@@ -3100,10 +3348,13 @@ Rickshaw.Graph.Renderer = Rickshaw.Class.create( {
 
                var fill = this.fill ? series.color : 'none';
                var stroke = this.stroke ? series.color : 'none';
+               var strokeWidth = series.strokeWidth ? series.strokeWidth : this.strokeWidth;
+               var opacity = series.opacity === undefined ? this.opacity : series.opacity;
 
                series.path.setAttribute('fill', fill);
                series.path.setAttribute('stroke', stroke);
-               series.path.setAttribute('stroke-width', this.strokeWidth);
+               series.path.setAttribute('stroke-width', strokeWidth);
+               series.path.setAttribute('opacity', opacity);
 
                if (series.className) {
                        d3.select(series.path).classed(series.className, true);
@@ -3157,7 +3408,6 @@ Rickshaw.Graph.Renderer = Rickshaw.Class.create( {
                }
        }
 } );
-
 Rickshaw.namespace('Rickshaw.Graph.Renderer.Line');
 
 Rickshaw.Graph.Renderer.Line = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
@@ -3227,7 +3477,8 @@ Rickshaw.Graph.Renderer.Bar = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
 
                var defaults = Rickshaw.extend( $super(), {
                        gapSize: 0.05,
-                       unstack: false
+                       unstack: false,
+                       opacity: 1.0
                } );
 
                delete defaults.tension;
@@ -3293,6 +3544,7 @@ Rickshaw.Graph.Renderer.Bar = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
                                .attr("y", function(d) { return (graph.y(d.y0 + Math.abs(d.y))) * (d.y < 0 ? -1 : 1 ) })
                                .attr("width", seriesBarWidth)
                                .attr("height", function(d) { return graph.y.magnitude(Math.abs(d.y)) })
+                               .attr("opacity", series.opacity)
                                .attr("transform", transform);
 
                        Array.prototype.forEach.call(nodes[0], function(n) {
@@ -3315,8 +3567,13 @@ Rickshaw.Graph.Renderer.Bar = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
                }
 
                var frequentInterval = { count: 0, magnitude: 1 };
-
-               Rickshaw.keys(intervalCounts).forEach( function(i) {
+               
+               // Sorting object's keys returned to guarantee consistency when iterating over
+               // Keys order in `for .. in` loop is not specified and browsers behave differently here
+               // This results with different invterval value being calculated for different browsers
+               // See last but one section here: http://www.ecma-international.org/ecma-262/5.1/#sec-12.6.4
+               var keysSorted = Rickshaw.keys(intervalCounts).sort(function asc(a, b) { return Number(a) - Number(b); });
+               keysSorted.forEach( function(i) {
                        if (frequentInterval.count < intervalCounts[i]) {
                                frequentInterval = {
                                        count: intervalCounts[i],
@@ -3467,17 +3724,19 @@ Rickshaw.Graph.Renderer.ScatterPlot = Rickshaw.Class.create( Rickshaw.Graph.Rend
                series.forEach( function(series) {
 
                        if (series.disabled) return;
+                       var opacity = series.opacity === undefined ? 1 : series.opacity;
 
                        var nodes = vis.selectAll("path")
                                .data(series.stack.filter( function(d) { return d.y !== null } ))
                                .enter().append("svg:circle")
                                        .attr("cx", function(d) { return graph.x(d.x) })
                                        .attr("cy", function(d) { return graph.y(d.y) })
-                                       .attr("r", function(d) { return ("r" in d) ? d.r : dotSize});
+                                       .attr("r", function(d) { return ("r" in d) ? d.r : dotSize})
+                                       .attr("opacity", function(d) { return ("opacity" in d) ? d.opacity : opacity});
                        if (series.className) {
                                nodes.classed(series.className, true);
                        }
-                       
+
                        Array.prototype.forEach.call(nodes[0], function(n) {
                                n.setAttribute('fill', series.color);
                        } );