diff --git a/.gitattributes b/.gitattributes index 62cce8ee..5bbdd765 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,6 @@ *.png binary *.jpg binary *.pdf binary + +# Mark docs as generated +docs/* linguist-generated diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug-report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug-report.md diff --git a/.github/ISSUE_TEMPLATE/doc-issue.md b/.github/ISSUE_TEMPLATE/doc-issue.md new file mode 100644 index 00000000..5087acd3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/doc-issue.md @@ -0,0 +1,15 @@ +--- +name: Documentation issue +about: Let us know if something is wrong with our documentation! +title: 'docs: ' +labels: 'type: docs :book:' +assignees: '' + +--- + +**Describe the issue** +A clear and concise description of what the issue is. + +**Additional context** +Add any other context about the problem here, such as screenshots and links to +relevant documentation. diff --git a/.gitignore b/.gitignore index 3b12a49d..e0399deb 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ public/ # JetBrains .idea + +# Doc build +docs_build diff --git a/.scripts/build_docs.sh b/.scripts/build_docs.sh new file mode 100644 index 00000000..46a398cb --- /dev/null +++ b/.scripts/build_docs.sh @@ -0,0 +1,68 @@ +#! /bin/bash + +set -e + +### +# This script is a wonderful hack I made to get around the fact that Slate +# (https://github.com/lord/slate) documentation recommends that you fork the +# repository and then write your documentation inside it. +# +# To convert Slate into a pure "doc builder", this script does a few things: +# * clone my (Robert's) fork of Slate into temporary /docs_build +# * write and sed custom configuration into the repository +# * symlink our doc assets (primarily in /docs_src, but also a few image assets +# from .static) into the cloned Slate repository +# * build the documentation into /docs, which is deployed by GH-pages +# +# The symlink + config hacks also allows live-reload local dev deployment (using +# the 'make run-docs' target in /Makefile). +### + +# Get Slate +echo "[INFO] Getting Slate" +mkdir -p docs_build +cd docs_build +if [ ! -d slate ]; then + # Using Robert's fork for now, for extra swag and configuration options not + # available in vanilla Slate + git clone https://github.com/bobheadxi/slate.git +else + echo "[INFO] Slate already present in docs_build/slate" +fi + +# Add custom config to Slate +echo "[INFO] Hacking Slate configuration" +TEMPLATE_FILES_WATCH="files.watch :source, path: File.join(root, '../../docs_src')" +if ! grep -q "$TEMPLATE_FILES_WATCH" slate/config.rb ; then + # We want to symlink our doc assets into the repo, so to retain live reload + # functionality, we want the generator Slate uses (Middleman) to watch our + # symlink sources for changes too + echo "$TEMPLATE_FILES_WATCH" \ + >> slate/config.rb +fi +if ! grep -q "<%= favicon_tag 'favicon.ico' %>" slate/source/layouts/layout.erb ; then + # This inserts a favicon reference into the element of the + # documentation layout + sed -i '' '//a\ + <%= favicon_tag '\''favicon\.ico'\'' %> + ' slate/source/layouts/layout.erb +fi + +# Set up Slate for build +echo "[INFO] Linking assets" +ln -fs "$(dirname "$(pwd)")"/docs_src/index.html.md \ + slate/source/index.html.md +ln -fs "$(dirname "$(pwd)")"/docs_src/stylesheets/_variables.scss \ + slate/source/stylesheets/_variables.scss +ln -fs "$(dirname "$(pwd)")"/.static/inertia.png \ + slate/source/images/logo.png +ln -fs "$(dirname "$(pwd)")"/.static/favicon.ico \ + slate/source/images/favicon.ico +echo "[INFO] Installing Slate dependencies" +cd slate +bundle install + +# Execute build +echo "[INFO] Building documentation" +rm -rf docs +bundle exec middleman build --clean --build-dir=../../docs diff --git a/.static/favicon.ico b/.static/favicon.ico new file mode 100644 index 00000000..ffd5befb Binary files /dev/null and b/.static/favicon.ico differ diff --git a/.static/inertia.png b/.static/inertia.png new file mode 100644 index 00000000..3723af17 Binary files /dev/null and b/.static/inertia.png differ diff --git a/CNAME b/CNAME index 8aef0332..afc790f2 100644 --- a/CNAME +++ b/CNAME @@ -1 +1 @@ -inertia.ubclaunchpad.com \ No newline at end of file +inertia.ubclaunchpad.com diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a1d22aa6..a64b742c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -178,6 +178,18 @@ $> make web-run # run local instance of application Make sure you have a local daemon set up for this web app to work - see the previous section for more details. +### Documentation + +Our [usage documentation website]() is built with [Slate](https://github.com/lord/slate). +The builds are in `/docs`, but the documentation source is in `/docs_src`. + +To build and deploy the documentation locally: + +```bash +$> make docs +$> make run-docs # visit http://localhost:4567/ +``` + ## Setting up a Testing Environment You will need Docker installed and running to run whole the Inertia test suite, diff --git a/Makefile b/Makefile index 9c76910f..7031f55d 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ ls: clean: testenv-clean go clean -testcache rm -f ./inertia + rm -rf ./docs_build find . -type f -name inertia.\* -exec rm {} \; # Install all dependencies @@ -182,3 +183,11 @@ web-run-sandbox: .PHONY: web-build web-build: (cd ./daemon/web; npm install --production; npm run build) + +.PHONY: docs +docs: + sh .scripts/build_docs.sh + +.PHONY: run-docs +run-docs: + ( cd docs_build/slate ; bundle exec middleman server --verbose ) diff --git a/README.md b/README.md index 279afb8e..1255fc85 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@

