From 750b840955ab0db183749960d47e734aa4a3c064 Mon Sep 17 00:00:00 2001 From: Yuriy Voznyak Date: Mon, 13 May 2019 18:25:07 +0300 Subject: [PATCH 01/13] changed functions for hub flash/connect; use token from EiS project if possible --- public/javascripts/WebBridge.ts | 180 ++++++++++++++++---------------- public/javascripts/api/core.ts | 9 +- 2 files changed, 98 insertions(+), 91 deletions(-) diff --git a/public/javascripts/WebBridge.ts b/public/javascripts/WebBridge.ts index c214095..fbf707f 100644 --- a/public/javascripts/WebBridge.ts +++ b/public/javascripts/WebBridge.ts @@ -5,7 +5,6 @@ import {debug, DebugType} from "./Debug"; import {SerialHandler} from "./SerialHandler"; import AuthAPIService from "./api/login"; import HubsAPIService from "./api/hubs"; -import axios from "axios"; const DEFAULT_BAUD = 115200; const FLASH_PAGE_SIZE = 59; @@ -90,67 +89,21 @@ getTranslations(); /*** * Opens option to choose a webUSB device filtered using micro:bit's vendor ID. */ -function selectDevice(): Promise { +function selectDevice(): Promise { setStatus("Select a device"); return new Promise((resolve, reject) => { navigator.usb.requestDevice({ - filters: [{vendorId: 0xD28}] + filters: [{vendorId: 0x0d28, productId: 0x0204}] + }).then((device) => { + resolve(device); }) - .then((device) => { - connect(device, hub_variables.dapjs.baud_rate) - .then((success) => { - resolve("Connected to " + (device.productName != "" ? device.productName : "micro:bit")); - }) - .catch((error) => { - reject("Failed to connect to device"); - }) - }) .catch((error) => { - reject(DEFAULT_STATUS); + reject(error); }); }); } -/*** - * Connect to given device with chosen baud rate and add listeners for receiving and disconnections. - * - * @param device WebUSB micro:bit instance - * @param baud Baud rate for serial communication between micro:bit (usually 115200) - * @returns {PromiseLike} - */ -function connect(device, baud: number) { - setStatus("Connecting..."); - - const transport = new WebUSB(device); - const target = new DAPLink(transport); - - // create a SerialHandler to handle all serial communication - serialHandler = new SerialHandler(target, hub_variables, baud); - - return target.connect() - .then(() => { - //setStatus("Connected to " + (device.productName != "" ? device.productName : "micro:bit")); - target.setSerialBaudrate(baud); // set the baud rate after connecting - serialNumber = device.serialNumber; // store serial number for comparison when disconnecting - return target.getSerialBaudrate(); - }) - .then(baud => { - target.startSerialRead(hub_variables.dapjs.serial_delay); - console.log(`Listening at ${baud} baud...`); - targetDevice = target; - - /*targetDevice.reset(); - // start a timeout check to see if hub authenticates or not for automatic flashing - setTimeout(() => { - if(!hub_variables.authenticated) { - flashDevice(targetDevice); - } - }, hub_variables.dapjs.flash_timeout);*/ - }) - .catch(e => console.log(e)); -} - /*** * Disconnects the micro:bit, and resets the front end and hub variables. */ @@ -186,28 +139,79 @@ function disconnect() { targetDevice = null; // destroy DAPLink } -function downloadHex() { - return axios.get(`http://localhost:3000/hex`, {responseType: 'arraybuffer'}) - .catch((error) => { - console.log("ERROR" + error); - }); +/** + * Connect to given device and add listeners for receiving and disconnections. + * + * @param device WebUSB micro:bit instance + * @returns {PromiseLike} + */ +function connect(device: USBDevice): Promise { + return new Promise((resolve, reject) => { + if (targetDevice) targetDevice.stopSerialRead(); + + // Connect to device + const transport = new WebUSB(device); + targetDevice = new DAPLink(transport); + serialNumber = device.serialNumber; + + // Ensure disconnected + targetDevice.disconnect(); + + targetDevice.connect() + .then(() => targetDevice.setSerialBaudrate(hub_variables.dapjs.baud_rate)) + .then(() => targetDevice.getSerialBaudrate()) + .then(baud => { + targetDevice.startSerialRead(hub_variables.dapjs.serial_delay); + console.log(`Listening at ${baud} baud...`); + serialHandler = new SerialHandler(targetDevice, hub_variables, baud); + resolve("Connected to " + (device.productName != "" ? device.productName : "micro:bit")); + }) + .catch(err => { + console.log(err); + reject(`Failed to connect : ${err}`); + }); + }); } -function flashDevice(targetDevice: DAPLink) { - console.log("Downloading hub hex file"); +function flashDevice(device: USBDevice): Promise { + return new Promise((resolve, reject) => { + hub_variables["authenticated"] = false; + hub_variables["school_id"] = ""; + hub_variables["pi_id"] = ""; - downloadHex().then((success) => { - console.log(success["data"]); - let program = new Uint8Array(success["data"]).buffer; - console.log(program); + if (targetDevice) targetDevice.stopSerialRead(); - /*targetDevice.flash(program) - .then((success) => { - console.log(success); - }) - .catch((error) => { - console.log(error); - });*/ + HubsAPIService.getHubFirmware(selectedHubUID).then((firmware: ArrayBuffer) => { + // Connect to device + const transport = new WebUSB(device); + targetDevice = new DAPLink(transport); + + // Ensure disconnected + targetDevice.disconnect(); + + // Event to monitor flashing progress + targetDevice.on(DAPLink.EVENT_PROGRESS, function (progress) { + setStatus(`Flashing: ${Math.round(progress * 100)}%`) + }); + + // Push binary to board + return targetDevice.connect() + .then(() => { + console.log("Flashing"); + return targetDevice.flash(firmware); + }) + .then(() => { + console.log("Finished flashing! Reconnect micro:bit"); + resolve("Finished flashing! Reconnect micro:bit"); + return targetDevice.disconnect(); + }) + .catch((e) => { + reject("Error flashing: " + e); + console.log("Error flashing: " + e); + }) + }).catch(() => { + reject("Failed to get hub firmware") + }) }); } @@ -246,9 +250,13 @@ navigator.usb.addEventListener('disconnect', (device) => { connectButton.on('click', () => { if (connectButton.text() == "Connect") { selectDevice() - .then((success) => { + .then((device: USBDevice) => { + setStatus("Connecting..."); + return connect(device); + }) + .then((message) => { connectButton.text("Disconnect"); - setStatus(success); + setStatus(message); }) .catch((error) => { setStatus(error); @@ -268,25 +276,17 @@ flashButton.on('click', () => { alert("Hub firmware should be selected!"); return } - if (!targetDevice) { - alert("Microbit is not connected!"); - return - } - - hub_variables["authenticated"] = false; - hub_variables["school_id"] = ""; - hub_variables["pi_id"] = ""; - HubsAPIService.getHubFirmware(selectedHubUID).then((firmware: ArrayBuffer) => { - targetDevice.flash(firmware, FLASH_PAGE_SIZE).then((result) => { - targetDevice.reconnect(); - alert("Flashed successfully! You need to reconnect device before using") - disconnect() - }).catch((error) => { - console.log(error); - alert("Flashing error") + selectDevice() + .then((device: USBDevice) => { + return flashDevice(device) }) - }); + .then((message) => { + setStatus(message); + }) + .catch((error) => { + setStatus(error); + }); }); /** @@ -314,7 +314,7 @@ loginButton.on('click', () => { }); hubsSelect.on('change', function () { - selectedHubUID = this.value; + selectedHubUID = (this as HTMLInputElement).value; }); /** diff --git a/public/javascripts/api/core.ts b/public/javascripts/api/core.ts index 8987f84..7d5668b 100644 --- a/public/javascripts/api/core.ts +++ b/public/javascripts/api/core.ts @@ -9,6 +9,8 @@ export class AbstractApiService { static REFRESH_TOKEN_PARAM = 'refresh'; + static EIS_TOKEN_PARAM = 'apiAuth'; + static UNAUTHORIZED_CODE = 401; // Default unauthorized code static FETCH_ACCESS_TOKEN_ENDPOINT = '/token/refresh/'; @@ -111,7 +113,11 @@ export class AbstractApiService { } get AccessToken() { - return localStorage.getItem(AbstractApiService.ACCESS_TOKEN_PARAM); + try { + return JSON.parse(localStorage.getItem(AbstractApiService.EIS_TOKEN_PARAM))[AbstractApiService.ACCESS_TOKEN_PARAM] + } catch (e) { + return localStorage.getItem(AbstractApiService.ACCESS_TOKEN_PARAM); + } } set AccessToken(value) { @@ -137,6 +143,7 @@ export class AbstractApiService { cleanTokens() { localStorage.removeItem(AbstractApiService.ACCESS_TOKEN_PARAM); localStorage.removeItem(AbstractApiService.REFRESH_TOKEN_PARAM) + localStorage.removeItem(AbstractApiService.EIS_TOKEN_PARAM) } } From 693339b1c6fe48b08e48e3311317159edefcd75a Mon Sep 17 00:00:00 2001 From: Yuriy Voznyak Date: Wed, 15 May 2019 15:24:50 +0300 Subject: [PATCH 02/13] Yaroslav changes --- public/javascripts/WebBridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/WebBridge.ts b/public/javascripts/WebBridge.ts index fbf707f..47645e6 100644 --- a/public/javascripts/WebBridge.ts +++ b/public/javascripts/WebBridge.ts @@ -46,7 +46,7 @@ let hub_variables = { }, "dapjs": { "serial_delay": 200, - "baud_rate": 115200, + "baud_rate": 57600, "flash_timeout": 5000, "reset_pause": 1000 } From 2fcfc7bf39c37cbbed3a4e0a9cf7d0dfeceaa2e6 Mon Sep 17 00:00:00 2001 From: Yuriy Voznyak Date: Mon, 20 May 2019 12:57:12 +0300 Subject: [PATCH 03/13] baud rate revert --- public/javascripts/WebBridge.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/WebBridge.ts b/public/javascripts/WebBridge.ts index 47645e6..fbf707f 100644 --- a/public/javascripts/WebBridge.ts +++ b/public/javascripts/WebBridge.ts @@ -46,7 +46,7 @@ let hub_variables = { }, "dapjs": { "serial_delay": 200, - "baud_rate": 57600, + "baud_rate": 115200, "flash_timeout": 5000, "reset_pause": 1000 } From 03d3220314d336cf0063c3770f9864f927892d3f Mon Sep 17 00:00:00 2001 From: Yaroslav Neznaradko Date: Thu, 30 May 2019 16:27:04 +0300 Subject: [PATCH 04/13] add node_modules to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 2ac8067..b4c3068 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ public/javascripts/*.map public/javascripts/*.js public/javascripts/**/*.map public/javascripts/**/*.js + +node_modules From 1d710e0ad4dc50a83d092e0f0c0f66ff5fc23f2b Mon Sep 17 00:00:00 2001 From: Yaroslav Neznaradko Date: Mon, 3 Jun 2019 15:14:04 +0300 Subject: [PATCH 05/13] Init new webpack structure (#13) * init new webpack structure * added environment related builds * added sidebars.js * fixed issues with build * back sidebars code * removed issue with duplicated favicon * added latest release * update latest translations * updated README, webpack refactor --- README.md | 29 +- debug.json | 0 {public => dist}/favicon.ico | Bin {public => dist}/images/microbit.png | Bin dist/index.html | 1 + dist/javascripts/WebBridge.bundle.js | 66 + dist/javascripts/sidebars.js | 46 + dist/stylesheets/styles.css | 336 + translations.json => dist/translations.json | 9 +- images/favicon.ico | Bin 0 -> 32988 bytes images/microbit.png | Bin 0 -> 141912 bytes libs/sidebars.js | 46 + package-lock.json | 8522 +++++++++++------ package.json | 35 +- app.js => routes[deprecated]/app.js | 0 {routes => routes[deprecated]}/hex.js | 0 {routes => routes[deprecated]}/index.js | 0 {routes => routes[deprecated]}/proxy.js | 0 {routes => routes[deprecated]}/telemetry.js | 0 .../translations.js | 0 {public/javascripts => src}/Debug.ts | 2 +- {public/javascripts => src}/Packet.ts | 0 {public/javascripts => src}/RequestHandler.ts | 0 {public/javascripts => src}/SerialHandler.ts | 2 +- {public/javascripts => src}/SerialPacket.ts | 0 {public/javascripts => src}/Translations.ts | 0 {public/javascripts => src}/WebBridge.ts | 6 +- {public/javascripts => src}/api/core.ts | 4 +- {public/javascripts => src}/api/hubs.ts | 0 {public/javascripts => src}/api/login.ts | 0 {public/javascripts => src}/api/weather.ts | 0 .../javascripts => src}/constants/Config.ts | 3 + .../javascripts => src}/utils/JsonUtils.ts | 0 {public/stylesheets => stylesheets}/style.css | 0 {views => templates}/error.pug | 0 {views => templates}/index.pug | 6 +- {views => templates}/layout.pug | 1 - translations/translations_local.json | 567 ++ translations/translations_prod.json | 567 ++ translations/translations_staging.json | 567 ++ translations_new.json | 39 - tsconfig.json | 6 +- webpack.config.js | 78 + 43 files changed, 8054 insertions(+), 2884 deletions(-) delete mode 100644 debug.json rename {public => dist}/favicon.ico (100%) rename {public => dist}/images/microbit.png (100%) create mode 100644 dist/index.html create mode 100644 dist/javascripts/WebBridge.bundle.js create mode 100644 dist/javascripts/sidebars.js create mode 100644 dist/stylesheets/styles.css rename translations.json => dist/translations.json (98%) create mode 100644 images/favicon.ico create mode 100644 images/microbit.png create mode 100644 libs/sidebars.js rename app.js => routes[deprecated]/app.js (100%) rename {routes => routes[deprecated]}/hex.js (100%) rename {routes => routes[deprecated]}/index.js (100%) rename {routes => routes[deprecated]}/proxy.js (100%) rename {routes => routes[deprecated]}/telemetry.js (100%) rename {routes => routes[deprecated]}/translations.js (100%) rename {public/javascripts => src}/Debug.ts (96%) rename {public/javascripts => src}/Packet.ts (100%) rename {public/javascripts => src}/RequestHandler.ts (100%) rename {public/javascripts => src}/SerialHandler.ts (99%) rename {public/javascripts => src}/SerialPacket.ts (100%) rename {public/javascripts => src}/Translations.ts (100%) rename {public/javascripts => src}/WebBridge.ts (98%) rename {public/javascripts => src}/api/core.ts (97%) rename {public/javascripts => src}/api/hubs.ts (100%) rename {public/javascripts => src}/api/login.ts (100%) rename {public/javascripts => src}/api/weather.ts (100%) rename {public/javascripts => src}/constants/Config.ts (81%) rename {public/javascripts => src}/utils/JsonUtils.ts (100%) rename {public/stylesheets => stylesheets}/style.css (100%) rename {views => templates}/error.pug (100%) rename {views => templates}/index.pug (92%) rename {views => templates}/layout.pug (81%) create mode 100644 translations/translations_local.json create mode 100644 translations/translations_prod.json create mode 100644 translations/translations_staging.json delete mode 100644 translations_new.json create mode 100644 webpack.config.js diff --git a/README.md b/README.md index d39e398..c9a5e34 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ This project is a webapp-based implementation of the Energy in Schools hub that ## Feature Request and Issue Tracking Please add an issue if you wish for any additional features or discover any issues using this project. Tracking changes will keep things organised. -## Local Server -This WebBridge will require an install of the latest version of NodeJS. - **Note: WebUSB is only available via a secure HTTPS connection or ``localhost`` for development.** ### Running @@ -18,35 +15,23 @@ npm install npm start ``` -By default, this application is hosted on port 3000 at ``http://localhost:3000/``. This is intended for development as WebUSB requires a secure HTTPs connection, or localhost for development. -This can be changed by heading into the ``bin\ServerConfig.js`` and modifying the configurations. +By default, this application is hosted on port 3000 at ``http://localhost:8080/``. This is intended for development as WebUSB requires a secure HTTPs connection, or localhost for development. ### Building -Modifications to any of the TypeScript files found in ``public\javascript`` must be compiled into JavaScript and further bundled together using Browserify and minified using uglify. - ``` -cd public\javascript -browserify WebBridge.js > WebBridge.bundle.js +npm run build // translation localhost:4000 +npm run build:staging // translations staging +npm run build:production // translatinos production ``` -Upon deploying to production, run this process through uglifyjs to remove comments and minify the bundled output. - -``` -cd public\javascript -browserify WebBridge.js | uglifyjs -c > WebBridge.bundle.js -``` +### Local development +For local development setup you might be interested in launching chrome without internet security with disabled CORS +`npm run chrome-without-web-security` ### Node Modules (DAPjs) At the moment, this repo has not been cleaned up and may contain a load of potentially useless (for this project) node modules. That being said, this project relies on the [DAPjs](https://github.com/ARMmbed/dapjs) JavaScript interface for the main serial communication between the webapp and the bridging micro:bit. To install the required node modules, be sure to run ``npm install`` before running the server. -## Project Notes -As JavaScript/TypeScript aren't my strongest language, and my knowledge of NodeJS was lacking, I decided to start with a simple, yet useful project to allow serial communication via the WebUSB standard. This was then improved upon to create a bridge between micro:bits and the internet. - -I built this project using WebStorm's brilliant Node.JS Express App generator and utilised the features provided. With the division of business logic and views, modifying the look and feel of the page while maintaining the technical stuff was made very simple. The rendering is achieved via Jade and CSS located in the ``views`` and ``public\stylesheets`` folders, while the logic uses TypeScript found throughout the repo. - -**Note: This project is a bit messy at the minute. There are some files within this project that are there purely for local testing purposes and will be removed once complete.** - ## Repos [DAPjs](https://github.com/ARMmbed/dapjs) JavaScript interface to CMSIS-DAP diff --git a/debug.json b/debug.json deleted file mode 100644 index e69de29..0000000 diff --git a/public/favicon.ico b/dist/favicon.ico similarity index 100% rename from public/favicon.ico rename to dist/favicon.ico diff --git a/public/images/microbit.png b/dist/images/microbit.png similarity index 100% rename from public/images/microbit.png rename to dist/images/microbit.png diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..58bc6c8 --- /dev/null +++ b/dist/index.html @@ -0,0 +1 @@ +

Connect to a micro:bit and flash the bridging software
Terminal
History
\ No newline at end of file diff --git a/dist/javascripts/WebBridge.bundle.js b/dist/javascripts/WebBridge.bundle.js new file mode 100644 index 0000000..d677ba8 --- /dev/null +++ b/dist/javascripts/WebBridge.bundle.js @@ -0,0 +1,66 @@ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([function(e,t,n){"use strict";var r=n(10),i=n(32),o=Object.prototype.toString;function u(e){return"[object Array]"===o.call(e)}function a(e){return null!==e&&"object"==typeof e}function s(e){return"[object Function]"===o.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),u(e))for(var n=0,r=e.length;n=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(e){s.headers[e]={}}),r.forEach(["post","put","patch"],function(e){s.headers[e]=r.merge(o)}),e.exports=s}).call(this,n(34))},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(u,a)}s((r=r.apply(e,t||[])).next())})},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const u=i(n(53)),a=o(n(55)),s=o(n(1)),c=n(3);class f{constructor(){this.axiosInterceptors={auth:null},s.default.defaults.baseURL=c.API_ENDPOINT,s.default.defaults.headers.post["Content-Type"]="application/json",this.injectAxiosInterceptors("auth"),s.default.interceptors.response.use(u.identity,e=>r(this,void 0,void 0,function*(){if("ECONNABORTED"!==e.code&&e.response.status!==f.UNAUTHORIZED_CODE||!this.RefreshToken||e.config.isRefreshTokenRequest||e.config.isRetryRequest)return Promise.reject(e);return this.ejectAuthInterceptors("auth"),(yield this.fetchAccessToken())?(this.injectAxiosInterceptors("auth"),s.default(Object.assign({},e.config,{url:e.config.url.replace(s.default.defaults.baseURL,""),isRetryRequest:!0}))):Promise.reject(e)}))}injectAxiosInterceptors(e){const t=Array.isArray(e)?e:[e],n=e=>u.merge(e,{headers:{authorization:`Bearer ${this.AccessToken}`}});for(const e of t){let t=null;switch(e){case"auth":t=s.default.interceptors.request.use(n)}this.axiosInterceptors[e]=t}}ejectAuthInterceptors(e){const t=Array.isArray(e)?e:[e];for(const e of t)s.default.interceptors.request.eject(this.axiosInterceptors[e]),this.axiosInterceptors[e]=null}fetchAccessToken(){return r(this,void 0,void 0,function*(){const{data:e}=yield s.default(Object.assign({url:f.FETCH_ACCESS_TOKEN_ENDPOINT,method:"POST",data:{[f.REFRESH_TOKEN_PARAM]:this.RefreshToken}},{isRefreshTokenRequest:!0}));return f.ACCESS_TOKEN_PARAM in e&&(this.AccessToken=e[f.ACCESS_TOKEN_PARAM],!0)})}get AccessToken(){try{return JSON.parse(localStorage.getItem(f.EIS_TOKEN_PARAM))[f.ACCESS_TOKEN_PARAM]}catch(e){return localStorage.getItem(f.ACCESS_TOKEN_PARAM)}}set AccessToken(e){localStorage.setItem(f.ACCESS_TOKEN_PARAM,e)}get RefreshToken(){return localStorage.getItem(f.REFRESH_TOKEN_PARAM)}set RefreshToken(e){localStorage.setItem(f.REFRESH_TOKEN_PARAM,e)}get RoleName(){if(!this.AccessToken)throw new Error("No access token");const e=a.default(this.AccessToken).role;return c.RoleNames[e.toUpperCase()]}cleanTokens(){localStorage.removeItem(f.ACCESS_TOKEN_PARAM),localStorage.removeItem(f.REFRESH_TOKEN_PARAM),localStorage.removeItem(f.EIS_TOKEN_PARAM)}}f.ACCESS_TOKEN_PARAM="access",f.REFRESH_TOKEN_PARAM="refresh",f.EIS_TOKEN_PARAM="apiAuth",f.UNAUTHORIZED_CODE=401,f.FETCH_ACCESS_TOKEN_ENDPOINT="/token/refresh/",t.AbstractApiService=f;t.AbstractHubAuthApiService=class{constructor(e,t){s.default.defaults.headers.post["Content-Type"]="application/json",s.default.defaults.headers.common["school-id"]=e,s.default.defaults.headers.common["pi-id"]=t}}},function(e,t,n){var r; +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,i){"use strict";var o=[],u=n.document,a=Object.getPrototypeOf,s=o.slice,c=o.concat,f=o.push,l=o.indexOf,p={},h=p.toString,d=p.hasOwnProperty,g=d.toString,v=g.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},_=function(e){return null!=e&&e===e.window},w={type:!0,src:!0,noModule:!0};function b(e,t,n){var r,i=(t=t||u).createElement("script");if(i.text=e,n)for(r in w)n[r]&&(i[r]=n[r]);t.head.appendChild(i).parentNode.removeChild(i)}function E(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[h.call(e)]||"object":typeof e}var T=function(e,t){return new T.fn.init(e,t)},x=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function A(e){var t=!!e&&"length"in e&&e.length,n=E(e);return!m(e)&&!_(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}T.fn=T.prototype={jquery:"3.3.1",constructor:T,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+k+")"+k+"*"),W=new RegExp("="+k+"*([^\\]'\"]*?)"+k+"*\\]","g"),Y=new RegExp(M),z=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+k+"*(even|odd|(([+-]|)(\\d*)n|)"+k+"*(?:([+-]|)"+k+"*(\\d+)|))"+k+"*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^"+k+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+k+"*((?:-\\d)?\\d*)"+k+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,J=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+k+"?|("+k+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{D.apply(O=N.call(b.childNodes),b.childNodes),O[b.childNodes.length].nodeType}catch(e){D={apply:O.length?function(e,t){L.apply(e,N.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,r,i){var o,a,c,f,l,d,y,m=t&&t.ownerDocument,E=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return r;if(!i&&((t?t.ownerDocument||t:b)!==h&&p(t),t=t||h,g)){if(11!==E&&(l=K.exec(e)))if(o=l[1]){if(9===E){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(m&&(c=m.getElementById(o))&&_(t,c)&&c.id===o)return r.push(c),r}else{if(l[2])return D.apply(r,t.getElementsByTagName(e)),r;if((o=l[3])&&n.getElementsByClassName&&t.getElementsByClassName)return D.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!v||!v.test(e))){if(1!==E)m=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((f=t.getAttribute("id"))?f=f.replace(te,ne):t.setAttribute("id",f=w),a=(d=u(e)).length;a--;)d[a]="#"+f+" "+ye(d[a]);y=d.join(","),m=J.test(e)&&ge(t.parentNode)||t}if(y)try{return D.apply(r,m.querySelectorAll(y)),r}catch(e){}finally{f===w&&t.removeAttribute("id")}}}return s(e.replace(H,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function ae(e){return e[w]=!0,e}function se(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function le(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function he(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function de(e){return ae(function(t){return t=+t,ae(function(n,r){for(var i,o=e([],n.length,t),u=o.length;u--;)n[i=o[u]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,u=e?e.ownerDocument||e:b;return u!==h&&9===u.nodeType&&u.documentElement?(d=(h=u).documentElement,g=!o(h),b!==h&&(i=h.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=se(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=se(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(h.getElementsByClassName),n.getById=se(function(e){return d.appendChild(e).id=w,!h.getElementsByName||!h.getElementsByName(w).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=Q.test(h.querySelectorAll))&&(se(function(e){d.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+k+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+k+"*(?:value|"+j+")"),e.querySelectorAll("[id~="+w+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]")}),se(function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+k+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=Q.test(m=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&se(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",M)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=Q.test(d.compareDocumentPosition),_=t||Q.test(d.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},R=t?function(e,t){if(e===t)return l=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===h||e.ownerDocument===b&&_(b,e)?-1:t===h||t.ownerDocument===b&&_(b,t)?1:f?U(f,e)-U(f,t):0:4&r?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,u=[e],a=[t];if(!i||!o)return e===h?-1:t===h?1:i?-1:o?1:f?U(f,e)-U(f,t):0;if(i===o)return fe(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;u[r]===a[r];)r++;return r?fe(u[r],a[r]):u[r]===b?-1:a[r]===b?1:0},h):h},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&p(e),t=t.replace(W,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,h,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==h&&p(e),_(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==h&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&C.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(l=!n.detectDuplicates,f=!n.sortStable&&e.slice(0),e.sort(R),l){for(;t=e[o++];)t===e[o]&&(i=r.push(o));for(;i--;)e.splice(r[i],1)}return f=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:ae,match:G,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(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===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]||oe.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]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&Y.test(n)&&(t=u(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(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+k+")"+e+"("+k+"|$)"))&&x(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,s){var c,f,l,p,h,d,g=o!==u?"nextSibling":"previousSibling",v=t.parentNode,y=a&&t.nodeName.toLowerCase(),m=!s&&!a,_=!1;if(v){if(o){for(;g;){for(p=t;p=p[g];)if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[u?v.firstChild:v.lastChild],u&&m){for(_=(h=(c=(f=(l=(p=v)[w]||(p[w]={}))[p.uniqueID]||(l[p.uniqueID]={}))[e]||[])[0]===E&&c[1])&&c[2],p=h&&v.childNodes[h];p=++h&&p&&p[g]||(_=h=0)||d.pop();)if(1===p.nodeType&&++_&&p===t){f[e]=[E,h,_];break}}else if(m&&(_=h=(c=(f=(l=(p=t)[w]||(p[w]={}))[p.uniqueID]||(l[p.uniqueID]={}))[e]||[])[0]===E&&c[1]),!1===_)for(;(p=++h&&p&&p[g]||(_=h=0)||d.pop())&&((a?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++_||(m&&((f=(l=p[w]||(p[w]={}))[p.uniqueID]||(l[p.uniqueID]={}))[e]=[E,_]),p!==t)););return(_-=i)===r||_%r==0&&_/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ae(function(e,n){for(var r,o=i(e,t),u=o.length;u--;)e[r=U(e,o[u])]=!(n[r]=o[u])}):function(e){return i(e,0,n)}):i}},pseudos:{not:ae(function(e){var t=[],n=[],r=a(e.replace(H,"$1"));return r[w]?ae(function(e,t,n,i){for(var o,u=r(e,null,i,[]),a=e.length;a--;)(o=u[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ae(function(e){return function(t){return oe(e,t).length>0}}),contains:ae(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ae(function(e){return z.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:he(!1),disabled:he(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!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!r.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return V.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de(function(){return[0]}),last:de(function(e,t){return[t-1]}),eq:de(function(e,t,n){return[n<0?n+t:n]}),even:de(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:de(function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function we(e,t,n,r,i){for(var o,u=[],a=0,s=e.length,c=null!=t;a-1&&(o[c]=!(u[c]=l))}}else y=we(y===u?y.splice(d,y.length):y),i?i(null,u,y,s):D.apply(u,y)})}function Ee(e){for(var t,n,i,o=e.length,u=r.relative[e[0].type],a=u||r.relative[" "],s=u?1:0,f=me(function(e){return e===t},a,!0),l=me(function(e){return U(t,e)>-1},a,!0),p=[function(e,n,r){var i=!u&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r));return t=null,i}];s1&&_e(p),s>1&&ye(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(H,"$1"),n,s0,i=e.length>0,o=function(o,u,a,s,f){var l,d,v,y=0,m="0",_=o&&[],w=[],b=c,T=o||i&&r.find.TAG("*",f),x=E+=null==b?1:Math.random()||.1,A=T.length;for(f&&(c=u===h||u||f);m!==A&&null!=(l=T[m]);m++){if(i&&l){for(d=0,u||l.ownerDocument===h||(p(l),a=!g);v=e[d++];)if(v(l,u||h,a)){s.push(l);break}f&&(E=x)}n&&((l=!v&&l)&&y--,o&&_.push(l))}if(y+=m,n&&m!==y){for(d=0;v=t[d++];)v(_,w,u,a);if(o){if(y>0)for(;m--;)_[m]||w[m]||(w[m]=P.call(s));w=we(w)}D.apply(s,w),f&&!o&&w.length>0&&y+t.length>1&&oe.uniqueSort(s)}return f&&(E=x,c=b),_};return n?ae(o):o}(o,i))).selector=e}return a},s=oe.select=function(e,t,n,i){var o,s,c,f,l,p="function"==typeof e&&e,h=!i&&u(e=p.selector||e);if(n=n||[],1===h.length){if((s=h[0]=h[0].slice(0)).length>2&&"ID"===(c=s[0]).type&&9===t.nodeType&&g&&r.relative[s[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(o=G.needsContext.test(e)?0:s.length;o--&&(c=s[o],!r.relative[f=c.type]);)if((l=r.find[f])&&(i=l(c.matches[0].replace(Z,ee),J.test(s[0].type)&&ge(t.parentNode)||t))){if(s.splice(o,1),!(e=i.length&&ye(s)))return D.apply(n,i),n;break}}return(p||a(e,h))(i,t,!g,n,!t||J.test(e)&&ge(t.parentNode)||t),n},n.sortStable=w.split("").sort(R).join("")===w,n.detectDuplicates=!!l,p(),n.sortDetached=se(function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))}),se(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ce("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&se(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ce("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),se(function(e){return null==e.getAttribute("disabled")})||ce(j,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(n);T.find=S,T.expr=S.selectors,T.expr[":"]=T.expr.pseudos,T.uniqueSort=T.unique=S.uniqueSort,T.text=S.getText,T.isXMLDoc=S.isXML,T.contains=S.contains,T.escapeSelector=S.escape;var R=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&T(e).is(n))break;r.push(e)}return r},C=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},O=T.expr.match.needsContext;function P(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var L=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,t,n){return m(t)?T.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?T.grep(e,function(e){return e===t!==n}):"string"!=typeof t?T.grep(e,function(e){return l.call(t,e)>-1!==n}):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,function(e){return 1===e.nodeType}))},T.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(T(e).filter(function(){for(t=0;t1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&O.test(e)?T(e):e||[],!1).length}});var N,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||N,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:U.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 T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),L.test(r[1])&&T.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=u.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,N=T(u);var j=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&T.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?T.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?l.call(T(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return R(e,"parentNode")},parentsUntil:function(e,t,n){return R(e,"parentNode",n)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return R(e,"nextSibling")},prevAll:function(e){return R(e,"previousSibling")},nextUntil:function(e,t,n){return R(e,"nextSibling",n)},prevUntil:function(e,t,n){return R(e,"previousSibling",n)},siblings:function(e){return C((e.parentNode||{}).firstChild,e)},children:function(e){return C(e.firstChild)},contents:function(e){return P(e,"iframe")?e.contentDocument:(P(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),this.length>1&&(k[e]||T.uniqueSort(i),j.test(e)&&i.reverse()),this.pushStack(i)}});var B=/[^\x20\t\r\n\f]+/g;function M(e){return e}function q(e){throw e}function H(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(B)||[],function(e,n){t[n]=!0}),t}(e):T.extend({},e);var t,n,r,i,o=[],u=[],a=-1,s=function(){for(i=i||e.once,r=t=!0;u.length;a=-1)for(n=u.shift();++a-1;)o.splice(n,1),n<=a&&a--}),this},has:function(e){return e?T.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=u=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=u=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],u.push(n),t||s()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},T.extend({Deferred:function(e){var t=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return T.Deferred(function(n){T.each(t,function(t,r){var i=m(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&m(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,r,i){var o=0;function u(e,t,r,i){return function(){var a=this,s=arguments,c=function(){var n,c;if(!(e=o&&(r!==q&&(a=void 0,s=[n]),t.rejectWith(a,s))}};e?f():(T.Deferred.getStackHook&&(f.stackTrace=T.Deferred.getStackHook()),n.setTimeout(f))}}return T.Deferred(function(n){t[0][3].add(u(0,n,m(i)?i:M,n.notifyWith)),t[1][3].add(u(0,n,m(e)?e:M)),t[2][3].add(u(0,n,m(r)?r:q))}).promise()},promise:function(e){return null!=e?T.extend(e,i):i}},o={};return T.each(t,function(e,n){var u=n[2],a=n[5];i[n[1]]=u.add,a&&u.add(function(){r=a},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),u.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=u.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=T.Deferred(),u=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(H(e,o.done(u(n)).resolve,o.reject,!t),"pending"===o.state()||m(i[n]&&i[n].then)))return o.then();for(;n--;)H(i[n],u(n),o.reject);return o.promise()}});var F=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&F.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},T.readyException=function(e){n.setTimeout(function(){throw e})};var $=T.Deferred();function W(){u.removeEventListener("DOMContentLoaded",W),n.removeEventListener("load",W),T.ready()}T.fn.ready=function(e){return $.then(e).catch(function(e){T.readyException(e)}),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||$.resolveWith(u,[T]))}}),T.ready.then=$.then,"complete"===u.readyState||"loading"!==u.readyState&&!u.documentElement.doScroll?n.setTimeout(T.ready):(u.addEventListener("DOMContentLoaded",W),n.addEventListener("load",W));var Y=function(e,t,n,r,i,o,u){var a=0,s=e.length,c=null==n;if("object"===E(n))for(a in i=!0,n)Y(e,t,a,n[a],!0,o,u);else if(void 0!==r&&(i=!0,m(r)||(u=!0),c&&(u?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(T(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){T.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:T.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,de=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&P(e,t)?T.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n-1)i&&i.push(o);else if(c=T.contains(o.ownerDocument,o),u=ve(l.appendChild(o),"script"),c&&ye(u),n)for(f=0;o=u[f++];)de.test(o.type||"")&&n.push(o);return l}me=u.createDocumentFragment().appendChild(u.createElement("div")),(_e=u.createElement("input")).setAttribute("type","radio"),_e.setAttribute("checked","checked"),_e.setAttribute("name","t"),me.appendChild(_e),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Ee=u.documentElement,Te=/^key/,xe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ae=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Re(){return!1}function Ce(){try{return u.activeElement}catch(e){}}function Oe(e,t,n,r,i,o){var u,a;if("object"==typeof t){for(a in"string"!=typeof n&&(r=r||n,n=void 0),t)Oe(e,a,n,r,t[a],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=Re;else if(!i)return e;return 1===o&&(u=i,(i=function(e){return T().off(e),u.apply(this,arguments)}).guid=u.guid||(u.guid=T.guid++)),e.each(function(){T.event.add(this,t,i,r,n)})}T.event={global:{},add:function(e,t,n,r,i){var o,u,a,s,c,f,l,p,h,d,g,v=J.get(e);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&T.find.matchesSelector(Ee,i),n.guid||(n.guid=T.guid++),(s=v.events)||(s=v.events={}),(u=v.handle)||(u=v.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(B)||[""]).length;c--;)h=g=(a=Ae.exec(t[c])||[])[1],d=(a[2]||"").split(".").sort(),h&&(l=T.event.special[h]||{},h=(i?l.delegateType:l.bindType)||h,l=T.event.special[h]||{},f=T.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:d.join(".")},o),(p=s[h])||((p=s[h]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(e,r,d,u)||e.addEventListener&&e.addEventListener(h,u)),l.add&&(l.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,f):p.push(f),T.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,u,a,s,c,f,l,p,h,d,g,v=J.hasData(e)&&J.get(e);if(v&&(s=v.events)){for(c=(t=(t||"").match(B)||[""]).length;c--;)if(h=g=(a=Ae.exec(t[c])||[])[1],d=(a[2]||"").split(".").sort(),h){for(l=T.event.special[h]||{},p=s[h=(r?l.delegateType:l.bindType)||h]||[],a=a[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=p.length;o--;)f=p[o],!i&&g!==f.origType||n&&n.guid!==f.guid||a&&!a.test(f.namespace)||r&&r!==f.selector&&("**"!==r||!f.selector)||(p.splice(o,1),f.selector&&p.delegateCount--,l.remove&&l.remove.call(e,f));u&&!p.length&&(l.teardown&&!1!==l.teardown.call(e,d,v.handle)||T.removeEvent(e,h,v.handle),delete s[h])}else for(h in s)T.event.remove(e,h+t[c],n,r,!0);T.isEmptyObject(s)&&J.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,u,a=T.event.fix(e),s=new Array(arguments.length),c=(J.get(this,"events")||{})[a.type]||[],f=T.event.special[a.type]||{};for(s[0]=a,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],u={},n=0;n-1:T.find(i,this,null,[c]).length),u[i]&&o.push(r);o.length&&a.push({elem:c,handlers:o})}return c=this,s\x20\t\r\n\f]*)[^>]*)\/>/gi,Le=/\s*$/g;function Ue(e,t){return P(e,"table")&&P(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function je(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ke(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ie(e,t){var n,r,i,o,u,a,s,c;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),u=J.set(t,o),c=o.events))for(i in delete u.handle,u.events={},c)for(n=0,r=c[i].length;n1&&"string"==typeof d&&!y.checkClone&&De.test(d))return e.each(function(i){var o=e.eq(i);g&&(t[0]=d.call(this,i,o.html())),Me(o,t,n,r)});if(p&&(o=(i=be(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=(u=T.map(ve(i,"script"),je)).length;l")},clone:function(e,t,n){var r,i,o,u,a=e.cloneNode(!0),s=T.contains(e.ownerDocument,e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(u=ve(a),r=0,i=(o=ve(e)).length;r0&&ye(u,!s&&ve(e,"script")),a},cleanData:function(e){for(var t,n,r,i=T.event.special,o=0;void 0!==(n=e[o]);o++)if(Q(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),T.fn.extend({detach:function(e){return qe(this,e,!0)},remove:function(e){return qe(this,e)},text:function(e){return Y(this,function(e){return void 0===e?T.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 Me(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ue(this,e).appendChild(e)})},prepend:function(){return Me(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ue(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Me(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Me(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&&(T.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return T.clone(this,e,t)})},html:function(e){return Y(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&&!Le.test(e)&&!ge[(he.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n=0&&(s+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-s-a-.5))),s}function tt(e,t,n){var r=Fe(e),i=We(e,t,r),o="border-box"===T.css(e,"boxSizing",!1,r),u=o;if(He.test(i)){if(!n)return i;i="auto"}return u=u&&(y.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===T.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],u=!0),(i=parseFloat(i)||0)+et(e,t,n||(o?"border":"content"),u,r,i)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},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:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,u,a=X(t),s=Ge.test(t),c=e.style;if(s||(t=Je(a)),u=T.cssHooks[t]||T.cssHooks[a],void 0===n)return u&&"get"in u&&void 0!==(i=u.get(e,!1,r))?i:c[t];"string"===(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"===o&&(n+=i&&i[3]||(T.cssNumber[a]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),u&&"set"in u&&void 0===(n=u.set(e,n,r))||(s?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,u,a=X(t);return Ge.test(t)||(t=Je(a)),(u=T.cssHooks[t]||T.cssHooks[a])&&"get"in u&&(i=u.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Xe&&(i=Xe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),T.each(["height","width"],function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,t,r):ae(e,Ve,function(){return tt(e,t,r)})},set:function(e,n,r){var i,o=Fe(e),u="border-box"===T.css(e,"boxSizing",!1,o),a=r&&et(e,t,r,u,o);return u&&y.scrollboxSize()===o.position&&(a-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-et(e,t,"border",!1,o)-.5)),a&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),Ze(0,n,a)}}}),T.cssHooks.marginLeft=Ye(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-ae(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),T.each({margin:"",padding:"",border:"Width"},function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(T.cssHooks[e+t].set=Ze)}),T.fn.extend({css:function(e,t){return Y(this,function(e,t,n){var r,i,o={},u=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;u1)}}),T.Tween=nt,nt.prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(T.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=T.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):nt.propHooks._default.set(this),this}},nt.prototype.init.prototype=nt.prototype,nt.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=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[T.cssProps[e.prop]]&&!T.cssHooks[e.prop]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},nt.propHooks.scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=nt.prototype.init,T.fx.step={};var rt,it,ot=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function at(){it&&(!1===u.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(at):n.setTimeout(at,T.fx.interval),T.fx.tick())}function st(){return n.setTimeout(function(){rt=void 0}),rt=Date.now()}function ct(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,u=i.length;o1)},removeAttr:function(e){return this.each(function(){T.removeAttr(this,e)})}}),T.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?T.prop(e,t,n):(1===o&&T.isXMLDoc(e)||(i=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void T.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=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&P(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(B);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||T.find.attr;ht[t]=function(e,t,r){var i,o,u=t.toLowerCase();return r||(o=ht[u],ht[u]=i,i=null!=n(e,t,r)?u:null,ht[u]=o),i}});var dt=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(B)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(B)||[]}T.fn.extend({prop:function(e,t){return Y(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[T.propFix[e]||e]})}}),T.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&T.isXMLDoc(e)||(t=T.propFix[t]||t,i=T.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=T.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(T.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)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){T.propFix[this.toLowerCase()]=this}),T.fn.extend({addClass:function(e){var t,n,r,i,o,u,a,s=0;if(m(e))return this.each(function(t){T(this).addClass(e.call(this,t,yt(this)))});if((t=mt(e)).length)for(;n=this[s++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(u=0;o=t[u++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(a=vt(r))&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,u,a,s=0;if(m(e))return this.each(function(t){T(this).removeClass(e.call(this,t,yt(this)))});if(!arguments.length)return this.attr("class","");if((t=mt(e)).length)for(;n=this[s++];)if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){for(u=0;o=t[u++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(a=vt(r))&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(n){T(this).toggleClass(e.call(this,n,yt(this),t),t)}):this.each(function(){var t,i,o,u;if(r)for(i=0,o=T(this),u=mt(e);t=u[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+vt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var _t=/\r/g;T.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=m(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,T(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=T.map(i,function(e){return null==e?"":e+""})),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(_t,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:vt(T.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,u="select-one"===e.type,a=u?null:[],s=u?o+1:i.length;for(r=o<0?s:u?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),T.each(["radio","checkbox"],function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},y.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in n;var wt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,r,i){var o,a,s,c,f,l,p,h,g=[r||u],v=d.call(e,"type")?e.type:e,y=d.call(e,"namespace")?e.namespace.split("."):[];if(a=h=s=r=r||u,3!==r.nodeType&&8!==r.nodeType&&!wt.test(v+T.event.triggered)&&(v.indexOf(".")>-1&&(y=v.split("."),v=y.shift(),y.sort()),f=v.indexOf(":")<0&&"on"+v,(e=e[T.expando]?e:new T.Event(v,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:T.makeArray(t,[e]),p=T.event.special[v]||{},i||!p.trigger||!1!==p.trigger.apply(r,t))){if(!i&&!p.noBubble&&!_(r)){for(c=p.delegateType||v,wt.test(c+v)||(a=a.parentNode);a;a=a.parentNode)g.push(a),s=a;s===(r.ownerDocument||u)&&g.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=g[o++])&&!e.isPropagationStopped();)h=a,e.type=o>1?c:p.bindType||v,(l=(J.get(a,"events")||{})[e.type]&&J.get(a,"handle"))&&l.apply(a,t),(l=f&&a[f])&&l.apply&&Q(a)&&(e.result=l.apply(a,t),!1===e.result&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(g.pop(),t)||!Q(r)||f&&m(r[v])&&!_(r)&&((s=r[f])&&(r[f]=null),T.event.triggered=v,e.isPropagationStopped()&&h.addEventListener(v,bt),r[v](),e.isPropagationStopped()&&h.removeEventListener(v,bt),T.event.triggered=void 0,s&&(r[f]=s)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each(function(){T.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}}),y.focusin||T.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){T.event.simulate(t,e.target,T.event.fix(e))};T.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Et=n.location,Tt=Date.now(),xt=/\?/;T.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||T.error("Invalid XML: "+e),t};var At=/\[\]$/,St=/\r?\n/g,Rt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;function Ot(e,t,n,r){var i;if(Array.isArray(t))T.each(t,function(t,i){n||At.test(e)?r(e,i):Ot(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==E(t))r(e,t);else for(i in t)Ot(e+"["+i+"]",t[i],n,r)}T.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,function(){i(this.name,this.value)});else for(n in e)Ot(n,e[n],t,i);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Ct.test(this.nodeName)&&!Rt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,function(e){return{name:t.name,value:e.replace(St,"\r\n")}}):{name:t.name,value:n.replace(St,"\r\n")}}).get()}});var Pt=/%20/g,Lt=/#.*$/,Dt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ut=/^(?:GET|HEAD)$/,jt=/^\/\//,kt={},It={},Bt="*/".concat("*"),Mt=u.createElement("a");function qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(B)||[];if(m(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ht(e,t,n,r){var i={},o=e===It;function u(a){var s;return i[a]=!0,T.each(e[a]||[],function(e,a){var c=a(t,n,r);return"string"!=typeof c||o||i[c]?o?!(s=c):void 0:(t.dataTypes.unshift(c),u(c),!1)}),s}return u(t.dataTypes[0])||!i["*"]&&u("*")}function Ft(e,t){var n,r,i=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Mt.href=Et.href,T.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:{"*":Bt,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":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,T.ajaxSettings),t):Ft(T.ajaxSettings,e)},ajaxPrefilter:qt(kt),ajaxTransport:qt(It),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,c,f,l,p,h,d=T.ajaxSetup({},t),g=d.context||d,v=d.context&&(g.nodeType||g.jquery)?T(g):T.event,y=T.Deferred(),m=T.Callbacks("once memory"),_=d.statusCode||{},w={},b={},E="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(f){if(!a)for(a={};t=Nt.exec(o);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return f?o:null},setRequestHeader:function(e,t){return null==f&&(e=b[e.toLowerCase()]=b[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==f&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(f)x.always(e[x.status]);else for(t in e)_[t]=[_[t],e[t]];return this},abort:function(e){var t=e||E;return r&&r.abort(t),A(0,t),this}};if(y.promise(x),d.url=((e||d.url||Et.href)+"").replace(jt,Et.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(B)||[""],null==d.crossDomain){c=u.createElement("a");try{c.href=d.url,c.href=c.href,d.crossDomain=Mt.protocol+"//"+Mt.host!=c.protocol+"//"+c.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=T.param(d.data,d.traditional)),Ht(kt,d,t,x),f)return x;for(p in(l=T.event&&d.global)&&0==T.active++&&T.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Ut.test(d.type),i=d.url.replace(Lt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Pt,"+")):(h=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(xt.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(Dt,"$1"),h=(xt.test(i)?"&":"?")+"_="+Tt+++h),d.url=i+h),d.ifModified&&(T.lastModified[i]&&x.setRequestHeader("If-Modified-Since",T.lastModified[i]),T.etag[i]&&x.setRequestHeader("If-None-Match",T.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&x.setRequestHeader("Content-Type",d.contentType),x.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Bt+"; q=0.01":""):d.accepts["*"]),d.headers)x.setRequestHeader(p,d.headers[p]);if(d.beforeSend&&(!1===d.beforeSend.call(g,x,d)||f))return x.abort();if(E="abort",m.add(d.complete),x.done(d.success),x.fail(d.error),r=Ht(It,d,t,x)){if(x.readyState=1,l&&v.trigger("ajaxSend",[x,d]),f)return x;d.async&&d.timeout>0&&(s=n.setTimeout(function(){x.abort("timeout")},d.timeout));try{f=!1,r.send(w,A)}catch(e){if(f)throw e;A(-1,e)}}else A(-1,"No Transport");function A(e,t,u,a){var c,p,h,w,b,E=t;f||(f=!0,s&&n.clearTimeout(s),r=void 0,o=a||"",x.readyState=e>0?4:0,c=e>=200&&e<300||304===e,u&&(w=function(e,t,n){for(var r,i,o,u,a=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[i].test(r)){s.unshift(i);break}if(s[0]in n)o=s[0];else{for(i in n){if(!s[0]||e.converters[i+" "+s[0]]){o=i;break}u||(u=i)}o=o||u}if(o)return o!==s[0]&&s.unshift(o),n[o]}(d,x,u)),w=function(e,t,n,r){var i,o,u,a,s,c={},f=e.dataTypes.slice();if(f[1])for(u in e.converters)c[u.toLowerCase()]=e.converters[u];for(o=f.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!s&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),s=o,o=f.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(!(u=c[s+" "+o]||c["* "+o]))for(i in c)if((a=i.split(" "))[1]===o&&(u=c[s+" "+a[0]]||c["* "+a[0]])){!0===u?u=c[i]:!0!==c[i]&&(o=a[0],f.unshift(a[1]));break}if(!0!==u)if(u&&e.throws)t=u(t);else try{t=u(t)}catch(e){return{state:"parsererror",error:u?e:"No conversion from "+s+" to "+o}}}return{state:"success",data:t}}(d,w,x,c),c?(d.ifModified&&((b=x.getResponseHeader("Last-Modified"))&&(T.lastModified[i]=b),(b=x.getResponseHeader("etag"))&&(T.etag[i]=b)),204===e||"HEAD"===d.type?E="nocontent":304===e?E="notmodified":(E=w.state,p=w.data,c=!(h=w.error))):(h=E,!e&&E||(E="error",e<0&&(e=0))),x.status=e,x.statusText=(t||E)+"",c?y.resolveWith(g,[p,E,x]):y.rejectWith(g,[x,E,h]),x.statusCode(_),_=void 0,l&&v.trigger(c?"ajaxSuccess":"ajaxError",[x,d,c?p:h]),m.fireWith(g,[x,E]),l&&(v.trigger("ajaxComplete",[x,d]),--T.active||T.event.trigger("ajaxStop")))}return x},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],function(e,t){T[t]=function(e,n,r,i){return m(n)&&(i=i||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:i,data:n,success:r},T.isPlainObject(e)&&e))}}),T._evalUrl=function(e){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){T(this).wrapInner(e.call(this,t))}):this.each(function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(n){T(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){T(this).replaceWith(this.childNodes)}),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var $t={0:200,1223:204},Wt=T.ajaxSettings.xhr();y.cors=!!Wt&&"withCredentials"in Wt,y.ajax=Wt=!!Wt,T.ajaxTransport(function(e){var t,r;if(y.cors||Wt&&!e.crossDomain)return{send:function(i,o){var u,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(u in e.xhrFields)a[u]=e.xhrFields[u];for(u in e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)a.setRequestHeader(u,i[u]);t=function(e){return function(){t&&(t=r=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o($t[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=t(),r=a.onerror=a.ontimeout=t("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout(function(){t&&r()})},t=t("abort");try{a.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),T.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),T.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 T.globalEval(e),e}}}),T.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),T.ajaxTransport("script",function(e){var t,n;if(e.crossDomain)return{send:function(r,i){t=T("