From 8ebdaf9b4c0f9c9c0a4f73cfc3fb4dca78a27e04 Mon Sep 17 00:00:00 2001 From: smarcet Date: Wed, 11 Mar 2026 16:08:12 -0300 Subject: [PATCH] chore(refactor): add unit tests --- .github/workflows/build.yml | 25 + .github/workflows/tests.yml | 25 + app/app.js | 76 +- app/helpers.js | 84 ++ babel.config.js | 3 + embed.min.js | 22 +- jest.config.js | 10 + package.json | 10 +- tests/helpers.test.js | 223 +++ yarn.lock | 2584 +++++++++++++++++++++++++++++++++++ 10 files changed, 2978 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/tests.yml create mode 100644 app/helpers.js create mode 100644 babel.config.js create mode 100644 jest.config.js create mode 100644 tests/helpers.test.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..23462f3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build widget + run: make diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a5f4687 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: Tests + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Run tests + run: yarn test diff --git a/app/app.js b/app/app.js index 3fd14da..2bb791f 100644 --- a/app/app.js +++ b/app/app.js @@ -1,9 +1,8 @@ -define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.css'], function ($, Ractive, mainTemplate, css) { +define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.css', 'app/helpers'], function ($, Ractive, mainTemplate, css, helpers) { 'use strict'; $.noConflict(); - var MAX_DETAIL_LEN = 100; var xhr_suggestions = null; var timeout_suggestions = null; var search_widget = { @@ -89,7 +88,7 @@ define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.cs ev.original.preventDefault(); if (newPage > totalPages || newPage < 1) return false; - changePagination(that, newPage); + helpers.changePagination(that, newPage); doSearch(that, false); } }); @@ -110,17 +109,12 @@ define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.cs url: url + '/'+term+'?page='+page+'&page_size='+perPage, dataType: "json" }).done(function(resp) { - var results = resp.results.map(function(r) { - var detail = r.hasOwnProperty('meta_description') ? r.meta_description : r.content; - detail = detail.length > MAX_DETAIL_LEN ? detail.substring(0, MAX_DETAIL_LEN) + '...' : detail; - var title = r.hasOwnProperty('meta_title') ? r.meta_title : r.title; - return {link: r.url, title: title, detail: detail}; - }); + var results = helpers.mapSearchResults(resp.results); that.set('total', resp.qty); that.set('results', results); - if(reset) resetPagination(that); + if(reset) helpers.resetPagination(that); }).fail(function(resp) { // error response @@ -135,9 +129,7 @@ define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.cs url: 'https://'+that.baseUrl+'/api/public/v1/suggestions/'+that.context+'/'+term, dataType: "json" }).done(function(resp) { - var results = resp.results.map(function(r) { - return {link: r.payload, title: r.term}; - }); + var results = helpers.mapSuggestions(resp.results); xhr_suggestions = null; that.set('suggestions', results); @@ -146,64 +138,6 @@ define(['jquery', 'ractive', 'rv!templates/template', 'text!css/widget-styles.cs }); } - function resetPagination(that) { - var total = that.get('total'); - var perPage = that.get('perPage'); - var totalPages = Math.ceil(total / perPage); - var lastPage = (totalPages < 5) ? totalPages : 5; - var newPagesToShow = []; - - for( var i = 1; i <= lastPage; i++) { - newPagesToShow.push(i); - } - - that.set('page', 1); - that.set('pagesToShow', newPagesToShow); - - // change results - var newResultLimit = (perPage); - newResultLimit = (newResultLimit > total) ? total : newResultLimit; - that.set('fromResult', 1); - that.set('toResult', newResultLimit); - } - - function changePagination(that, newPage) { - var total = that.get('total'); - var pagesToShow = that.get('pagesToShow'); - var perPage = that.get('perPage'); - var lastPage = pagesToShow[pagesToShow.length - 1]; - var firstPage = pagesToShow[0]; - var totalPages = Math.ceil(total / perPage); - var newPagesToShow = []; - - that.set('page', newPage); - - // change results - var newResultLimit = (newPage * perPage); - newResultLimit = (newResultLimit > total) ? total : newResultLimit; - that.set('fromResult', ((newPage - 1) * perPage) + 1); - that.set('toResult', newResultLimit); - - // change pagination - if (newPage > lastPage - 1 || newPage < firstPage + 1) { - var pageFrom; - var pageTo = ((newPage + 2) < 5) ? 5 : (newPage + 2); - newPagesToShow = [] - - if (pageTo > totalPages) { - pageTo = totalPages; - } - - pageFrom = ((pageTo - 4) < 1) ? 1 : (pageTo - 4); - - for( var i = pageFrom; i <= pageTo; i++) { - newPagesToShow.push(i); - } - - that.set('pagesToShow', newPagesToShow); - } - } - function centerPopup(el) { var winW = $(window).width(); var newPopWidth = winW * 0.8; diff --git a/app/helpers.js b/app/helpers.js new file mode 100644 index 0000000..20a3ed2 --- /dev/null +++ b/app/helpers.js @@ -0,0 +1,84 @@ +define([], function () { + + 'use strict'; + + var MAX_DETAIL_LEN = 100; + + function mapSearchResults(results) { + return results.map(function(r) { + var detail = r.hasOwnProperty('meta_description') ? r.meta_description : r.content; + detail = detail.length > MAX_DETAIL_LEN ? detail.substring(0, MAX_DETAIL_LEN) + '...' : detail; + var title = r.hasOwnProperty('meta_title') ? r.meta_title : r.title; + return {link: r.url, title: title, detail: detail}; + }); + } + + function mapSuggestions(results) { + return results.map(function(r) { + return {link: r.payload, title: r.term}; + }); + } + + function resetPagination(that) { + var total = that.get('total'); + var perPage = that.get('perPage'); + var totalPages = Math.ceil(total / perPage); + var lastPage = (totalPages < 5) ? totalPages : 5; + var newPagesToShow = []; + + for (var i = 1; i <= lastPage; i++) { + newPagesToShow.push(i); + } + + that.set('page', 1); + that.set('pagesToShow', newPagesToShow); + + var newResultLimit = perPage; + newResultLimit = (newResultLimit > total) ? total : newResultLimit; + that.set('fromResult', 1); + that.set('toResult', newResultLimit); + } + + function changePagination(that, newPage) { + var total = that.get('total'); + var pagesToShow = that.get('pagesToShow'); + var perPage = that.get('perPage'); + var lastPage = pagesToShow[pagesToShow.length - 1]; + var firstPage = pagesToShow[0]; + var totalPages = Math.ceil(total / perPage); + var newPagesToShow = []; + + that.set('page', newPage); + + var newResultLimit = (newPage * perPage); + newResultLimit = (newResultLimit > total) ? total : newResultLimit; + that.set('fromResult', ((newPage - 1) * perPage) + 1); + that.set('toResult', newResultLimit); + + if (newPage > lastPage - 1 || newPage < firstPage + 1) { + var pageFrom; + var pageTo = ((newPage + 2) < 5) ? 5 : (newPage + 2); + + if (pageTo > totalPages) { + pageTo = totalPages; + } + + pageFrom = ((pageTo - 4) < 1) ? 1 : (pageTo - 4); + + for (var i = pageFrom; i <= pageTo; i++) { + newPagesToShow.push(i); + } + + that.set('pagesToShow', newPagesToShow); + } + } + + return { + MAX_DETAIL_LEN: MAX_DETAIL_LEN, + mapSearchResults: mapSearchResults, + mapSuggestions: mapSuggestions, + resetPagination: resetPagination, + changePagination: changePagination + }; + +}); diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..372f2b5 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: ['transform-amd-to-commonjs'] +}; diff --git a/embed.min.js b/embed.min.js index b48d8fd..9945ac6 100644 --- a/embed.min.js +++ b/embed.min.js @@ -42,14 +42,14 @@ /* toSource by Marcello Bastea-Forte - zlib license */ -var requirejs,require,define;!function(t){function e(t,e){return y.call(t,e)}function n(t,e){var n,i,r,s,o,a,u,l,c,h,f,d,p=e&&e.split("/"),g=m.map,v=g&&g["*"]||{};if(t){for(t=t.split("/"),o=t.length-1,m.nodeIdCompat&&w.test(t[o])&&(t[o]=t[o].replace(w,"")),"."===t[0].charAt(0)&&p&&(d=p.slice(0,p.length-1),t=d.concat(t)),c=0;c0&&(t.splice(c-1,2),c-=2)}t=t.join("/")}if((p||v)&&g){for(n=t.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),p)for(h=p.length;h>0;h-=1)if((r=g[p.slice(0,h).join("/")])&&(r=r[i])){s=r,a=c;break}if(s)break;!u&&v&&v[i]&&(u=v[i],l=c)}!s&&u&&(s=u,a=l),s&&(n.splice(0,a,s),t=n.join("/"))}return t}function i(e,n){return function(){var i=b.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function r(t){return function(e){return n(e,t)}}function s(t){return function(e){p[t]=e}}function o(n){if(e(g,n)){var i=g[n];delete g[n],v[n]=!0,c.apply(t,i)}if(!e(p,n)&&!e(v,n))throw new Error("No "+n);return p[n]}function a(t){var e,n=t?t.indexOf("!"):-1;return n>-1&&(e=t.substring(0,n),t=t.substring(n+1,t.length)),[e,t]}function u(t){return t?a(t):[]}function l(t){return function(){return m&&m.config&&m.config[t]||{}}}var c,h,f,d,p={},g={},m={},v={},y=Object.prototype.hasOwnProperty,b=[].slice,w=/\.js$/;f=function(t,e){var i,s=a(t),u=s[0],l=e[1];return t=s[1],u&&(u=n(u,l),i=o(u)),u?t=i&&i.normalize?i.normalize(t,r(l)):n(t,l):(t=n(t,l),s=a(t),u=s[0],t=s[1],u&&(i=o(u))),{f:u?u+"!"+t:t,n:t,pr:u,p:i}},d={require:function(t){return i(t)},exports:function(t){var e=p[t];return void 0!==e?e:p[t]={}},module:function(t){return{id:t,uri:"",exports:p[t],config:l(t)}}},c=function(n,r,a,l){var c,h,m,y,b,w,x,k=[],E=typeof a;if(l=l||n,w=u(l),"undefined"===E||"function"===E){for(r=!r.length&&a.length?["require","exports","module"]:r,b=0;b0&&e-1 in t)}function s(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function o(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}function a(t,e,n){return yt(e)?Et.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?Et.grep(t,function(t){return t===e!==n}):"string"!=typeof e?Et.grep(t,function(t){return ht.call(e,t)>-1!==n}):Et.filter(e,t,n)}function u(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function l(t){var e={};return Et.each(t.match(qt)||[],function(t,n){e[n]=!0}),e}function c(t){return t}function h(t){throw t}function f(t,e,n,i){var r;try{t&&yt(r=t.promise)?r.call(t).done(e).fail(n):t&&yt(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}function d(){wt.removeEventListener("DOMContentLoaded",d),t.removeEventListener("load",d),Et.ready()}function p(t,e){return e.toUpperCase()}function g(t){return t.replace(Kt,"ms-").replace($t,p)}function m(){this.expando=Et.expando+m.uid++}function v(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Xt.test(t)?JSON.parse(t):t)}function y(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(Gt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=v(n)}catch(t){}Zt.set(t,e,n)}else n=void 0;return n}function b(t,e,n,i){var r,s,o=20,a=i?function(){return i.cur()}:function(){return Et.css(t,e,"")},u=a(),l=n&&n[3]||(Et.cssNumber[e]?"":"px"),c=t.nodeType&&(Et.cssNumber[e]||"px"!==l&&+u)&&Yt.exec(Et.css(t,e));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;o--;)Et.style(t,e,c+l),(1-s)*(1-(s=a()/u||.5))<=0&&(o=0),c/=s;c*=2,Et.style(t,e,c+l),n=n||[]}return n&&(c=+c||+u||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=c,i.end=r)),r}function w(t){var e,n=t.ownerDocument,i=t.nodeName,r=re[i];return r||(e=n.body.appendChild(n.createElement(i)),r=Et.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),re[i]=r,r)}function x(t,e){for(var n,i,r=[],s=0,o=t.length;s-1)s&&s.push(o);else if(c=ee(o),a=k(f.appendChild(o),"script"),c&&E(a),n)for(h=0;o=a[h++];)ae.test(o.type||"")&&n.push(o);return f}function C(){return!0}function S(){return!1}function T(t,e,n,i,r,s){var o,a;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(a in e)T(t,a,n,i,e[a],s);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=S;else if(!r)return t;return 1===s&&(o=r,r=function(t){return Et().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=Et.guid++)),t.each(function(){Et.event.add(this,e,r,i,n)})}function A(t,e,n){if(!n)return void(void 0===Wt.get(t,e)&&Et.event.add(t,e,C));Wt.set(t,e,!1),Et.event.add(t,e,{namespace:!1,handler:function(t){var n,i=Wt.get(this,e);if(1&t.isTrigger&&this[e]){if(i)(Et.event.special[e]||{}).delegateType&&t.stopPropagation();else if(i=ut.call(arguments),Wt.set(this,e,i),this[e](),n=Wt.get(this,e),Wt.set(this,e,!1),i!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else i&&(Wt.set(this,e,Et.event.trigger(i[0],i.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=C)}})}function j(t,e){return s(t,"table")&&s(11!==e.nodeType?e:e.firstChild,"tr")?Et(t).children("tbody")[0]||t:t}function N(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function O(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function P(t,e){var n,i,r,s,o,a,u;if(1===e.nodeType){if(Wt.hasData(t)&&(s=Wt.get(t),u=s.events)){Wt.remove(e,"handle events");for(r in u)for(n=0,i=u[r].length;n1&&"string"==typeof p&&!vt.checkClone&&fe.test(p))return t.each(function(n){var s=t.eq(n);g&&(e[0]=p.call(this,n,s.html())),M(s,e,i,r)});if(f&&(s=_(e,t[0].ownerDocument,!1,t,r),o=s.firstChild,1===s.childNodes.length&&(s=o),o||r)){for(a=Et.map(k(s,"script"),N),u=a.length;h=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-u-a-.5))||0),u+l}function z(t,e,n){var i=me(t),r=!vt.boxSizingReliable()||n,o=r&&"border-box"===Et.css(t,"boxSizing",!1,i),a=o,u=L(t,e,i),l="offset"+e[0].toUpperCase()+e.slice(1);if(pe.test(u)){if(!n)return u;u="auto"}return(!vt.boxSizingReliable()&&o||!vt.reliableTrDimensions()&&s(t,"tr")||"auto"===u||!parseFloat(u)&&"inline"===Et.css(t,"display",!1,i))&&t.getClientRects().length&&(o="border-box"===Et.css(t,"boxSizing",!1,i),(a=l in t)&&(u=t[l])),(u=parseFloat(u)||0)+F(t,e,n||(o?"border":"content"),a,i,u)+"px"}function H(t,e,n,i,r){return new H.prototype.init(t,e,n,i,r)}function K(){Se&&(!1===wt.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(K):t.setTimeout(K,Et.fx.interval),Et.fx.tick())}function $(){return t.setTimeout(function(){Ce=void 0}),Ce=Date.now()}function U(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)n=Jt[i],r["margin"+n]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function W(t,e,n){for(var i,r=(G.tweeners[e]||[]).concat(G.tweeners["*"]),s=0,o=r.length;s=0&&n_.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function r(t){return t[M]=!0,t}function o(t){var e=A.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function a(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&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function u(t){return r(function(e){return e=+e,r(function(n,i){for(var r,s=t([],n.length,e),o=s.length;o--;)n[r=s[o]]&&(n[r]=!(i[r]=n[r]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(t){var e,i=t?t.ownerDocument||t:Nt;return i!=A&&9===i.nodeType&&i.documentElement?(A=i,j=A.documentElement,N=!Et.isXMLDoc(A),P=j.matches||j.webkitMatchesSelector||j.msMatchesSelector,j.msMatchesSelector&&Nt!=A&&(e=A.defaultView)&&e.top!==e&&e.addEventListener("unload",st),vt.getById=o(function(t){return j.appendChild(t).id=Et.expando,!A.getElementsByName||!A.getElementsByName(Et.expando).length}),vt.disconnectedMatch=o(function(t){return P.call(t,"*")}),vt.scope=o(function(){return A.querySelectorAll(":scope")}),vt.cssHas=o(function(){try{return A.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}}),vt.getById?(_.filter.ID=function(t){var e=t.replace(it,rt);return function(t){return t.getAttribute("id")===e}},_.find.ID=function(t,e){if(void 0!==e.getElementById&&N){var n=e.getElementById(t);return n?[n]:[]}}):(_.filter.ID=function(t){var e=t.replace(it,rt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},_.find.ID=function(t,e){if(void 0!==e.getElementById&&N){var n,i,r,s=e.getElementById(t);if(s){if((n=s.getAttributeNode("id"))&&n.value===t)return[s];for(r=e.getElementsByName(t),i=0;s=r[i++];)if((n=s.getAttributeNode("id"))&&n.value===t)return[s]}return[]}}),_.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},_.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&N)return e.getElementsByClassName(t)},O=[],o(function(t){var e;j.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||O.push("\\["+Tt+"*(?:value|"+z+")"),t.querySelectorAll("[id~="+M+"-]").length||O.push("~="),t.querySelectorAll("a#"+M+"+*").length||O.push(".#.+[+~]"),t.querySelectorAll(":checked").length||O.push(":checked"),e=A.createElement("input"),e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),j.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&O.push(":enabled",":disabled"),e=A.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||O.push("\\["+Tt+"*name"+Tt+"*="+Tt+"*(?:''|\"\")")}),vt.cssHas||O.push(":has"),O=O.length&&new RegExp(O.join("|")),F=function(t,e){if(t===e)return T=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!vt.sortDetached&&e.compareDocumentPosition(t)===i?t===A||t.ownerDocument==Nt&&n.contains(Nt,t)?-1:e===A||e.ownerDocument==Nt&&n.contains(Nt,e)?1:S?ht.call(S,t)-ht.call(S,e):0:4&i?-1:1)},A):A}function h(){}function f(t,e){var i,r,s,o,a,u,l,c=V[t+" "];if(c)return e?0:c.slice(0);for(a=t,u=[],l=_.preFilter;a;){i&&!(r=W.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(s=[])),i=!1,(r=Z.exec(a))&&(i=r.shift(),s.push({value:i,type:r[0].replace(At," ")}),a=a.slice(i.length));for(o in _.filter)!(r=Y[o].exec(a))||l[o]&&!(r=l[o](r))||(i=r.shift(),s.push({value:i,type:o,matches:r}),a=a.slice(i.length));if(!i)break}return e?a.length:a?n.error(t):V(t,u).slice(0)}function d(t){for(var e=0,n=t.length,i="";e1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function m(t,e,i){for(var r=0,s=e.length;r-1&&(r[l]=!(o[l]=h))}}else f=v(f===o?f.splice(g,f.length):f),s?s(null,o,f,u):D.apply(o,f)})}function b(t){for(var e,n,i,r=t.length,s=_.relative[t[0].type],o=s||_.relative[" "],a=s?1:0,u=p(function(t){return t===e},o,!0),l=p(function(t){return ht.call(e,t)>-1},o,!0),c=[function(t,n,i){var r=!s&&(i||n!=C)||((e=n).nodeType?u(t,n,i):l(t,n,i));return e=null,r}];a1&&g(c),a>1&&d(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(At,"$1"),n,a0,i=t.length>0,s=function(r,s,o,a,u){var l,h,f,d=0,p="0",g=r&&[],m=[],y=C,b=r||i&&_.find.TAG("*",u),w=R+=null==y?1:Math.random()||.1,x=b.length;for(u&&(C=s==A||s||u);p!==x&&null!=(l=b[p]);p++){if(i&&l){for(h=0,s||l.ownerDocument==A||(c(l),o=!N);f=t[h++];)if(f(l,s||A,o)){D.call(a,l);break}u&&(R=w)}n&&((l=!f&&l)&&d--,r&&g.push(l))}if(d+=p,n&&p!==d){for(h=0;f=e[h++];)f(g,m,s,o);if(r){if(d>0)for(;p--;)g[p]||m[p]||(m[p]=_t.call(a));m=v(m)}D.apply(a,m),u&&!r&&m.length>0&&d+e.length>1&&Et.uniqueSort(a)}return u&&(R=w,C=y),g};return n?r(s):s}function x(t,e){var n,i=[],r=[],s=B[t+" "];if(!s){for(e||(e=f(t)),n=e.length;n--;)s=b(e[n]),s[M]?i.push(s):r.push(s);s=B(t,w(r,i)),s.selector=t}return s}function k(t,e,n,i){var r,s,o,a,u,c="function"==typeof t&&t,h=!i&&f(t=c.selector||t);if(n=n||[],1===h.length){if(s=h[0]=h[0].slice(0),s.length>2&&"ID"===(o=s[0]).type&&9===e.nodeType&&N&&_.relative[s[1].type]){if(!(e=(_.find.ID(o.matches[0].replace(it,rt),e)||[])[0]))return n;c&&(e=e.parentNode),t=t.slice(s.shift().value.length)}for(r=Y.needsContext.test(t)?0:s.length;r--&&(o=s[r],!_.relative[a=o.type]);)if((u=_.find[a])&&(i=u(o.matches[0].replace(it,rt),nt.test(s[0].type)&&l(e.parentNode)||e))){if(s.splice(r,1),!(t=i.length&&d(s)))return D.apply(n,i),n;break}}return(c||x(t,h))(i,e,!N,n,!e||nt.test(t)&&l(e.parentNode)||e),n}var E,_,C,S,T,A,j,N,O,P,D=Ot,M=Et.expando,R=0,L=0,I=i(),V=i(),B=i(),q=i(),F=function(t,e){return t===e&&(T=!0),0},z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",H="(?:\\\\[\\da-fA-F]{1,6}"+Tt+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",K="\\["+Tt+"*("+H+")(?:"+Tt+"*([*^$|!~]?=)"+Tt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+H+"))|)"+Tt+"*\\]",$=":("+H+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+K+")*)|.*)\\)|)",U=new RegExp(Tt+"+","g"),W=new RegExp("^"+Tt+"*,"+Tt+"*"),Z=new RegExp("^"+Tt+"*([>+~]|"+Tt+")"+Tt+"*"),X=new RegExp(Tt+"|>"),G=new RegExp($),Q=new RegExp("^"+H+"$"),Y={ID:new RegExp("^#("+H+")"),CLASS:new RegExp("^\\.("+H+")"),TAG:new RegExp("^("+H+"|[*])"),ATTR:new RegExp("^"+K),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+Tt+"*(even|odd|(([+-]|)(\\d*)n|)"+Tt+"*(?:([+-]|)"+Tt+"*(\\d+)|))"+Tt+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+Tt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+Tt+"*((?:-\\d)?\\d*)"+Tt+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,et=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,nt=/[+~]/,it=new RegExp("\\\\[\\da-fA-F]{1,6}"+Tt+"?|\\\\([^\\r\\n\\f])","g"),rt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},st=function(){c()},at=p(function(t){return!0===t.disabled&&s(t,"fieldset")},{dir:"parentNode",next:"legend"});try{D.apply(ot=ut.call(Nt.childNodes),Nt.childNodes),ot[Nt.childNodes.length].nodeType}catch(t){D={apply:function(t,e){Ot.apply(t,ut.call(e))},call:function(t){Ot.apply(t,ut.call(arguments,1))}}}n.matches=function(t,e){return n(t,null,null,e)},n.matchesSelector=function(t,e){if(c(t),N&&!q[e+" "]&&(!O||!O.test(e)))try{var i=P.call(t,e);if(i||vt.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){q(e,!0)}return n(e,A,null,[t]).length>0},n.contains=function(t,e){return(t.ownerDocument||t)!=A&&c(t),Et.contains(t,e)},n.attr=function(t,e){(t.ownerDocument||t)!=A&&c(t);var n=_.attrHandle[e.toLowerCase()],i=n&&pt.call(_.attrHandle,e.toLowerCase())?n(t,e,!N):void 0;return void 0!==i?i:t.getAttribute(e)},n.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},Et.uniqueSort=function(t){var e,n=[],i=0,r=0;if(T=!vt.sortStable,S=!vt.sortStable&&ut.call(t,0),Ct.call(t,F),T){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)St.call(t,n[i],1)}return S=null,t},Et.fn.uniqueSort=function(){return this.pushStack(Et.uniqueSort(ut.apply(this)))},_=Et.expr={cacheLength:50,createPseudo:r,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(it,rt),t[3]=(t[3]||t[4]||t[5]||"").replace(it,rt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||n.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&n.error(t[0]),t},PSEUDO:function(t){ -var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&G.test(n)&&(e=f(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(it,rt).toLowerCase();return"*"===t?function(){return!0}:function(t){return s(t,e)}},CLASS:function(t){var e=I[t+" "];return e||(e=new RegExp("(^|"+Tt+")"+t+"("+Tt+"|$)"))&&I(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,i){return function(r){var s=n.attr(r,t);return null==s?"!="===e:!e||(s+="","="===e?s===i:"!="===e?s!==i:"^="===e?i&&0===s.indexOf(i):"*="===e?i&&s.indexOf(i)>-1:"$="===e?i&&s.slice(-i.length)===i:"~="===e?(" "+s.replace(U," ")+" ").indexOf(i)>-1:"|="===e&&(s===i||s.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var c,h,f,d,p,g=o!==a?"nextSibling":"previousSibling",m=e.parentNode,v=u&&e.nodeName.toLowerCase(),y=!l&&!u,b=!1;if(m){if(o){for(;g;){for(f=e;f=f[g];)if(u?s(f,v):1===f.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&y){for(h=m[M]||(m[M]={}),c=h[t]||[],d=c[0]===R&&c[1],b=d&&c[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(b=d=0)||p.pop();)if(1===f.nodeType&&++b&&f===e){h[t]=[R,d,b];break}}else if(y&&(h=e[M]||(e[M]={}),c=h[t]||[],d=c[0]===R&&c[1],b=d),!1===b)for(;(f=++d&&f&&f[g]||(b=d=0)||p.pop())&&((u?!s(f,v):1!==f.nodeType)||!++b||(y&&(h=f[M]||(f[M]={}),h[t]=[R,b]),f!==e)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,e){var i,s=_.pseudos[t]||_.setFilters[t.toLowerCase()]||n.error("unsupported pseudo: "+t);return s[M]?s(e):s.length>1?(i=[t,t,"",e],_.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,n){for(var i,r=s(t,e),o=r.length;o--;)i=ht.call(t,r[o]),t[i]=!(n[i]=r[o])}):function(t){return s(t,0,i)}):s}},pseudos:{not:r(function(t){var e=[],n=[],i=x(t.replace(At,"$1"));return i[M]?r(function(t,e,n,r){for(var s,o=i(t,null,r,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))}):function(t,r,s){return e[0]=t,i(e,null,s,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(e){return n(t,e).length>0}}),contains:r(function(t){return t=t.replace(it,rt),function(e){return(e.textContent||Et.text(e)).indexOf(t)>-1}}),lang:r(function(t){return Q.test(t||"")||n.error("unsupported lang: "+t),t=t.replace(it,rt).toLowerCase(),function(e){var n;do{if(n=N?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===j},focus:function(t){return t===e()&&A.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:a(!1),disabled:a(!0),checked:function(t){return s(t,"input")&&!!t.checked||s(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!_.pseudos.empty(t)},header:function(t){return tt.test(t.nodeName)},input:function(t){return J.test(t.nodeName)},button:function(t){return s(t,"input")&&"button"===t.type||s(t,"button")},text:function(t){var e;return s(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,n){return[n<0?n+e:n]}),even:u(function(t,e){for(var n=0;ne?e:n;--i>=0;)t.push(i);return t}),gt:u(function(t,e,n){for(var i=n<0?n+e:n;++i:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;Et.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?Et.find.matchesSelector(i,t)?[i]:[]:Et.find.matches(t,Et.grep(e,function(t){return 1===t.nodeType}))},Et.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(Et(t).filter(function(){for(e=0;e1?Et.uniqueSort(n):n},filter:function(t){return this.pushStack(a(this,t||[],!1))},not:function(t){return this.pushStack(a(this,t||[],!0))},is:function(t){return!!a(this,"string"==typeof t&&Mt.test(t)?Et(t):t||[],!1).length}});var Lt,It=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(Et.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||Lt,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:It.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof Et?e[0]:e,Et.merge(this,Et.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:wt,!0)),Rt.test(i[1])&&Et.isPlainObject(e))for(i in e)yt(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return r=wt.getElementById(i[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):yt(t)?void 0!==n.ready?n.ready(t):t(Et):Et.makeArray(t,this)}).prototype=Et.fn,Lt=Et(wt);var Vt=/^(?:parents|prev(?:Until|All))/,Bt={children:!0,contents:!0,next:!0,prev:!0};Et.fn.extend({has:function(t){var e=Et(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&Et.find.matchesSelector(n,t))){s.push(n);break}return this.pushStack(s.length>1?Et.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?ht.call(Et(t),this[0]):ht.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(Et.uniqueSort(Et.merge(this.get(),Et(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),Et.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Pt(t,"parentNode")},parentsUntil:function(t,e,n){return Pt(t,"parentNode",n)},next:function(t){return u(t,"nextSibling")},prev:function(t){return u(t,"previousSibling")},nextAll:function(t){return Pt(t,"nextSibling")},prevAll:function(t){return Pt(t,"previousSibling")},nextUntil:function(t,e,n){return Pt(t,"nextSibling",n)},prevUntil:function(t,e,n){return Pt(t,"previousSibling",n)},siblings:function(t){return Dt((t.parentNode||{}).firstChild,t)},children:function(t){return Dt(t.firstChild)},contents:function(t){return null!=t.contentDocument&&at(t.contentDocument)?t.contentDocument:(s(t,"template")&&(t=t.content||t),Et.merge([],t.childNodes))}},function(t,e){Et.fn[t]=function(n,i){var r=Et.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=Et.filter(i,r)),this.length>1&&(Bt[t]||Et.uniqueSort(r),Vt.test(t)&&r.reverse()),this.pushStack(r)}});var qt=/[^\x20\t\r\n\f]+/g;Et.Callbacks=function(t){t="string"==typeof t?l(t):Et.extend({},t);var e,n,r,s,o=[],a=[],u=-1,c=function(){for(s=s||t.once,r=e=!0;a.length;u=-1)for(n=a.shift();++u-1;)o.splice(n,1),n<=u&&u--}),this},has:function(t){return t?Et.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return s=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return s=a=[],n||e||(o=n=""),this},locked:function(){return!!s},fireWith:function(t,n){return s||(n=n||[],n=[t,n.slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},Et.extend({Deferred:function(e){var n=[["notify","progress",Et.Callbacks("memory"),Et.Callbacks("memory"),2],["resolve","done",Et.Callbacks("once memory"),Et.Callbacks("once memory"),0,"resolved"],["reject","fail",Et.Callbacks("once memory"),Et.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return Et.Deferred(function(e){Et.each(n,function(n,i){var r=yt(t[i[4]])&&t[i[4]];s[i[1]](function(){var t=r&&r.apply(this,arguments);t&&yt(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,i,r){function s(e,n,i,r){return function(){var a=this,u=arguments,l=function(){var t,l;if(!(e=o&&(i!==h&&(a=void 0,u=[t]),n.rejectWith(a,u))}};e?f():(Et.Deferred.getErrorHook?f.error=Et.Deferred.getErrorHook():Et.Deferred.getStackHook&&(f.error=Et.Deferred.getStackHook()),t.setTimeout(f))}}var o=0;return Et.Deferred(function(t){n[0][3].add(s(0,t,yt(r)?r:c,t.notifyWith)),n[1][3].add(s(0,t,yt(e)?e:c)),n[2][3].add(s(0,t,yt(i)?i:h))}).promise()},promise:function(t){return null!=t?Et.extend(t,r):r}},s={};return Et.each(n,function(t,e){var o=e[2],a=e[5];r[e[1]]=o.add,a&&o.add(function(){i=a},n[3-t][2].disable,n[3-t][3].disable,n[0][2].lock,n[0][3].lock),o.add(e[3].fire),s[e[0]]=function(){return s[e[0]+"With"](this===s?void 0:this,arguments),this},s[e[0]+"With"]=o.fireWith}),r.promise(s),e&&e.call(s,s),s},when:function(t){var e=arguments.length,n=e,i=Array(n),r=ut.call(arguments),s=Et.Deferred(),o=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?ut.call(arguments):n,--e||s.resolveWith(i,r)}};if(e<=1&&(f(t,s.done(o(n)).resolve,s.reject,!e),"pending"===s.state()||yt(r[n]&&r[n].then)))return s.then();for(;n--;)f(r[n],o(n),s.reject);return s.promise()}});var Ft=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;Et.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&Ft.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},Et.readyException=function(e){t.setTimeout(function(){throw e})};var zt=Et.Deferred();Et.fn.ready=function(t){return zt.then(t).catch(function(t){Et.readyException(t)}),this},Et.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--Et.readyWait:Et.isReady)||(Et.isReady=!0,!0!==t&&--Et.readyWait>0||zt.resolveWith(wt,[Et]))}}),Et.ready.then=zt.then,"complete"===wt.readyState||"loading"!==wt.readyState&&!wt.documentElement.doScroll?t.setTimeout(Et.ready):(wt.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Ht=function(t,e,n,r,s,o,a){var u=0,l=t.length,c=null==n;if("object"===i(n)){s=!0;for(u in n)Ht(t,e,u,n[u],!0,o,a)}else if(void 0!==r&&(s=!0,yt(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,n){return c.call(Et(t),n)})),e))for(;u1,null,!0)},removeData:function(t){return this.each(function(){Zt.remove(this,t)})}}),Et.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Wt.get(t,e),n&&(!i||Array.isArray(n)?i=Wt.access(t,e,Et.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=Et.queue(t,e),i=n.length,r=n.shift(),s=Et._queueHooks(t,e),o=function(){Et.dequeue(t,e)};"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete s.stop,r.call(t,o,s)),!i&&s&&s.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Wt.get(t,n)||Wt.access(t,n,{empty:Et.Callbacks("once memory").add(function(){Wt.remove(t,[e+"queue",n])})})}}),Et.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,ae=/^$|^module$|\/(?:java|ecma)script/i;!function(){var t=wt.createDocumentFragment(),e=t.appendChild(wt.createElement("div")),n=wt.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),vt.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",vt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,e.innerHTML="",vt.option=!!e.lastChild}();var ue={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ue.tbody=ue.tfoot=ue.colgroup=ue.caption=ue.thead,ue.th=ue.td,vt.option||(ue.optgroup=ue.option=[1,""]);var le=/<|&#?\w+;/,ce=/^([^.]*)(?:\.(.+)|)/;Et.event={global:{},add:function(t,e,n,i,r){var s,o,a,u,l,c,h,f,d,p,g,m=Wt.get(t);if(Ut(t))for(n.handler&&(s=n,n=s.handler,r=s.selector),r&&Et.find.matchesSelector(te,r),n.guid||(n.guid=Et.guid++),(u=m.events)||(u=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return void 0!==Et&&Et.event.triggered!==e.type?Et.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(qt)||[""],l=e.length;l--;)a=ce.exec(e[l])||[],d=g=a[1],p=(a[2]||"").split(".").sort(),d&&(h=Et.event.special[d]||{},d=(r?h.delegateType:h.bindType)||d,h=Et.event.special[d]||{},c=Et.extend({type:d,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&Et.expr.match.needsContext.test(r),namespace:p.join(".")},s),(f=u[d])||(f=u[d]=[],f.delegateCount=0,h.setup&&!1!==h.setup.call(t,i,p,o)||t.addEventListener&&t.addEventListener(d,o)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),Et.event.global[d]=!0)},remove:function(t,e,n,i,r){var s,o,a,u,l,c,h,f,d,p,g,m=Wt.hasData(t)&&Wt.get(t);if(m&&(u=m.events)){for(e=(e||"").match(qt)||[""],l=e.length;l--;)if(a=ce.exec(e[l])||[],d=g=a[1],p=(a[2]||"").split(".").sort(),d){for(h=Et.event.special[d]||{},d=(i?h.delegateType:h.bindType)||d,f=u[d]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=f.length;s--;)c=f[s],!r&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(f.splice(s,1),c.selector&&f.delegateCount--,h.remove&&h.remove.call(t,c));o&&!f.length&&(h.teardown&&!1!==h.teardown.call(t,p,m.handle)||Et.removeEvent(t,d,m.handle),delete u[d])}else for(d in u)Et.event.remove(t,d+e[l],n,i,!0);Et.isEmptyObject(u)&&Wt.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,s,o,a=new Array(arguments.length),u=Et.event.fix(t),l=(Wt.get(this,"events")||Object.create(null))[u.type]||[],c=Et.event.special[u.type]||{};for(a[0]=u,e=1;e=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(s=[],o={},n=0;n-1:Et.find(r,this,null,[l]).length),o[r]&&s.push(i);s.length&&a.push({elem:l,handlers:s})}return l=this,u\s*$/g;Et.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,r,s,o,a=t.cloneNode(!0),u=ee(t);if(!(vt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||Et.isXMLDoc(t)))for(o=k(a),s=k(t),i=0,r=s.length;i0&&E(o,!u&&k(t,"script")),a},cleanData:function(t){for(var e,n,i,r=Et.event.special,s=0;void 0!==(n=t[s]);s++)if(Ut(n)){if(e=n[Wt.expando]){if(e.events)for(i in e.events)r[i]?Et.event.remove(n,i):Et.removeEvent(n,i,e.handle);n[Wt.expando]=void 0}n[Zt.expando]&&(n[Zt.expando]=void 0)}}}),Et.fn.extend({detach:function(t){return R(this,t,!0)},remove:function(t){return R(this,t)},text:function(t){return Ht(this,function(t){return void 0===t?Et.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){j(this,t).appendChild(t)}})},prepend:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=j(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(Et.cleanData(k(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return Et.clone(this,t,e)})},html:function(t){return Ht(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!he.test(t)&&!ue[(oe.exec(t)||["",""])[1].toLowerCase()]){t=Et.htmlPrefilter(t);try{for(;n1)}}),Et.Tween=H,H.prototype={constructor:H,init:function(t,e,n,i,r,s){this.elem=t, -this.prop=n,this.easing=r||Et.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=s||(Et.cssNumber[n]?"":"px")},cur:function(){var t=H.propHooks[this.prop];return t&&t.get?t.get(this):H.propHooks._default.get(this)},run:function(t){var e,n=H.propHooks[this.prop];return this.options.duration?this.pos=e=Et.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=Et.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){Et.fx.step[t.prop]?Et.fx.step[t.prop](t):1!==t.elem.nodeType||!Et.cssHooks[t.prop]&&null==t.elem.style[B(t.prop)]?t.elem[t.prop]=t.now:Et.style(t.elem,t.prop,t.now+t.unit)}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},Et.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},Et.fx=H.prototype.init,Et.fx.step={};var Ce,Se,Te=/^(?:toggle|show|hide)$/,Ae=/queueHooks$/;Et.Animation=Et.extend(G,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return b(n.elem,t,Yt.exec(e),n),n}]},tweener:function(t,e){yt(t)?(e=t,t=["*"]):t=t.match(qt);for(var n,i=0,r=t.length;i1)},removeAttr:function(t){return this.each(function(){Et.removeAttr(this,t)})}}),Et.extend({attr:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?Et.prop(t,e,n):(1===s&&Et.isXMLDoc(t)||(r=Et.attrHooks[e.toLowerCase()]||(Et.expr.match.bool.test(e)?je:void 0)),void 0!==n?null===n?void Et.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=Et.find.attr(t,e),null==i?void 0:i))},attrHooks:{type:{set:function(t,e){if(!vt.radioValue&&"radio"===e&&s(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(qt);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),je={set:function(t,e,n){return!1===e?Et.removeAttr(t,n):t.setAttribute(n,n),n}},Et.each(Et.expr.match.bool.source.match(/\w+/g),function(t,e){var n=Ne[e]||Et.find.attr;Ne[e]=function(t,e,i){var r,s,o=e.toLowerCase();return i||(s=Ne[o],Ne[o]=r,r=null!=n(t,e,i)?o:null,Ne[o]=s),r}});var Oe=/^(?:input|select|textarea|button)$/i,Pe=/^(?:a|area)$/i;Et.fn.extend({prop:function(t,e){return Ht(this,Et.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[Et.propFix[t]||t]})}}),Et.extend({prop:function(t,e,n){var i,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&Et.isXMLDoc(t)||(e=Et.propFix[e]||e,r=Et.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=Et.find.attr(t,"tabindex");return e?parseInt(e,10):Oe.test(t.nodeName)||Pe.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),vt.optSelected||(Et.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),Et.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Et.propFix[this.toLowerCase()]=this}),Et.fn.extend({addClass:function(t){var e,n,i,r,s,o;return yt(t)?this.each(function(e){Et(this).addClass(t.call(this,e,Y(this)))}):(e=J(t),e.length?this.each(function(){if(i=Y(this),n=1===this.nodeType&&" "+Q(i)+" "){for(s=0;s-1;)n=n.replace(" "+r+" "," ");o=Q(n),i!==o&&this.setAttribute("class",o)}}):this):this.attr("class","")},toggleClass:function(t,e){var n,i,r,s,o=typeof t,a="string"===o||Array.isArray(t);return yt(t)?this.each(function(n){Et(this).toggleClass(t.call(this,n,Y(this),e),e)}):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(n=J(t),this.each(function(){if(a)for(s=Et(this),r=0;r-1)return!0;return!1}});var De=/\r/g;Et.fn.extend({val:function(t){var e,n,i,r=this[0];{if(arguments.length)return i=yt(t),this.each(function(n){var r;1===this.nodeType&&(r=i?t.call(this,n,Et(this).val()):t,null==r?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=Et.map(r,function(t){return null==t?"":t+""})),(e=Et.valHooks[this.type]||Et.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))});if(r)return(e=Et.valHooks[r.type]||Et.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:(n=r.value,"string"==typeof n?n.replace(De,""):null==n?"":n)}}}),Et.extend({valHooks:{option:{get:function(t){var e=Et.find.attr(t,"value");return null!=e?e:Q(Et.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,a="select-one"===t.type,u=a?null:[],l=a?o+1:r.length;for(i=o<0?l:a?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),s}}}}),Et.each(["radio","checkbox"],function(){Et.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=Et.inArray(Et(t).val(),e)>-1}},vt.checkOn||(Et.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Me=t.location,Re={guid:Date.now()},Le=/\?/;Et.parseXML=function(e){var n,i;if(!e||"string"!=typeof e)return null;try{n=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||Et.error("Invalid XML: "+(i?Et.map(i.childNodes,function(t){return t.textContent}).join("\n"):e)),n};var Ie=/^(?:focusinfocus|focusoutblur)$/,Ve=function(t){t.stopPropagation()};Et.extend(Et.event,{trigger:function(e,n,i,r){var s,o,a,u,l,c,h,f,d=[i||wt],p=pt.call(e,"type")?e.type:e,g=pt.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=i=i||wt,3!==i.nodeType&&8!==i.nodeType&&!Ie.test(p+Et.event.triggered)&&(p.indexOf(".")>-1&&(g=p.split("."),p=g.shift(),g.sort()),l=p.indexOf(":")<0&&"on"+p,e=e[Et.expando]?e:new Et.Event(p,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:Et.makeArray(n,[e]),h=Et.event.special[p]||{},r||!h.trigger||!1!==h.trigger.apply(i,n))){if(!r&&!h.noBubble&&!bt(i)){for(u=h.delegateType||p,Ie.test(u+p)||(o=o.parentNode);o;o=o.parentNode)d.push(o),a=o;a===(i.ownerDocument||wt)&&d.push(a.defaultView||a.parentWindow||t)}for(s=0;(o=d[s++])&&!e.isPropagationStopped();)f=o,e.type=s>1?u:h.bindType||p,c=(Wt.get(o,"events")||Object.create(null))[e.type]&&Wt.get(o,"handle"),c&&c.apply(o,n),(c=l&&o[l])&&c.apply&&Ut(o)&&(e.result=c.apply(o,n),!1===e.result&&e.preventDefault());return e.type=p,r||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(d.pop(),n)||!Ut(i)||l&&yt(i[p])&&!bt(i)&&(a=i[l],a&&(i[l]=null),Et.event.triggered=p,e.isPropagationStopped()&&f.addEventListener(p,Ve),i[p](),e.isPropagationStopped()&&f.removeEventListener(p,Ve),Et.event.triggered=void 0,a&&(i[l]=a)),e.result}},simulate:function(t,e,n){var i=Et.extend(new Et.Event,n,{type:t,isSimulated:!0});Et.event.trigger(i,null,e)}}),Et.fn.extend({trigger:function(t,e){return this.each(function(){Et.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return Et.event.trigger(t,e,n,!0)}});var Be=/\[\]$/,qe=/\r?\n/g,Fe=/^(?:submit|button|image|reset|file)$/i,ze=/^(?:input|select|textarea|keygen)/i;Et.param=function(t,e){var n,i=[],r=function(t,e){var n=yt(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!Et.isPlainObject(t))Et.each(t,function(){r(this.name,this.value)});else for(n in t)tt(n,t[n],e,r);return i.join("&")},Et.fn.extend({serialize:function(){return Et.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=Et.prop(this,"elements");return t?Et.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!Et(this).is(":disabled")&&ze.test(this.nodeName)&&!Fe.test(t)&&(this.checked||!se.test(t))}).map(function(t,e){var n=Et(this).val();return null==n?null:Array.isArray(n)?Et.map(n,function(t){return{name:e.name,value:t.replace(qe,"\r\n")}}):{name:e.name,value:n.replace(qe,"\r\n")}}).get()}});var He=/%20/g,Ke=/#.*$/,$e=/([?&])_=[^&]*/,Ue=/^(.*?):[ \t]*([^\r\n]*)$/gm,We=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ze=/^(?:GET|HEAD)$/,Xe=/^\/\//,Ge={},Qe={},Ye="*/".concat("*"),Je=wt.createElement("a");Je.href=Me.href,Et.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Me.href,type:"GET",isLocal:We.test(Me.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ye,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":Et.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?it(it(t,Et.ajaxSettings),e):it(Et.ajaxSettings,t)},ajaxPrefilter:et(Ge),ajaxTransport:et(Qe),ajax:function(e,n){function i(e,n,i,a){var l,f,d,w,x,k=n;c||(c=!0,u&&t.clearTimeout(u),r=void 0,o=a||"",E.readyState=e>0?4:0,l=e>=200&&e<300||304===e,i&&(w=rt(p,E,i)),!l&&Et.inArray("script",p.dataTypes)>-1&&Et.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=st(p,w,E,l),l?(p.ifModified&&(x=E.getResponseHeader("Last-Modified"),x&&(Et.lastModified[s]=x),(x=E.getResponseHeader("etag"))&&(Et.etag[s]=x)),204===e||"HEAD"===p.type?k="nocontent":304===e?k="notmodified":(k=w.state,f=w.data,d=w.error,l=!d)):(d=k,!e&&k||(k="error",e<0&&(e=0))),E.status=e,E.statusText=(n||k)+"",l?v.resolveWith(g,[f,k,E]):v.rejectWith(g,[E,k,d]),E.statusCode(b),b=void 0,h&&m.trigger(l?"ajaxSuccess":"ajaxError",[E,p,l?f:d]),y.fireWith(g,[E,k]),h&&(m.trigger("ajaxComplete",[E,p]),--Et.active||Et.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=void 0),n=n||{};var r,s,o,a,u,l,c,h,f,d,p=Et.ajaxSetup({},n),g=p.context||p,m=p.context&&(g.nodeType||g.jquery)?Et(g):Et.event,v=Et.Deferred(),y=Et.Callbacks("once memory"),b=p.statusCode||{},w={},x={},k="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(c){if(!a)for(a={};e=Ue.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==c&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)E.always(t[E.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||k;return r&&r.abort(e),i(0,e),this}};if(v.promise(E),p.url=((e||p.url||Me.href)+"").replace(Xe,Me.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(qt)||[""],null==p.crossDomain){l=wt.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Je.protocol+"//"+Je.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=Et.param(p.data,p.traditional)),nt(Ge,p,n,E),c)return E;h=Et.event&&p.global,h&&0==Et.active++&&Et.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ze.test(p.type),s=p.url.replace(Ke,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(He,"+")):(d=p.url.slice(s.length),p.data&&(p.processData||"string"==typeof p.data)&&(s+=(Le.test(s)?"&":"?")+p.data,delete p.data),!1===p.cache&&(s=s.replace($e,"$1"),d=(Le.test(s)?"&":"?")+"_="+Re.guid+++d),p.url=s+d),p.ifModified&&(Et.lastModified[s]&&E.setRequestHeader("If-Modified-Since",Et.lastModified[s]),Et.etag[s]&&E.setRequestHeader("If-None-Match",Et.etag[s])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ye+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)E.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(g,E,p)||c))return E.abort();if(k="abort",y.add(p.complete),E.done(p.success),E.fail(p.error),r=nt(Qe,p,n,E)){if(E.readyState=1,h&&m.trigger("ajaxSend",[E,p]),c)return E;p.async&&p.timeout>0&&(u=t.setTimeout(function(){E.abort("timeout")},p.timeout));try{c=!1,r.send(w,i)}catch(t){if(c)throw t;i(-1,t)}}else i(-1,"No Transport");return E},getJSON:function(t,e,n){return Et.get(t,e,n,"json")},getScript:function(t,e){return Et.get(t,void 0,e,"script")}}),Et.each(["get","post"],function(t,e){Et[e]=function(t,n,i,r){return yt(n)&&(r=r||i,i=n,n=void 0),Et.ajax(Et.extend({url:t,type:e,dataType:r,data:n,success:i},Et.isPlainObject(t)&&t))}}),Et.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),Et._evalUrl=function(t,e,n){return Et.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){Et.globalEval(t,e,n)}})},Et.fn.extend({wrapAll:function(t){var e;return this[0]&&(yt(t)&&(t=t.call(this[0])),e=Et(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return yt(t)?this.each(function(e){Et(this).wrapInner(t.call(this,e))}):this.each(function(){var e=Et(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=yt(t);return this.each(function(n){Et(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){Et(this).replaceWith(this.childNodes)}),this}}),Et.expr.pseudos.hidden=function(t){return!Et.expr.pseudos.visible(t)},Et.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},Et.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var tn={0:200,1223:204},en=Et.ajaxSettings.xhr();vt.cors=!!en&&"withCredentials"in en,vt.ajax=en=!!en,Et.ajaxTransport(function(e){var n,i;if(vt.cors||en&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)a.setRequestHeader(o,r[o]);n=function(t){return function(){n&&(n=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(tn[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),i=a.onerror=a.ontimeout=n("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout(function(){n&&i()})},n=n("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(n)throw t}},abort:function(){n&&n()}}}),Et.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),Et.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return Et.globalEval(t),t}}}),Et.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Et.ajaxTransport("script",function(t){if(t.crossDomain||t.scriptAttrs){var e,n;return{send:function(i,r){e=Et("