- Getting Started · + Usage · Motivation & Design · Contributing · Wiki @@ -71,107 +71,24 @@ Inertia is a simple cross-platform command line application that enables quick a
-# :package: Getting Started +# :package: Usage -All you need to get started is a [compatible project](https://github.com/ubclaunchpad/inertia/wiki/Project-Compatibility), the Inertia CLI, and access to a virtual private server. +Check out our new **[Inertia Usage Guide](https://inertia.ubclaunchpad.com)** to +get started with using Inertia for your project! The guide will walk you through +installing Inertia, setting up a project, deploying to a remote, managing your +deployment, and advanced usage tips. -MacOS users can install the CLI using [Homebrew](https://brew.sh): +### Why Use Inertia? -```bash -$> brew install ubclaunchpad/tap/inertia -``` +If you... -Windows users can install the CLI using [Scoop](http://scoop.sh): +* want a simple utility to quickly build and deploy the latest iterations of your projects +* are new to the concept of "deployment" and related tooling +* are not deploying to production +* are on a tight budget and need to switch between cloud providers as your free trials run out +* want some lightweight team features for managing your deployment -```bash -$> scoop bucket add ubclaunchpad https://github.com/ubclaunchpad/scoop-bucket -$> scoop install inertia -``` - -For other platforms, you can [download the appropriate binary from the Releases page](https://github.com/ubclaunchpad/inertia/releases). - -### Setup - -Initializing a project for use with Inertia only takes a few simple steps: - -```bash -$> inertia init -``` - -#### Using an Existing Remote - -To use an existing host, you must first add it to your Inertia configuration and initialize it - this will install Inertia on your remote. - -```bash -$> inertia remote add $VPS_NAME -$> inertia $VPS_NAME init -$> inertia $VPS_NAME status -# Confirms that the daemon is online and accepting requests -``` - -See our [wiki](https://github.com/ubclaunchpad/inertia/wiki/VPS-Compatibility) for more details on VPS platform compatibility. - -#### Provisioning a New Remote - -Inertia offers some tools to easily provision a new VPS instance and set it up for Inertia. For example, to create an EC2 instance and initialize it, just run: - -```bash -$> inertia provision ec2 $VPS_NAME -$> inertia $VPS_NAME status -``` - -### Deployment Management - -To manually deploy your project, you must first grant Inertia permission to clone your repository. This can be done by adding the GitHub Deploy Key that is displayed in the output of `inertia $VPS_NAME init` to your repository settings: - -```bash -GitHub Deploy Key (add here https://www.github.com//settings/keys/new): -ssh-rsa <...> -``` - -Once this is done, you can use Inertia to bring your project online on your remote VPS: - -```bash -$> inertia $VPS_NAME up -``` - -Run `inertia $VPS_NAME --help` to see the other commands Inertia offers for managing your deployment. - -Inertia also offers a web application - this can be accessed at `https://$ADDRESS:4303/web` once users have been added through the `inertia $VPS_NAME user` commands. - -### Continuous Deployment - -To enable continuous deployment, you need the webhook URL that is printed during `inertia $VPS_NAME init`: - -```bash -GitHub WebHook URL (add here https://www.github.com//settings/hooks/new): -http://myhost.com:4303/webhook -Github WebHook Secret: inertia -``` - -The daemon will accept POST requests from GitHub at the URL provided. Add this webhook URL in your GitHub settings area (at the URL provided) so that the daemon will receive updates from GitHub when your repository is updated. Once this is done, the daemon will automatically build and deploy any changes that are made to the deployed branch. - -### Release Streams - -The version of Inertia you are using can be seen in Inertia's `.inertia.toml` configuration file, or by running `inertia --version`. The version in `.inertia.toml` is used to determine what version of the Inertia daemon to use when you run `inertia $VPS_NAME init`. - -You can manually change the daemon version used by editing the Inertia configuration file. If you are building from source, you can also check out the desired version and run `make inertia-tagged` or `make RELEASE=$STREAM`. Inertia daemon releases are tagged as follows: - -- `v0.x.x` denotes [official, tagged releases](https://github.com/ubclaunchpad/inertia/releases) - these are recommended. -- `latest` denotes the newest builds on `master`. -- `canary` denotes experimental builds used for testing and development - do not use this. - -The daemon component of an Inertia release can be patched separately from the CLI component - see our [wiki](https://github.com/ubclaunchpad/inertia/wiki/Daemon-Releases) for more details. - -### Swag - -Add some bling to your Inertia-deployed project :sunglasses: - -[![Deployed with Inertia](https://img.shields.io/badge/deploying%20with-inertia-blue.svg)](https://github.com/ubclaunchpad/inertia) - -``` -[![Deployed with Inertia](https://img.shields.io/badge/deploying%20with-inertia-blue.svg)](https://github.com/ubclaunchpad/inertia) -``` +Inertia might be for you!

diff --git a/docs/fonts/slate.eot b/docs/fonts/slate.eot new file mode 100644 index 00000000..13c4839a Binary files /dev/null and b/docs/fonts/slate.eot differ diff --git a/docs/fonts/slate.svg b/docs/fonts/slate.svg new file mode 100644 index 00000000..5f349823 --- /dev/null +++ b/docs/fonts/slate.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + diff --git a/docs/fonts/slate.ttf b/docs/fonts/slate.ttf new file mode 100644 index 00000000..ace9a46a Binary files /dev/null and b/docs/fonts/slate.ttf differ diff --git a/docs/fonts/slate.woff b/docs/fonts/slate.woff new file mode 100644 index 00000000..1e72e0ee Binary files /dev/null and b/docs/fonts/slate.woff differ diff --git a/docs/fonts/slate.woff2 b/docs/fonts/slate.woff2 new file mode 100644 index 00000000..7c585a72 Binary files /dev/null and b/docs/fonts/slate.woff2 differ diff --git a/docs/images/aws-ec2-iam-add.png b/docs/images/aws-ec2-iam-add.png new file mode 100644 index 00000000..05335f0c Binary files /dev/null and b/docs/images/aws-ec2-iam-add.png differ diff --git a/docs/images/aws-ec2-iam-perm.png b/docs/images/aws-ec2-iam-perm.png new file mode 100644 index 00000000..8b81b21f Binary files /dev/null and b/docs/images/aws-ec2-iam-perm.png differ diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 00000000..ffd5befb Binary files /dev/null and b/docs/images/favicon.ico differ diff --git a/docs/images/logo.png b/docs/images/logo.png new file mode 100644 index 00000000..3723af17 Binary files /dev/null and b/docs/images/logo.png differ diff --git a/docs/images/navbar.png b/docs/images/navbar.png new file mode 100644 index 00000000..df38e90d Binary files /dev/null and b/docs/images/navbar.png differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..c45675df --- /dev/null +++ b/docs/index.html @@ -0,0 +1,1033 @@ + + + + + + + + + Inertia Usage Guide + + + + + + + + + + + NAV + Navbar + + +

+ + + +
+
+
+
+

Inertia

+

✈️ Effortless, self-hosted continuous deployment for small teams and projects

+ +

Inertia +Inertia +Inertia

+ +


+ +
+

Main Features

+ +
    +
  • 🚀 Simple to use - set up a deployment from your computer without ever having to manually SSH into your remote
  • +
  • 🍰 Cloud-agnostic - use any Linux-based remote virtual private server provider you want
  • +
  • Versatile project support - deploy any Dockerfile or docker-compose project
  • +
  • 🚄 Continuous deployment - Webhook integrations for GitHub, GitLab, and Bitbucket means your project can be automatically updated, rebuilt, and deployed as soon as you git push
  • +
  • 🛂 In-depth controls - start up, shut down, and monitor your deployment with ease from the command line or using Inertia's REST API
  • +
  • 🏷 Flexible configuration - branch deployment, environment variables, easy file transfer for configuration files, build settings, and more
  • +
  • 📦 Built-in provisioning - easily provision and set up VPS instances for your project with supported providers such as Amazon Web Services using a single command
  • +
  • 👥 Built for teams - provide shared access to an Inertia deployment by adding users
  • +
  • 🔑 Secure - secured with access tokens and HTTPS across the board, as well as features like 2FA for user logins
  • +
+
+ +

Inertia is a simple cross-platform command line application that enables quick +and easy setup and management of continuous, automated deployment of a variety +of project types on any virtual private server. The project is used, built, and +maintained with ❤️ by UBC Launch Pad, UBC's +student-run software engineering club.

+ +

UBC Launch Pad is a student-run software +engineering club at the University of British Columbia that aims to provide +students with a community where they can work together to build a all sorts of +cool projects, ranging from mobile apps and web services to cryptocurrencies and +machine learning applications.

+ +

Many of our projects rely on hosting providers for deployment. Unfortunately we +frequently change hosting providers based on available funding and sponsorship, +meaning our projects often need to be redeployed. On top of that, deployment +itself can already be a frustrating task, especially for students with little to +no experience setting up applications on remote hosts. Inertia is a project we +started to address these problems.

+ +

This site primarily documents how to set up and use Inertia - to learn more +about the project, check out our GitHub repository!

+ + +

Getting Started

+
+

MacOS users can install the CLI using Homebrew:

+
+
brew install ubclaunchpad/tap/inertia
+
+
+

Windows users can install the CLI using Scoop:

+
+
scoop bucket add ubclaunchpad https://github.com/ubclaunchpad/scoop-bucket
+scoop install inertia
+
+
+

To build and install the CLI from source:

+
+
go get -u github.com/ubclaunchpad/inertia
+
+

The Inertia command line interface (CLI) can be installed from a few package +managers such as Homebrew and Scoop. For other platforms, you can +download the appropriate binary from the Releases page.

+ +

You can also build Inertia from source, though this requires Golang to be +installed.

+ +

To verify your installation, try running inertia --help - this should output +some helpful text about Inertia.

+ +

Run inertia --version to verify that you have the +latest release.

+

Setup

+
+

This will generate a configuration file inside your repository:

+
+
cd /path/to/project
+inertia init
+
+

To set up Inertia, you must first navigate to your project directory, which +must be a git repository, and run inertia init to set up configuration. If +Inertia cannot detect your project type, it will prompt for more information.

+ + + + +

Project Configuration

+
+

An example inertia.toml:

+
+
version = "canary"
+project-name = "my_project"
+build-type = "dockerfile"
+build-file-path = "dockerfiles/Dockerfile.web"
+
+# ... other stuff
+
+
+

To change a setting, you can edit the configuration file directly, or run:

+
+
inertia config set ${parameter} ${new_value}
+
+

Your Inertia configuration is stored in inertia.toml by default. There are +a few project-wide settings stored here:

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
versionThis should match the version of your Inertia CLI, which you can see by running inertia --version. It is used to determine which version of the Inertia daemon to use.
project-nameThe name of the project you are deploying.
build-typeThis should be either dockerfile or docker-compose, depending on which you are using.
build-file-pathPath to your build configuration file, such as Dockerfile or docker-compose.yml, relative to the root of your project.
+

Deploying Your Project

+

When deploying a project, you typically deploy to a "remote".

+ +

A "remote" is a remote VPS, such as a Google Cloud Compute +or AWS Elastic Cloud Compute (EC2) instance. These +are computers in the cloud that will be used to deploy your project, so that +you don't have to use your own.

+ +

If this is your first time setting up a VPS, jump ahead to the +Provisioning a Remote section, which will help you set +up a VPS for Inertia.

+

Using an Existing Remote

+
+

This command will prompt you for the path to your PEM file, your username, +and the IP address of your remote. These parameters will be used to execute +SSH commands that set up Inertia on your VPS.

+
+
inertia remote add ${remote_name}
+
+

To use an existing remote, you'll need its address and a PEM key that can be +used to access it. Inertia will also need a few ports exposed, namely one for +the Inertia daemon (port 4303 by default) and whatever ports you need for your +deployed project.

+ + +

Provisioning a Remote

+ +
inertia provision --help
+inertia provision ${cloud_provider} ${remote_name}
+
+

Inertia has integrations with some cloud providers to allow you to easily +provision a new VPS instance and set it up for Inertia. This includes generating +key pairs, setting network rules, and initializing the Inertia daemon.

+ +

You can use the --help on the provision command to see what options are +available.

+

Example: Provisioning an EC2 Instance

+

Elastic Cloud Compute (EC2) is a service provided +by Amazon Web Services (AWS) that can be used to deploy Inertia projects. It +offers 750 free EC2 hours a month for your first 12 months, +which is just enough for 1 EC2 VPS instance. Even after the trial it's pretty +affordable, and a good choice to get started with.

+ +
+

The IAM users page: +Aws ec2 iam add

+
+ +

To get started, make an account on the AWS website. If you're +a student, you'll also be eligible for +yearly free credits, so make sure +you sign up for that as well.

+ +

Next, you'll want to head over to the +IAM page of the AWS Management Console. +IAM stands for "Identity and Access Management", and this is where you'll +configure programmatic access to your AWS account. Under the "Users" tab, click +"Add User".

+ +
+

Configuring IAM permissions: +Aws ec2 iam perm

+
+ +

This will take you through a brief walkthrough to configure your new IAM user:

+ + + + + + +
# set credentials in environment
+export AWS_ACCESS_KEY_ID=${access_key_id}
+export AWS_ACCESS_KEY=${secret_access_key}
+inertia provision ec2 my_remote \
+  --from-env \
+  --ports 8080
+
+
+

This command says: "provision an ec2 instance called 'my_remote' using +credentials in my environment and expose port 8080 for my project".

+
+ +

Now that you have your user and access keys all set up, you can provision your +remote instance! Just set your keys in your +shell environment +and use the --from-env flag as in the example to provision a remote using +those credentials.

+ +

Alternatively, you can save your credentials in your +AWS credentials file. +To use these with Inertia, just call the provision ec2 command with the +--from-profile flag.

+ +

Inertia will just prompt you for the keys if you don't provide them using one +of the methods above.

+ +

The provisioning command will ask you to choose a +region +and an image to +use. The region should probably be whatever is closest to you, and then you +should just choose one of the images that Inertia lists as options.

+ +

Inertia will then create an EC2 instance, generate a key pair to give you SSH +access to the remote, set up network rules, install Inertia's prerequisites on +your remote, and spin up the Inertia daemon!

+

Deployment Configuration

+
+

An example inertia.toml:

+
+
# ... other stuff
+
+[remotes]
+  [remotes.my_remote]
+    IP = "ec2-203-0-113-25.compute-1.amazonaws.com"
+    user = "root"
+    pemfile = "/Users/robertlin/.ssh/id_rsa"
+    branch = "master"
+    ssh-port = "22"
+    [remotes.my_remote.daemon]
+      port = "4303"
+      token = ""
+      webhook-secret = "abcdefg"
+
+
+

To change a setting, you can edit the configuration file directly, or run:

+
+
inertia remote set ${remote_name} ${parameter} ${new_value}
+
+
+

For example, the following will change the branch deployed on my_remote +to dev and print out the new settings:

+
+
inertia remote set my_remote branch dev
+inertia remote show my_remote
+
+

Once you've added a remote, remote-specific settings are available under the +[remote] section of your Inertia configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
IPThis is the address of your remote instance. It's how other users will access your deployed project as well!
userThe user to use to execute commands as on your remote instance.
pemfileThe key to use when executing SSH commands on your remote instance.
branchThe git branch of your project that you want to deploy.
ssh-portThe SSH port on your remote instance - you usually don't need to change this.
+ +

Under remotes.${remote_name}.daemon there are some additional settings for the +Inertia daemon:

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
portThe port that the Inertia daemon is using - you can usually leave this as is.
tokenThis is the token used to authenticate against your remote, and will be populated when you initialize the Inertia daemon later.
webhook-secretThis is used to verify that incoming webhooks are authenticate - you'll need this later!
+

Initializing the Inertia Daemon

+ +
inertia ${remote_name} init
+# ... lots of output
+
+

Initializing the Inertia daemon means installing Docker, +setting up some prerequisites, downloading the Inertia daemon image, and getting +it up and running. Luckily, this is all done by a single, handy command so you +don't have to worry about it!

+ +

The Inertia daemon is a small agent that runs on your VPS instance and handles +all your deployment-related needs, such as responding to commands and listening +for updates to your repository. You can read more about this in the +Deployment Management section.

+ + + + +

Configuring Your Repository

+
+

The inertia ${remote_name} init or provision command's output should +include something like the following:

+
+
GitHub Deploy Key (add here https://www.github.com/<your_repo>/settings/keys/new):
+ssh-rsa <...> # this is important!
+GitHub WebHook URL (add here https://www.github.com/<your_repo>/settings/hooks/new):
+http://myhost.com:4303/webhook # this is important!
+Github WebHook Secret: inertia # this is important!
+
+

The inertia ${remote_name} init or provision command outputs several key +pieces of information to get your repository set up for continuous deployment:

+ + + + +
inertia ${remote_name} up
+
+ +

Deployment Management

+
+

To bring your project online and check its status:

+
+
inertia ${remote_name} up
+inertia ${remote_name} status
+
+
+

To shut down your project:

+
+
inertia ${remote_name} down
+
+

The main commands used to control your deployed project are up, status, and +down. These commands are associated with the state of your project, not with +that of the Inertia daemon - inertia ${remote_name} down, for example, will +not shut down the Inertia daemon.

+ +

Commands like up will provide live output to your terminal. It's pretty normal +for up to take a while, depending on the performance of your VPS, as it needs +some time to build your project.

+

Monitoring

inertia ${remote_name} logs
+
+
+

To view the logs of a specific process, get the list of active containers, then +query for the logs of the container you are interested in:

+
+
inertia ${remote_name} status
+inertia ${remote_name} logs ${container_name}
+
+

TODO: details

+

Secrets Management

+
+

Environment variables are a good way to store secrets:

+
+
inertia ${remote_name} env set ${key} ${value}
+
+
+

If you use configuration files such as a .env file, you can "send" it to your +remote - this file will then become accessible by your project:

+
+
inertia ${remote_name} send ${file_name}
+
+

TODO: details

+

Teams

Configuring Users

+
+

The following command will prompt for a password, and add the given user as +an administrator:

+
+
inertia ${remote_name} user add ${username} --admin
+
+
+

To list existing users:

+
+
inertia ${remote_name} user ls
+
+
+

Access can be revoked for a user by removing them:

+
+
inertia ${remote_name} user rm ${username}
+
+

TODO

+

Logging In

+
+

If you want to log in to a remote you have already configured as a specific +user, you can run:

+
+
inertia ${remote_name} login ${username}
+
+

TODO

+ + +

Upgrading

+
+

Install the latest release - for example, on MacOS:

+
+
brew upgrade ubclaunchpad/tap/inertia
+inertia --version # verify installation
+
+
+

To update configuration and daemon to match CLI version:

+
+
inertia config upgrade
+inertia ${remote_name} upgrade
+
+

TODO

+

Advanced Usage

+

This section details various advanced usage tips. If you can't find what you're +looking for here, try using the --help flag on relevant commands - Inertia +will display help text and all the different options available to you.

+

Troubleshooting

+ + +
+

To view more of the Inertia daemon's logs (the number of entries retrieved +is capped by default), run:

+
+
inertia ${remote_name} logs --entries 100000
+inertia ${remote_name} logs ${container} --entries 100000
+
+

Inertia is a large and rather complex project, and as such you might encounter +bugs, either because of Inertia or due to some kind of misconfiguration.

+ +

The Inertia daemon outputs a lot of verbose logs that might help you out. You +can also make use of the inertia ${remote} status command to output details +about the state of your deployment. Also pay attention to the output of the +Inertia CLI when things go awry - it might hint at what happened, and it'll be +useful context if you decide to open a ticket.

+ +
+

To start an SSH session with your remote, you can use the shortcut:

+
+
inertia ${remote_name} ssh
+
+

If you are more experienced, you can SSH into your remote to investigate. This +lets you access more advanced Docker commands and whatever else you might need +to work out what is happening.

+ + +

2-Factor Authentication

inertia ${remote_name} user totp enable ${username}
+inertia ${remote_name} user totp disable ${username}
+
+

2-factor authentication configuration in Inertia is available under the +inertia ${remote_name} user totp commands.

+ +

TOTP stands for "time-based one-time password". Enabling TOTP on an account +means that whenever a user logs in using that account, they must also verify +their identity using a separate authenticator app, which provides a secondary +factor of authentication - hence why it is called "2-factor authentication".

+ +

There are a wide range of authenticator apps out there, for example:

+ + + +
+

To log in as a totp-enabled user, you'll have to provide your TOTP or backup +code as a flag:

+
+
inertia ${remote_name} user login ${username} --totp ${code}
+
+

When you enable TOTP on an account, Inertia will output a QR code that you can +scan using your authenticator app, as well as a list of backup codes you should +keep somewhere safe. When you log in using a TOTP-enabled account, you'll need +to provide the TOTP generated by your authenticator app to log in, or one of the +backup codes.

+

Resource Management

+
+

To clear out unused Docker images and containers:

+
+
inertia ${remote_name} prune
+
+
+

You can also interact with Docker directly over SSH:

+
+
inertia ${remote_name} ssh
+root@remote:~$ docker container ls -a
+
+

Inertia does its best to manage resources on its own, but sometimes spare +containers and images start gathering and you might find your remote starting +to run out of storage (especially if it is a free/budget instance with low +storage).

+ +

Inertia offers a few ways of managing resources, either through commands like +prune or directly over SSH.

+ + +

Generating API Keys

inertia ${remote_name} token
+
+

If you want to develop integrations with Inertia, you'll probably want a +non-expiring API token, which you can generate using Inertia if you have SSH +access to your remote. Be careful not to lose these tokens.

+
curl -H "Authorization: Bearer ${token}" \
+  https://${remote_ip}:${daemon_port}/status
+
+

To use these tokens, you can place them in your inertia.toml under token, or +use them in requests to the Inertia API by placing them as a Bearer token in +your request header under Authorization.

+

Inertia Release Streams

+

The version of Inertia you are using can be seen in Inertia's inertia.toml +configuration file, or by running inertia --version. The version in +inertia.toml is used to determine what version of the Inertia daemon to use +when you run inertia ${remote_name} init.

+ +
+

To switch over to the latest build and upgrade your remote:

+
+
inertia config set version "latest"
+inertia ${remote_name} upgrade
+
+

You can manually change the daemon version used by editing the Inertia +configuration file. If you are building from source, you can also check out the +desired version and run make inertia-tagged or make RELEASE=$STREAM. +Inertia daemon releases are tagged as follows:

+ + + +

You can see the list of available tags on +Docker Hub.

+

Custom SSL Certificate

+

By default, the Inertia daemon generates a self-signed SSL certificate for its +API. This means that Inertia, by default, doesn't verify SSL communications, +and you'll have to do things like disable SSL verification in your repository +for webhooks.

+
inertia ${remote_name} --verify-ssl status
+
+

If you provide your own SSL certificate, you can enable SSL verification in +Inertia using the --verify-ssl flag, and enable SSL verification in your +repository's webhook deliveries as well.

+ +

Just place your SSL certificate and key on your remote in ~/.inertia/ssl as +daemon.cert and daemon.key respectively, and the Inertia daemon will use +them automatically.

+

Miscellaneous

Learn More

+
+

Some quick links to help you get started:

+ + +
+ +

Check out our GitHub repository and +Wiki!

+ +

Inertia diagram

+

Swag

[![Deployed with Inertia](https://img.shields.io/badge/deploying%20with-inertia-blue.svg)](https://github.com/ubclaunchpad/inertia)
+
+

Add a cool Inertia badge to your README if you use Inertia!

+ +

Deployed with Inertia

+

Contributing

+

Any contribution (pull requests, feedback, bug reports, ideas, etc.) is welcome!

+ +

You can report issues with documentation, bugs, or anything via our +issue tracker.

+ +

For development, please see our +contribution guide +for contribution guidelines as well as a detailed guide to help you get started +with Inertia's codebase.

+ +

+ + + +

+ +


+
+
+
+

+ +
+
+
+
+ + diff --git a/docs/javascripts/all.js b/docs/javascripts/all.js new file mode 100644 index 00000000..05af78b0 --- /dev/null +++ b/docs/javascripts/all.js @@ -0,0 +1,131 @@ +!function(){if("ontouchstart"in window){var e,t,n,r,i,o,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){return!this.threshold&&void(this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY]))},r=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),r.simulated=!0,t.target.dispatchEvent(r)}},i=function(e){var t=Date.now(),n=t-s.time,r=e.clientX,i=e.clientY,a=[Math.abs(s.x-r),Math.abs(s.y-i)],u=o(e.target,"A")||e.target,c=u.nodeName,l="A"===c,f=window.navigator.standalone&&l&&e.target.getAttribute("href");return s.time=t,s.x=r,s.y=i,!((!e.simulated&&(n<500||n<1500&&a[0]<50&&a[1]<50)||f)&&(e.preventDefault(),e.stopPropagation(),!f))&&(f&&(window.location=u.getAttribute("href")),void(u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))))},o=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",r,!1),document.addEventListener("click",i,!0)}}(),/*! + * jQuery JavaScript Library v3.2.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: 2017-03-20T18:59Z + */ +function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t){t=t||ne;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function r(e){var t=!!e&&"length"in e&&e.length,n=ge.type(e);return"function"!==n&&!ge.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function i(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function o(e,t,n){return ge.isFunction(t)?ge.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?ge.grep(e,function(e){return e===t!==n}):"string"!=typeof t?ge.grep(e,function(e){return ae.call(t,e)>-1!==n}):Ce.test(t)?ge.filter(t,e,n):(t=ge.filter(t,e),ge.grep(e,function(e){return ae.call(t,e)>-1!==n&&1===e.nodeType}))}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function a(e){var t={};return ge.each(e.match(De)||[],function(e,n){t[n]=!0}),t}function u(e){return e}function c(e){throw e}function l(e,t,n,r){var i;try{e&&ge.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&ge.isFunction(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function f(){ne.removeEventListener("DOMContentLoaded",f),e.removeEventListener("load",f),ge.ready()}function d(){this.expando=ge.expando+d.uid++}function p(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Ie.test(e)?JSON.parse(e):e)}function h(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Re,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=p(n)}catch(e){}He.set(e,t,n)}else n=void 0;return n}function g(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return ge.css(e,t,"")},u=a(),c=n&&n[3]||(ge.cssNumber[t]?"":"px"),l=(ge.cssNumber[t]||"px"!==c&&+u)&&Me.exec(ge.css(e,t));if(l&&l[3]!==c){c=c||l[3],n=n||[],l=+u||1;do o=o||".5",l/=o,ge.style(e,t,l+c);while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function v(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ve[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=ge.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ve[r]=i,i)}function m(e,t){for(var n,r,i=[],o=0,s=e.length;o-1)i&&i.push(o);else if(c=ge.contains(o.ownerDocument,o),s=y(f.appendChild(o),"script"),c&&x(s),n)for(l=0;o=s[l++];)Qe.test(o.type||"")&&n.push(o);return f}function w(){return!0}function T(){return!1}function S(){try{return ne.activeElement}catch(e){}}function E(e,t,n,r,i,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(a in t)E(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)),i===!1)i=T;else if(!i)return e;return 1===o&&(s=i,i=function(e){return ge().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=ge.guid++)),e.each(function(){ge.event.add(this,t,i,r,n)})}function C(e,t){return i(e,"table")&&i(11!==t.nodeType?t:t.firstChild,"tr")?ge(">tbody",e)[0]||e:e}function k(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function N(e){var t=it.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function j(e,t){var n,r,i,o,s,a,u,c;if(1===t.nodeType){if(Pe.hasData(e)&&(o=Pe.access(e),s=Pe.set(t,o),c=o.events)){delete s.handle,s.events={};for(i in c)for(n=0,r=c[i].length;n1&&"string"==typeof h&&!pe.checkClone&&rt.test(h))return e.each(function(n){var o=e.eq(n);g&&(t[0]=h.call(this,n,o.html())),L(o,t,r,i)});if(d&&(o=b(t,e[0].ownerDocument,!1,e,i),s=o.firstChild,1===o.childNodes.length&&(o=s),s||i)){for(a=ge.map(y(o,"script"),k),u=a.length;f=0&&nS.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[_]=!0,e}function i(e){var t=q.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)S.attrHandle[n[r]]=t}function s(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 a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ee(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function p(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function v(e,n,r){for(var i=0,o=n.length;i-1&&(r[c]=!(s[c]=f))}}else x=m(x===s?x.splice(h,x.length):x),o?o(null,s,x,u):K.apply(s,x)})}function x(e){for(var t,n,r,i=e.length,o=S.relative[e[0].type],s=o||S.relative[" "],a=o?1:0,u=h(function(e){return e===t},s,!0),c=h(function(e){return ee(t,e)>-1},s,!0),l=[function(e,n,r){var i=!o&&(r||n!==A)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,i}];a1&&g(l),a>1&&p(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,o=e.length>0,s=function(r,s,a,u,c){var l,f,d,p=0,h="0",g=r&&[],v=[],y=A,x=r||o&&S.find.TAG("*",c),b=W+=null==y?1:Math.random()||.1,w=x.length;for(c&&(A=s===q||s||c);h!==w&&null!=(l=x[h]);h++){if(o&&l){for(f=0,s||l.ownerDocument===q||(O(l),a=!$);d=e[f++];)if(d(l,s||q,a)){u.push(l);break}c&&(W=b)}i&&((l=!d&&l)&&p--,r&&g.push(l))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(g,v,s,a);if(r){if(p>0)for(;h--;)g[h]||v[h]||(v[h]=J.call(u));v=m(v)}K.apply(u,v),c&&!r&&v.length>0&&p+n.length>1&&t.uniqueSort(u)}return c&&(W=b,A=y),g};return i?r(s):s}var w,T,S,E,C,k,N,j,A,L,D,O,q,F,$,P,H,I,R,_="sizzle"+1*new Date,M=e.document,W=0,B=0,z=n(),V=n(),X=n(),U=function(e,t){return e===t&&(D=!0),0},Q={}.hasOwnProperty,Y=[],J=Y.pop,G=Y.push,K=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,xe=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),be=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)},we=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Te=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Se=function(){O()},Ee=h(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{K.apply(Y=Z.call(M.childNodes),M.childNodes),Y[M.childNodes.length].nodeType}catch(e){K={apply:Y.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}T=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},O=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:M;return r!==q&&9===r.nodeType&&r.documentElement?(q=r,F=q.documentElement,$=!C(q),M!==q&&(n=q.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Se,!1):n.attachEvent&&n.attachEvent("onunload",Se)),T.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),T.getElementsByTagName=i(function(e){return e.appendChild(q.createComment("")),!e.getElementsByTagName("*").length}),T.getElementsByClassName=ve.test(q.getElementsByClassName),T.getById=i(function(e){return F.appendChild(e).id=_,!q.getElementsByName||!q.getElementsByName(_).length}),T.getById?(S.filter.ID=function(e){var t=e.replace(xe,be);return function(e){return e.getAttribute("id")===t}},S.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&$){var n=t.getElementById(e);return n?[n]:[]}}):(S.filter.ID=function(e){var t=e.replace(xe,be);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},S.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&$){var n,r,i,o=t.getElementById(e);if(o){if(n=o.getAttributeNode("id"),n&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if(n=o.getAttributeNode("id"),n&&n.value===e)return[o]}return[]}}),S.find.TAG=T.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):T.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},S.find.CLASS=T.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&$)return t.getElementsByClassName(e)},H=[],P=[],(T.qsa=ve.test(q.querySelectorAll))&&(i(function(e){F.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+_+"-]").length||P.push("~="),e.querySelectorAll(":checked").length||P.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||P.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=q.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&P.push(":enabled",":disabled"),F.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(T.matchesSelector=ve.test(I=F.matches||F.webkitMatchesSelector||F.mozMatchesSelector||F.oMatchesSelector||F.msMatchesSelector))&&i(function(e){T.disconnectedMatch=I.call(e,"*"),I.call(e,"[s!='']:x"),H.push("!=",oe)}),P=P.length&&new RegExp(P.join("|")),H=H.length&&new RegExp(H.join("|")),t=ve.test(F.compareDocumentPosition),R=t||ve.test(F.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},U=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!T.sortDetached&&t.compareDocumentPosition(e)===n?e===q||e.ownerDocument===M&&R(M,e)?-1:t===q||t.ownerDocument===M&&R(M,t)?1:L?ee(L,e)-ee(L,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===q?-1:t===q?1:i?-1:o?1:L?ee(L,e)-ee(L,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===M?-1:u[r]===M?1:0},q):q},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==q&&O(e),n=n.replace(le,"='$1']"),T.matchesSelector&&$&&!X[n+" "]&&(!H||!H.test(n))&&(!P||!P.test(n)))try{var r=I.call(e,n);if(r||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,q,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==q&&O(e),R(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==q&&O(e);var n=S.attrHandle[t.toLowerCase()],r=n&&Q.call(S.attrHandle,t.toLowerCase())?n(e,t,!$):void 0;return void 0!==r?r:T.attributes||!$?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(we,Te)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!T.detectDuplicates,L=!T.sortStable&&e.slice(0),e.sort(U),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return L=null,e},E=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=E(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=E(t);return n},S=t.selectors={cacheLength:50,createPseudo:r,match:pe,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(xe,be),e[3]=(e[3]||e[4]||e[5]||"").replace(xe,be),"~="===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]||t.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]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=k(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(xe,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,f,d,p,h,g=o!==s?"nextSibling":"previousSibling",v=t.parentNode,m=a&&t.nodeName.toLowerCase(),y=!u&&!a,x=!1;if(v){if(o){for(;g;){for(d=t;d=d[g];)if(a?d.nodeName.toLowerCase()===m:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[s?v.firstChild:v.lastChild],s&&y){for(d=v,f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===W&&c[1],x=p&&c[2],d=p&&v.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){l[e]=[W,p,x];break}}else if(y&&(d=t,f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),c=l[e]||[],p=c[0]===W&&c[1],x=p),x===!1)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==m:1!==d.nodeType)||!++x||(y&&(f=d[_]||(d[_]={}),l=f[d.uniqueID]||(f[d.uniqueID]={}),l[e]=[W,x]),d!==t)););return x-=i,x===r||x%r===0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=S.pseudos[e]||S.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[_]?o(n):o.length>1?(i=[e,e,"",n],S.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)r=ee(e,i[s]),e[r]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=N(e.replace(ae,"$1"));return i[_]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(xe,be),function(t){return(t.textContent||t.innerText||E(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(xe,be).toLowerCase(),function(t){var n;do if(n=$?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===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===F},focus:function(e){return e===q.activeElement&&(!q.hasFocus||q.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!S.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.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:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(s=o[0]).type&&9===t.nodeType&&$&&S.relative[o[1].type]){if(t=(S.find.ID(s.matches[0].replace(xe,be),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(s=o[i],!S.relative[a=s.type]);)if((u=S.find[a])&&(r=u(s.matches[0].replace(xe,be),ye.test(o[0].type)&&f(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return K.apply(n,r),n;break}}return(c||N(e,l))(r,t,!$,n,!t||ye.test(e)&&f(t.parentNode)||t),n},T.sortStable=_.split("").sort(U).join("")===_,T.detectDuplicates=!!D,O(),T.sortDetached=i(function(e){return 1&e.compareDocumentPosition(q.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),T.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);ge.find=be,ge.expr=be.selectors,ge.expr[":"]=ge.expr.pseudos,ge.uniqueSort=ge.unique=be.uniqueSort,ge.text=be.getText,ge.isXMLDoc=be.isXML,ge.contains=be.contains,ge.escapeSelector=be.escape;var we=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&ge(e).is(n))break;r.push(e)}return r},Te=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=ge.expr.match.needsContext,Ee=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ce=/^.[^:#\[\.,]*$/;ge.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ge.find.matchesSelector(r,e)?[r]:[]:ge.find.matches(e,ge.grep(t,function(e){return 1===e.nodeType}))},ge.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ge(e).filter(function(){for(t=0;t1?ge.uniqueSort(n):n},filter:function(e){return this.pushStack(o(this,e||[],!1))},not:function(e){return this.pushStack(o(this,e||[],!0))},is:function(e){return!!o(this,"string"==typeof e&&Se.test(e)?ge(e):e||[],!1).length}});var ke,Ne=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,je=ge.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||ke,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ne.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ge?t[0]:t,ge.merge(this,ge.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ne,!0)),Ee.test(r[1])&&ge.isPlainObject(t))for(r in t)ge.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=ne.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ge.isFunction(e)?void 0!==n.ready?n.ready(e):e(ge):ge.makeArray(e,this)};je.prototype=ge.fn,ke=ge(ne);var Ae=/^(?:parents|prev(?:Until|All))/,Le={children:!0,contents:!0,next:!0,prev:!0};ge.fn.extend({has:function(e){var t=ge(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&ge.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?ge.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?ae.call(ge(e),this[0]):ae.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ge.uniqueSort(ge.merge(this.get(),ge(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ge.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return we(e,"parentNode")},parentsUntil:function(e,t,n){return we(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return we(e,"nextSibling")},prevAll:function(e){return we(e,"previousSibling")},nextUntil:function(e,t,n){return we(e,"nextSibling",n)},prevUntil:function(e,t,n){return we(e,"previousSibling",n)},siblings:function(e){return Te((e.parentNode||{}).firstChild,e)},children:function(e){return Te(e.firstChild)},contents:function(e){return i(e,"iframe")?e.contentDocument:(i(e,"template")&&(e=e.content||e),ge.merge([],e.childNodes))}},function(e,t){ge.fn[e]=function(n,r){var i=ge.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ge.filter(r,i)),this.length>1&&(Le[e]||ge.uniqueSort(i),Ae.test(e)&&i.reverse()),this.pushStack(i)}});var De=/[^\x20\t\r\n\f]+/g;ge.Callbacks=function(e){e="string"==typeof e?a(e):ge.extend({},e);var t,n,r,i,o=[],s=[],u=-1,c=function(){for(i=i||e.once,r=t=!0;s.length;u=-1)for(n=s.shift();++u-1;)o.splice(n,1),n<=u&&u--}),this},has:function(e){return e?ge.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=s=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},ge.extend({Deferred:function(t){var n=[["notify","progress",ge.Callbacks("memory"),ge.Callbacks("memory"),2],["resolve","done",ge.Callbacks("once memory"),ge.Callbacks("once memory"),0,"resolved"],["reject","fail",ge.Callbacks("once memory"),ge.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 ge.Deferred(function(t){ge.each(n,function(n,r){var i=ge.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&ge.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var a=this,l=arguments,f=function(){var e,f;if(!(t=s&&(r!==c&&(a=void 0,l=[e]),n.rejectWith(a,l))}};t?d():(ge.Deferred.getStackHook&&(d.stackTrace=ge.Deferred.getStackHook()),e.setTimeout(d))}}var s=0;return ge.Deferred(function(e){n[0][3].add(o(0,e,ge.isFunction(i)?i:u,e.notifyWith)),n[1][3].add(o(0,e,ge.isFunction(t)?t:u)),n[2][3].add(o(0,e,ge.isFunction(r)?r:c))}).promise()},promise:function(e){return null!=e?ge.extend(e,i):i}},o={};return ge.each(n,function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add(function(){r=a},n[3-e][2].disable,n[0][2].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ie.call(arguments),o=ge.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ie.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(l(e,o.done(s(n)).resolve,o.reject,!t),"pending"===o.state()||ge.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)l(i[n],s(n),o.reject);return o.promise()}});var Oe=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ge.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Oe.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},ge.readyException=function(t){e.setTimeout(function(){throw t})};var qe=ge.Deferred();ge.fn.ready=function(e){return qe.then(e)["catch"](function(e){ge.readyException(e)}),this},ge.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--ge.readyWait:ge.isReady)||(ge.isReady=!0,e!==!0&&--ge.readyWait>0||qe.resolveWith(ne,[ge]))}}),ge.ready.then=qe.then,"complete"===ne.readyState||"loading"!==ne.readyState&&!ne.documentElement.doScroll?e.setTimeout(ge.ready):(ne.addEventListener("DOMContentLoaded",f),e.addEventListener("load",f));var Fe=function(e,t,n,r,i,o,s){var a=0,u=e.length,c=null==n;if("object"===ge.type(n)){i=!0;for(a in n)Fe(e,t,a,n[a],!0,o,s)}else if(void 0!==r&&(i=!0,ge.isFunction(r)||(s=!0),c&&(s?(t.call(e,r),t=null):(c=t,t=function(e,t,n){return c.call(ge(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){He.remove(this,e)})}}),ge.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Pe.get(e,t),n&&(!r||Array.isArray(n)?r=Pe.access(e,t,ge.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ge.queue(e,t),r=n.length,i=n.shift(),o=ge._queueHooks(e,t),s=function(){ge.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Pe.get(e,n)||Pe.access(e,n,{empty:ge.Callbacks("once memory").add(function(){Pe.remove(e,[t+"queue",n])})})}}),ge.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,Qe=/^$|\/(?:java|ecma)script/i,Ye={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ye.optgroup=Ye.option,Ye.tbody=Ye.tfoot=Ye.colgroup=Ye.caption=Ye.thead,Ye.th=Ye.td;var Je=/<|&#?\w+;/;!function(){var e=ne.createDocumentFragment(),t=e.appendChild(ne.createElement("div")),n=ne.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),pe.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",pe.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Ge=ne.documentElement,Ke=/^key/,Ze=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,et=/^([^.]*)(?:\.(.+)|)/;ge.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,c,l,f,d,p,h,g,v=Pe.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&ge.find.matchesSelector(Ge,i),n.guid||(n.guid=ge.guid++),(u=v.events)||(u=v.events={}), +(s=v.handle)||(s=v.handle=function(t){return"undefined"!=typeof ge&&ge.event.triggered!==t.type?ge.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(De)||[""],c=t.length;c--;)a=et.exec(t[c])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p&&(f=ge.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=ge.event.special[p]||{},l=ge.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ge.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&f.setup.call(e,r,h,s)!==!1||e.addEventListener&&e.addEventListener(p,s)),f.add&&(f.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,l):d.push(l),ge.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,c,l,f,d,p,h,g,v=Pe.hasData(e)&&Pe.get(e);if(v&&(u=v.events)){for(t=(t||"").match(De)||[""],c=t.length;c--;)if(a=et.exec(t[c])||[],p=g=a[1],h=(a[2]||"").split(".").sort(),p){for(f=ge.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)l=d[o],!i&&g!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(d.splice(o,1),l.selector&&d.delegateCount--,f.remove&&f.remove.call(e,l));s&&!d.length&&(f.teardown&&f.teardown.call(e,h,v.handle)!==!1||ge.removeEvent(e,p,v.handle),delete u[p])}else for(p in u)ge.event.remove(e,p+t[c],n,r,!0);ge.isEmptyObject(u)&&Pe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=ge.event.fix(e),u=new Array(arguments.length),c=(Pe.get(this,"events")||{})[a.type]||[],l=ge.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||c.disabled!==!0)){for(o=[],s={},n=0;n-1:ge.find(i,this,null,[c]).length),s[i]&&o.push(r);o.length&&a.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,nt=/\s*$/g;ge.extend({htmlPrefilter:function(e){return e.replace(tt,"<$1>")},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=ge.contains(e.ownerDocument,e);if(!(pe.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ge.isXMLDoc(e)))for(s=y(a),o=y(e),r=0,i=o.length;r0&&x(s,!u&&y(e,"script")),a},cleanData:function(e){for(var t,n,r,i=ge.event.special,o=0;void 0!==(n=e[o]);o++)if($e(n)){if(t=n[Pe.expando]){if(t.events)for(r in t.events)i[r]?ge.event.remove(n,r):ge.removeEvent(n,r,t.handle);n[Pe.expando]=void 0}n[He.expando]&&(n[He.expando]=void 0)}}}),ge.fn.extend({detach:function(e){return D(this,e,!0)},remove:function(e){return D(this,e)},text:function(e){return Fe(this,function(e){return void 0===e?ge.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 L(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=C(this,e);t.appendChild(e)}})},prepend:function(){return L(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=C(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return L(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return L(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&&(ge.cleanData(y(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ge.clone(this,e,t)})},html:function(e){return Fe(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&&!nt.test(e)&&!Ye[(Ue.exec(e)||["",""])[1].toLowerCase()]){e=ge.htmlPrefilter(e);try{for(;n1)}}),ge.Tween=R,R.prototype={constructor:R,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ge.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ge.cssNumber[n]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,n=R.propHooks[this.prop];return this.options.duration?this.pos=t=ge.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):R.propHooks._default.set(this),this}},R.prototype.init.prototype=R.prototype,R.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=ge.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){ge.fx.step[e.prop]?ge.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[ge.cssProps[e.prop]]&&!ge.cssHooks[e.prop]?e.elem[e.prop]=e.now:ge.style(e.elem,e.prop,e.now+e.unit)}}},R.propHooks.scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ge.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ge.fx=R.prototype.init,ge.fx.step={};var gt,vt,mt=/^(?:toggle|show|hide)$/,yt=/queueHooks$/;ge.Animation=ge.extend(X,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,Me.exec(t),n),n}]},tweener:function(e,t){ge.isFunction(e)?(t=e,e=["*"]):e=e.match(De);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){ge.removeAttr(this,e)})}}),ge.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ge.prop(e,t,n):(1===o&&ge.isXMLDoc(e)||(i=ge.attrHooks[t.toLowerCase()]||(ge.expr.match.bool.test(t)?xt:void 0)),void 0!==n?null===n?void ge.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:(r=ge.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!pe.radioValue&&"radio"===t&&i(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(De);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),xt={set:function(e,t,n){return t===!1?ge.removeAttr(e,n):e.setAttribute(n,n),n}},ge.each(ge.expr.match.bool.source.match(/\w+/g),function(e,t){var n=bt[t]||ge.find.attr;bt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=bt[s],bt[s]=i,i=null!=n(e,t,r)?s:null,bt[s]=o),i}});var wt=/^(?:input|select|textarea|button)$/i,Tt=/^(?:a|area)$/i;ge.fn.extend({prop:function(e,t){return Fe(this,ge.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ge.propFix[e]||e]})}}),ge.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ge.isXMLDoc(e)||(t=ge.propFix[t]||t,i=ge.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=ge.find.attr(e,"tabindex");return t?parseInt(t,10):wt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),pe.optSelected||(ge.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)}}),ge.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ge.propFix[this.toLowerCase()]=this}),ge.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(ge.isFunction(e))return this.each(function(t){ge(this).addClass(e.call(this,t,Q(this)))});if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&" "+U(i)+" "){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=U(r),i!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(ge.isFunction(e))return this.each(function(t){ge(this).removeClass(e.call(this,t,Q(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(De)||[];n=this[u++];)if(i=Q(n),r=1===n.nodeType&&" "+U(i)+" "){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");a=U(r),i!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):ge.isFunction(e)?this.each(function(n){ge(this).toggleClass(e.call(this,n,Q(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=ge(this),o=e.match(De)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=Q(this),t&&Pe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Pe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+U(Q(n))+" ").indexOf(t)>-1)return!0;return!1}});var St=/\r/g;ge.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=ge.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,ge(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=ge.map(i,function(e){return null==e?"":e+""})),t=ge.valHooks[this.type]||ge.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=ge.valHooks[i.type]||ge.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(St,""):null==n?"":n)}}}),ge.extend({valHooks:{option:{get:function(e){var t=ge.find.attr(e,"value");return null!=t?t:U(ge.text(e))}},select:{get:function(e){var t,n,r,o=e.options,s=e.selectedIndex,a="select-one"===e.type,u=a?null:[],c=a?s+1:o.length;for(r=s<0?c:a?s:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ge.each(["radio","checkbox"],function(){ge.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=ge.inArray(ge(e).val(),t)>-1}},pe.checkOn||(ge.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=/^(?:focusinfocus|focusoutblur)$/;ge.extend(ge.event,{trigger:function(t,n,r,i){var o,s,a,u,c,l,f,d=[r||ne],p=le.call(t,"type")?t.type:t,h=le.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||ne,3!==r.nodeType&&8!==r.nodeType&&!Et.test(p+ge.event.triggered)&&(p.indexOf(".")>-1&&(h=p.split("."),p=h.shift(),h.sort()),c=p.indexOf(":")<0&&"on"+p,t=t[ge.expando]?t:new ge.Event(p,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=h.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:ge.makeArray(n,[t]),f=ge.event.special[p]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!ge.isWindow(r)){for(u=f.delegateType||p,Et.test(u+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(r.ownerDocument||ne)&&d.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||p,l=(Pe.get(s,"events")||{})[t.type]&&Pe.get(s,"handle"),l&&l.apply(s,n),l=c&&s[c],l&&l.apply&&$e(s)&&(t.result=l.apply(s,n),t.result===!1&&t.preventDefault());return t.type=p,i||t.isDefaultPrevented()||f._default&&f._default.apply(d.pop(),n)!==!1||!$e(r)||c&&ge.isFunction(r[p])&&!ge.isWindow(r)&&(a=r[c],a&&(r[c]=null),ge.event.triggered=p,r[p](),ge.event.triggered=void 0,a&&(r[c]=a)),t.result}},simulate:function(e,t,n){var r=ge.extend(new ge.Event,n,{type:e,isSimulated:!0});ge.event.trigger(r,null,t)}}),ge.fn.extend({trigger:function(e,t){return this.each(function(){ge.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ge.event.trigger(e,t,n,!0)}}),ge.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){ge.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),ge.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.focusin="onfocusin"in e,pe.focusin||ge.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){ge.event.simulate(t,e.target,ge.event.fix(e))};ge.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Pe.access(r,t);i||r.addEventListener(e,n,!0),Pe.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Pe.access(r,t)-1;i?Pe.access(r,t,i):(r.removeEventListener(e,n,!0),Pe.remove(r,t))}}});var Ct=e.location,kt=ge.now(),Nt=/\?/;ge.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||ge.error("Invalid XML: "+t),n};var jt=/\[\]$/,At=/\r?\n/g,Lt=/^(?:submit|button|image|reset|file)$/i,Dt=/^(?:input|select|textarea|keygen)/i;ge.param=function(e,t){var n,r=[],i=function(e,t){var n=ge.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!ge.isPlainObject(e))ge.each(e,function(){i(this.name,this.value)});else for(n in e)Y(n,e[n],t,i);return r.join("&")},ge.fn.extend({serialize:function(){return ge.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ge.prop(this,"elements");return e?ge.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ge(this).is(":disabled")&&Dt.test(this.nodeName)&&!Lt.test(e)&&(this.checked||!Xe.test(e))}).map(function(e,t){var n=ge(this).val();return null==n?null:Array.isArray(n)?ge.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Ot=/%20/g,qt=/#.*$/,Ft=/([?&])_=[^&]*/,$t=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ht=/^(?:GET|HEAD)$/,It=/^\/\//,Rt={},_t={},Mt="*/".concat("*"),Wt=ne.createElement("a");Wt.href=Ct.href,ge.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Mt,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":ge.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?K(K(e,ge.ajaxSettings),t):K(ge.ajaxSettings,e)},ajaxPrefilter:J(Rt),ajaxTransport:J(_t),ajax:function(t,n){function r(t,n,r,a){var c,d,p,b,w,T=n;l||(l=!0,u&&e.clearTimeout(u),i=void 0,s=a||"",S.readyState=t>0?4:0,c=t>=200&&t<300||304===t,r&&(b=Z(h,S,r)),b=ee(h,b,S,c),c?(h.ifModified&&(w=S.getResponseHeader("Last-Modified"),w&&(ge.lastModified[o]=w),w=S.getResponseHeader("etag"),w&&(ge.etag[o]=w)),204===t||"HEAD"===h.type?T="nocontent":304===t?T="notmodified":(T=b.state,d=b.data,p=b.error,c=!p)):(p=T,!t&&T||(T="error",t<0&&(t=0))),S.status=t,S.statusText=(n||T)+"",c?m.resolveWith(g,[d,T,S]):m.rejectWith(g,[S,T,p]),S.statusCode(x),x=void 0,f&&v.trigger(c?"ajaxSuccess":"ajaxError",[S,h,c?d:p]),y.fireWith(g,[S,T]),f&&(v.trigger("ajaxComplete",[S,h]),--ge.active||ge.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,u,c,l,f,d,p,h=ge.ajaxSetup({},n),g=h.context||h,v=h.context&&(g.nodeType||g.jquery)?ge(g):ge.event,m=ge.Deferred(),y=ge.Callbacks("once memory"),x=h.statusCode||{},b={},w={},T="canceled",S={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=$t.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?s:null},setRequestHeader:function(e,t){return null==l&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)S.always(e[S.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(m.promise(S),h.url=((t||h.url||Ct.href)+"").replace(It,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(De)||[""],null==h.crossDomain){c=ne.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Wt.protocol+"//"+Wt.host!=c.protocol+"//"+c.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ge.param(h.data,h.traditional)),G(Rt,h,n,S),l)return S;f=ge.event&&h.global,f&&0===ge.active++&&ge.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Ht.test(h.type),o=h.url.replace(qt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Ot,"+")):(p=h.url.slice(o.length),h.data&&(o+=(Nt.test(o)?"&":"?")+h.data,delete h.data),h.cache===!1&&(o=o.replace(Ft,"$1"),p=(Nt.test(o)?"&":"?")+"_="+kt++ +p),h.url=o+p),h.ifModified&&(ge.lastModified[o]&&S.setRequestHeader("If-Modified-Since",ge.lastModified[o]),ge.etag[o]&&S.setRequestHeader("If-None-Match",ge.etag[o])),(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&S.setRequestHeader("Content-Type",h.contentType),S.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Mt+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)S.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(h.beforeSend.call(g,S,h)===!1||l))return S.abort();if(T="abort",y.add(h.complete),S.done(h.success),S.fail(h.error),i=G(_t,h,n,S)){if(S.readyState=1,f&&v.trigger("ajaxSend",[S,h]),l)return S;h.async&&h.timeout>0&&(u=e.setTimeout(function(){S.abort("timeout")},h.timeout));try{l=!1,i.send(b,r)}catch(e){if(l)throw e;r(-1,e)}}else r(-1,"No Transport");return S},getJSON:function(e,t,n){return ge.get(e,t,n,"json")},getScript:function(e,t){return ge.get(e,void 0,t,"script")}}),ge.each(["get","post"],function(e,t){ge[t]=function(e,n,r,i){return ge.isFunction(n)&&(i=i||r,r=n,n=void 0),ge.ajax(ge.extend({url:e,type:t,dataType:i,data:n,success:r},ge.isPlainObject(e)&&e))}}),ge._evalUrl=function(e){return ge.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},ge.fn.extend({wrapAll:function(e){var t;return this[0]&&(ge.isFunction(e)&&(e=e.call(this[0])),t=ge(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 ge.isFunction(e)?this.each(function(t){ge(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ge(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ge.isFunction(e);return this.each(function(n){ge(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ge(this).replaceWith(this.childNodes)}),this}}),ge.expr.pseudos.hidden=function(e){return!ge.expr.pseudos.visible(e)},ge.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ge.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},zt=ge.ajaxSettings.xhr();pe.cors=!!zt&&"withCredentials"in zt,pe.ajax=zt=!!zt,ge.ajaxTransport(function(t){var n,r;if(pe.cors||zt&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(Bt[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(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),ge.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ge.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 ge.globalEval(e),e}}}),ge.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ge.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=ge("